ISP, FOR Teensy

Status
Not open for further replies.

finchamp

Active member
A lot has been written on using Teensys as programmers for 8-bit Atmels. I'm wondering if someone could point me in the right direction as to how I could instead program a Teensy from another MCU.

My goal is to be able to flash new firmware remotely using an on-site coprocessor. Hex files would arrive to the programmer over IP, which I can handle. But I'm new to Teensy, and the MKL02 programmer toolchain leaves me unclear as to how I should attempt this. I'm sure it's been discussed, but Search hasn't lent any help.

Thanks.
 
Any thoughts on this? I was thinking about having an STM32, ESP, or 328 in the same box (something cheap and decently well-supported), hooked up to the Teensy and ready to burn updates through a simple web page.
 
It can be done from Teensy 3.6 using USB. I have some code laying around... could clean it up and put it on github if anyone's interested.
 
The future update scenario for my project (still in development) would like to see a T3.6 which reads the hex file from the built-in SD-Card and flashes it over USB into a T3.5 or T3.2...
 
I'm interested as well. I hadn't planned to use a second Teensy, but I'm guessing a USB host is required to talk to the programmer?
 
It's a little more complicated than that. While Arduino's USB is just a hw serial port routed through a FTDI chip into USB, the Teensy's primary USB port is native. If I understand it correctly, programming does not happen in serial but in HID mode. The host sends a command to the MKL02 boot loader chip which activates and takes care of flashing the incoming data stream into the main CPU. At the end, it's the reboot command again from the host which triggers the MKL02 to reboot the main CPU
 
Would this be easier on a standalone PCB with MK66 and MKL/Halfkay programmer on-board? I'd like to re-flash with a cheap processor, but if another 3.6 is the easiest way to do it, I'll go that direction.
 
Let’s wait what Paul will put on github, study the source code to understand how things are intended to work, then take a decision.
 
Luni, thanks for linking that. It does look good. Can I assume that the code in that thread is current? Also, I think I follow the intended use of the TeensyHalfKayDriver class, but do you have code you could share where the process is demonstrated?
 
The code in the linked thread should be quite current but it only contains the two drivers. If you are interested in the complete project including the hex parser and the actual downloading you can download a zip here: https://www.dropbox.com/s/5bmysfjjq2ug81x/usbhost.zip?dl=0 (I don't want to upload it to the forum since the zip is quite large (700kB)) It is a VisualStudio project. If you want to compile it from there you'll have to adjust some paths at the top of the makefile. Anyway, transfering it to the Arduino IDE should be straight forward.
 
Status
Not open for further replies.
Back
Top