teensy loader problem

Status
Not open for further replies.

jrdarrah

Well-known member
It may be self induced but I'm trying to use Teensy.exe on a windows 7 machine to load a .hex file to a Teensy 3.2. This works fine when using the Arduino IDE but I need to be able to send update so users can update the code themselves. When using the IDE I tell it to compile and upload, it does so without any intervention from me (most of the time). When I start the teensy loader from a command line it does nothing when I open the hex file.

The verbose help is...

18:00:50.036: Teensy Loader 1.37, begin program
18:00:50.098: File "eBagpipeV4.ino.TEENSY31.hex". 95112 bytes, 36% used
18:00:50.114: Listening for remote control on port 3149
18:00:50.114: initialized, showing main window
18:00:50.363: HID/win32: vid:046D pid:C52B ver:1203
18:00:50.363: HID/win32: vid:046D pid:C52B ver:1203
18:00:50.363: HID/win32: vid:046D pid:C52B ver:1203
18:00:50.363: HID/win32: vid:046D pid:C52B ver:1203
18:00:50.363: HID/win32: vid:046D pid:C52B ver:1203
18:00:50.363: HID/win32: vid:051D pid:0002 ver:0101
18:00:50.363: HID/win32: vid:056A pid:0315 ver:0100
18:00:50.363: HID/win32: vid:056A pid:0315 ver:0100
18:00:50.363: HID/win32: vid:056A pid:0315 ver:0100
18:00:50.363: HID/win32: vid:056A pid:0315 ver:0100
18:00:53.780: Auto Button event
18:00:53.780: Auto mode: enabled
18:00:58.226: Verbose Info event
18:01:01.346: Open File event
18:01:03.389: File "test.ino.TEENSY31.hex". 95112 bytes, 36% used

What I need for it to do is to download the new code and reboot without need to press the button on the 3.2 board.

If I get the loader into manual mode, which seems to be random. Sometimes I can get it to un-grey the program and reboot selections. If in that state I can click each one in turn and get the new code loaded.

How can I get the teensy loader to run in automatic mode when it is started manually?
 
What I need for it to do is to download the new code and reboot without need to press the button on the 3.2 board.

If I get the loader into manual mode, which seems to be random. Sometimes I can get it to un-grey the program and reboot selections. If in that state I can click each one in turn and get the new code loaded.

How can I get the teensy loader to run in automatic mode when it is started manually?

AFAIK, standalone procedure (user update) is
-start teesnsy.exe
-select hexfile
either
a)
-select automatic mode
-press button on teensy (needs teensy connected)
b)
-unselect automatic mode
-press download button (needs teensy connected with working com port and usb running)
-press start button
that's all, there are no other options

I understand you have trouble with option b), so conditions are not satisfied.

There are cli versions around (search this forum) that allow download with a bat file.
 
I have the CLI version and it too requires the button be pushed. When the new code is loaded via the Arduino IDE it too uses the teensy loader but it doesn't require the button be pushed. I guess I'm missing a piece that the IDE does before loading the new sketch that allows it to work with the teensy without manually pushing the button.

I played around with the last line of the verbose output from the IDE which seems to be where the "magic" happens.

C:\Program Files (x86)\Arduino\hardware\teensy/../tools/teensy_post_compile -test -file=test4.ino -path=C:\Users\JimD\AppData\Local\Temp\arduino_build_986157 -tools=C:\Program Files (x86)\Arduino\hardware\teensy/../tools -board=TEENSY31 -reboot

Help on that program yields this -

teensy_post_compile - inform the Teensy Loader of freshly compiled code

Usage:
teensy_post_compile -file=<file> -path=<path> -tools=<toolspath>

<file> - The code to program (without .hex) to your Teensy board
<path> - The directory where <file.hex> is located
<toolspath> - The directory where the Teensy Loader is located

This accomplishes what I want to do which is load without user intervention, but requires access to the original sketch file. I don't want to send the user the code, just the .hex. When I tried the command line again, it was waiting on the button, so in another command window I ran the teensy_reboot and it started to download the code but errored out with - Found HalfKay Bootloader Programming.error writing to Teensy. To get my teensy back I had to use the IDE again.

For now I'll see if I can find the teensy_post_compile source to see what it does. Thanks for the input. I'll add a post back here is I figure this out.
 
Status
Not open for further replies.
Back
Top