Newbie: Question about the "Teensy Loader"

Status
Not open for further replies.

Dirk67

Member
Hi,
I'm just a newbie to the arduino- and/or teensy -"world"

I played around already a lot with the C-language, Atmel Studio 6 and flashing AVR's the classical way with the "AVRISP mkII".

Now I found your teensy series of boards and see a lot of advantages for me (maybe... in future...)

Now my Questions about the "Teensy Loader" (mainly about Teensy 2.0):

- It would be important for my planned projects in future
that laymen can update the firmware of the boards (just with their own PC and a simple USB Cable)
This is possible if I understood the "Teensy Loader" concept right... (?)

- The second thing is that the same laymen should also be able to upload new EEPROM contents (EEPROM-Hex-file) by the bootloader.
(I saw this possibility on other bootloaders --> e.g. this one --> http://download.chip45.com/chip45boot2_infosheet.pdf )
is this possible with the "Teensy Loader" as well ?

- can the "Teensy Loader" be used for the teensy 3.0 as well ?

- does the Teensy board (the HalfKay) "wait" (for the "Teensy Loader") after each reboot* some seconds before the user program starts to run ?
*(each reboot = no matter if power-up-event or (reset-)pushbutton)
or the same question the other way around:
- does the HalfKay "distinguish" if the reset comes from a regular power-up-event or from the pushbutton ?


Thanks in advance for your patience ... :eek:
 
Last edited:
Teensy 3 does not work quite the same way as Arduino. Note that the pushbutton on the Teensy 3 is actually a "program" button, not just "reset", so it starts up the bootloader which is in the secondary ARM chip on the Teensy 3, and waits for the PC to send it a new software load (eg. hex file). There is a reset line brought out to the edge pin, but you have to add your own pushbutton to short it to ground for a reset. With that reset line there is no bootloader in the way, your own program starts running immediately.
 
The startup behavior - which program runs when - is documented on the Getting Started page.

http://www.pjrc.com/teensy/first_use.html

On both Teensy 2.0 and 3.0, your program runs when the board powers up. The bootloader does not run unless you push the button, or your program explicitly attempts to jump to the bootloader code.

The Teensy Loader has an undocumented feature, currently only on Teensy 2.0, where it looks for EEPROM data in a corresponding .elf file. If an elf file with the same name as your hex file is found, and it contains the same binary firmware image, and if it has eeprom data embedded, the Teensy 2.0 gets its eeprom memory written with that data. This feature is not yet supported for Teensy 3.0, but I plan to add it in a few months.
 
thanks for you answers.

So I understand, that it's not possible to upload the eeprom data (e.g. special machine parameter sets) separate from the firmware,
one can upload only firmware and eeprom data in one common step.

[Edit]
is it possible for the teensy 2.x boards to work with the atmel factory configured USB bootloader
and atmel "flip" application (or compatible like e.g. http://dfu-programmer.sourceforge.net/ )
instead of HalfKay/Teensy Loader?
--> http://www.atmel.com/Images/doc7769.pdf
--> http://www.atmel.com/Images/doc7618.pdf
--> http://www.atmel.com/Images/doc8457.pdf
--> http://www.atmel.com/tools/FLIP.aspx?tab=overview
 
Last edited:
wheres the hex?

if i am using the stock Arduino IDE with the Teensy add on, how do i get the hex code to upload for firmware updates? when i compile and upload using the IDE there is no hex file saved anywhere unless there is an option of which i am not aware. it must be written to a temp location and then deleted. i want to make a very simple HID to use for a variety of data acquisition applications. i was previously using USB gamepads by making my own switches pots etc.
 
if i am using the stock Arduino IDE with the Teensy add on, how do i get the hex code to upload for firmware updates? when i compile and upload using the IDE there is no hex file saved anywhere unless there is an option of which i am not aware. it must be written to a temp location and then deleted..
Yes, it is written to a temp location.
Some enhanced IDEs have options to tell you where and what filename.
 
is it possible for the teensy 2.x boards to work with the atmel factory configured USB bootloader
and atmel "flip" application

The short answer: no, but maybe.

No, as shipped by PJRC, they definitely do not work with Flip.

Maybe they could be made to work, but you'd need to do to the trouble of soldering (or otherwise connecting) a 6 pin ISP cable and ISP programming Atmel's bootloader (do they still provide the .hex file?) Not only is this a time-consuming step, but you can never restore the board back to the Halfkay bootloader. So if you attempt this, please do so knowing it is permanent, and there is no guarantee it will even work. This is definitely not recommended.

But really, why would you want to use Atmel's Flip program anyway?
 
The Teensy Loader has an undocumented feature, currently only on Teensy 2.0, where it looks for EEPROM data in a corresponding* .elf file. If an elf file with the same name as your hex file is found, and it contains the same binary firmware image, and if it has eeprom data embedded, the Teensy 2.0 gets its eeprom memory written with that data. This feature is not yet supported for Teensy 3.0, but I plan to add it in a few months.

PaulStoffregen said:
But really, why would you want to use Atmel's Flip program anyway?

my intention is to enable a "layman" (=users of my application) to upload EEPROM-data to the board
and doing this separate from my normal firmware in flash (without 'touching' / overwriting my normal firmware) ...

*(my EEPROM files are not corresponding with my firmware-versions / are independent from firmware-versions)

this is the only reason for me to think about that...
 
Last edited:
I would agree with Nantonos, that coding this feature into your program is the best way.

my intention is to enable a "layman" (=users of my application) to upload EEPROM-data to the board
and doing this separate from my normal firmware in flash (without 'touching' / overwriting my normal firmware) ...

Teensy Loader has a feature where it will automatically program the EEPROM with any EEMEM variables from your program. It will automatically look for a .elf file in the same directory as your .hex file, and if it contains any EEPROM data, that data is indeed written to the EEPROM. This happens automatically and without clicking special dialog boxes or other stuff like in Flip.
 
Hi all

Although it may seem I'm reviving this old thread, the question at hand is actually quite pertinent.

We are building our boards using Teensy 3.2 and using our own programmed interface to load a number of information and parameters into the EEPROM.
It would be very useful to us, to have a way to load an OBJ file directly into the Teensy eeprom.

As an example, on other products (avr based) we use the Tinysafeboot bootloader:
with it, we can build a workflow where
- we dump a model EEPROM to an OBJ file once and then
- we then use a script that basically modifies the model OBJ dump with the parameters we need for each device being prepared
- finally load it directly into EEPROM.

This is significantly faster than what we currently do, by loading the firmware, booting, writing parameters, rebooting, ....

Also, because EEPROM dumps are typically written as a sequence of bytes corresponding to the sequence of EEPROM addresses they're quite easy to manipulate on the PC end and upload them to the board.

I understand this might not be on top of the To Do list but it's definitely something we'd like to see being supported by such an advanced bootloader, and the corresponding command line tools.

Looking forward for any of your comments,

Thank you
Pedro
 
Status
Not open for further replies.
Back
Top