Using Eclipse to upload to a Teensy++2.0?

Status
Not open for further replies.

Roger Parkinson

Active member
I suspect the kind of Teensy 2 doesn't matter but what I am using today is a teensy++2.0
I have my Eclipse environment all set up to build the hex file (which looks successful) and at the end my make file does this: teensy_reboot -v -v -v -v -pat90usb1286 -chalfkay -P/dev/ttyACM0 -b12000000 -D -Uflash:w:./Release/BlinkTeensy++2.0.hex:i
It looks like it works and it shows me this:
Code:
teensy_reboot, verbose mode
pid:1, vid1, name:1
found: /dev/ttyACM0
add_serial_name, /dev/ttyACM0
trying port 3149
get_line: "Teensy Loader 1.06"
found Teensy Loader, version 1.06
send: status - at Tue Mar  5 18:00:52 2013
sent: status - at Tue Mar  5 18:00:52 2013
get_line: "dir:/tmp/build3641049840847516656.tmp/"
get_line: "file:Blink.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:0"
auto = 0
get_line: "online:0"
online = 0
get_line: "online_count:0"
online_count = 0
get_line: "offline_count:0"
offline_count = 0
get_line: "state:0"
state = 0
get_line: "code_size:130048"
get_line: "EOT"
send: auto:on
get_line: "Ok"
do_reset (serial) /dev/ttyACM0
-----------------------------removed a lot of repetition here
send: status - at Tue Mar  5 18:00:53 2013
sent: status - at Tue Mar  5 18:00:53 2013
get_line: "dir:/tmp/build3641049840847516656.tmp/"
get_line: "file:Blink.cpp.hex"
get_line: "readable:1"
readable = 1
get_line: "auto:1"
auto = 1
get_line: "online:1"
online = 1
get_line: "online_count:1"
online_count = 1
get_line: "offline_count:0"
offline_count = 1
get_line: "state:1"
state = 1
get_line: "code_size:130048"
get_line: "EOT"
status read, retry 8
Success
It is loading a file called Blink.cpp.hex from a tmp directory and, sure enough, this is what is running at the end. But this isn't the file I asked for.
Does anyone know what is going on here? I actually thought this was working some time ago but think it fooled me. The file it loads is a test one I loaded from the Arduino IDE.
How can I get the hex file I just built ie ./Release/BlinkTeensy++2.0.hex to load?

I have tried obvious things like comparing the log from the Arduino IDE and making sure they are the same. The Arduino IDE does this:
Code:
teensy_reboot -v -v -v -v -pat90usb1286 -chalfkay -P/dev/ttyACM0 -b12000000 -D -Uflash:w:/tmp/build3641049840847516656.tmp/Blink.cpp.hex:i
I've tried simpler variations in the make file and I also tried using the cli which looked like it worked but nothing seemed to be running.

Thanks for any help
Roger
 
I think I have this solved.
I stopped using teensy_reboot and changed to the cli so my command is now:
${AVRDUDEPATH}/teensy_loader_cli -mmcu=${AVRTARGETMCU} -v -w ${PWD}/${BuildArtifactFileBaseName}.hex
which translates out to
/home/roger/kits/arduino-1.0/hardware/tools//teensy_loader_cli -mmcu=at90usb1286 -v -w /home/roger/workspaceCPP/BlinkTeensy++2.0/Release/BlinkTeensy++2.0.hex

and produces the log:
Code:
Teensy Loader, Command Line, Version 2.0
Read "/home/roger/workspaceCPP/BlinkTeensy++2.0/Release/BlinkTeensy++2.0.hex": 2660 bytes, 2.0% usage
Waiting for Teensy device...
 (hint: press the reset button)
Found HalfKay Bootloader
Read "/home/roger/workspaceCPP/BlinkTeensy++2.0/Release/BlinkTeensy++2.0.hex": 2660 bytes, 2.0% usage
Programming...........
Booting
The program doesn't actually run yet but that's a different topic. I tested the cli using those switches with a known-working hex file and it definitely loads okay.
 
Status
Not open for further replies.
Back
Top