Is it possible to upload code to teensy (3.x) using hardware serial

Status
Not open for further replies.

local_dani_21

Well-known member
Hi Paul, hi everybody

I've been using a Teensy - hardware serial - RPi - setup using Mattias Schlenkers "nuage" for a while (http://www.arduino-hausautomation.de/nuage/). It works very well. It would be very interesting though to be able to program the teensy using hardware serial. Is that possible? If not - why? Would there be a possible solution (e.g. with a modified Halfkay)?. I think it would make teensies a lot more attractive, if the original Arduino IDE could be used to upload code to a (nuage)-network attached teensy. Mattias offered to modify his nuage-setup if possible so it would work well with your great boards.

Thanks for considering,
Dani
 
This one comes up a lot, and the answer is 'yes but it's hard', searching the forum for 'ota update' gets most of the history.

The teensy bootloader runs in the second smaller chip, and works by lobotomizing the main CPU when programing, clearing out any hardware settings that might have been mis-set and then loading in a USB bootloader program. This makes Teeny's really hard to brick when you start using power saving modes, custom USB settings, low clock speeds or anything else that would disable a classic single chip design. So there isn't a easily editable bootloader. There has been some discussion on adding some form of OTA load, but it all hinges on some way to keep the current highly reliably loading process for beginners without wasting a pin or board realestate on a mode select mechanism.

That said it is perfectly possible to load some form of bootloader of your own into the main CPU, and then only use the USB bootloading process when things go south and USB is lost. There are a couple of examples of varying complexity on the forum, and a more comercial solution in http://www.utasker.com/kinetis/TEENSY_3.1.html
 
Thank you for the answer, I'm so impressed with what happens behind the curtains. I think, the teensyloader is the best way to upload code for the moment!
 
Should have also mentioned a possible but tedious option is that you can either run teensy loader on a Pi, or use the https://www.pjrc.com/teensy/loader_cli.html, so you have the Teensy connected by USB to allow a possible upload path for new code having got your hex file there and remoted into the PI. More work than just plugging into your PC, but does give options if the whole thing is sealed up in some way.
 
Status
Not open for further replies.
Back
Top