Hello there,
I would like to program the Teensy 4.0 over-the-air using an ESP32. Whereby the ESP32 programs the Teensy 4.0 over UART.
Read other topics on this with previous versions of Teensy boards but wasn't able to rule out whether it is possible to do it on the Teensy 4.0.
Therefore my take on this by reading the reference manual of the RT1060.
What is the best way to go about this if it's even possible?
1. Serial downloader mode
The RT1060's Reference Manual states a "Serial downloader" feature at page 265.
First off the chip must boot into serial downloader mode by setting the BOOT_MODE[1:0] pins to 01.
These pins GPIO_AD_B0_04/BOOT_MODE0 and GPIO_AD_B0_05/BOOT_MODE1 are connected to PTA4 of the MKL02Z32VFG4 chip and GND respectively. Therefore it would already be impossible to get a 01 value on these pins. So this doesn't work.
Another way to go into serial downloader mode is by booting from the fuses with BT_FUSE_SEL = 0
"If BT_FUSE_SEL = 0, indicating that the boot device (for example, flash, SD/ MMC) was not programmed yet, the boot flow jumps directly to the Serial Downloader."
How do I boot from the fuses and make sure BT_FUSE_SEL = 0?
I suppose the MKL02Z32VFG4 is responsible for booting the RT1060 from choosing between boot from fuses and internal boot using the BOOT_MODE0 pin.
I suppose BT_FUSE_SEL must already be zero otherwise the USB upload wouldn't work.
Does activating the Program pin boot from the internal fuses?
After entering the serial downloader mode I should be able to use the Serial Download Protocol commands from the reference manual on the following pins:
Pin 24 / AD_B0_12 / TX
Pin 25 / AD_B0_13 / RX
I'll figure the rest out later since I don't know whether it's feasible yet.
2. ESP32-S2 USB upload
An alternative would be using the new ESP32-S2 with USB feature to upload using USB.
3. Write to flash from already running code
Another alternative is to only replace a part of the code using code already running on the board uploaded using USB once.
If this is thé way, how do I go about this? Are there examples somewhere?
I would like to program the Teensy 4.0 over-the-air using an ESP32. Whereby the ESP32 programs the Teensy 4.0 over UART.
Read other topics on this with previous versions of Teensy boards but wasn't able to rule out whether it is possible to do it on the Teensy 4.0.
Therefore my take on this by reading the reference manual of the RT1060.
What is the best way to go about this if it's even possible?
1. Serial downloader mode
The RT1060's Reference Manual states a "Serial downloader" feature at page 265.
First off the chip must boot into serial downloader mode by setting the BOOT_MODE[1:0] pins to 01.
These pins GPIO_AD_B0_04/BOOT_MODE0 and GPIO_AD_B0_05/BOOT_MODE1 are connected to PTA4 of the MKL02Z32VFG4 chip and GND respectively. Therefore it would already be impossible to get a 01 value on these pins. So this doesn't work.
Another way to go into serial downloader mode is by booting from the fuses with BT_FUSE_SEL = 0
"If BT_FUSE_SEL = 0, indicating that the boot device (for example, flash, SD/ MMC) was not programmed yet, the boot flow jumps directly to the Serial Downloader."
How do I boot from the fuses and make sure BT_FUSE_SEL = 0?
I suppose the MKL02Z32VFG4 is responsible for booting the RT1060 from choosing between boot from fuses and internal boot using the BOOT_MODE0 pin.
I suppose BT_FUSE_SEL must already be zero otherwise the USB upload wouldn't work.
Does activating the Program pin boot from the internal fuses?
After entering the serial downloader mode I should be able to use the Serial Download Protocol commands from the reference manual on the following pins:
Pin 24 / AD_B0_12 / TX
Pin 25 / AD_B0_13 / RX
I'll figure the rest out later since I don't know whether it's feasible yet.
2. ESP32-S2 USB upload
An alternative would be using the new ESP32-S2 with USB feature to upload using USB.
3. Write to flash from already running code
Another alternative is to only replace a part of the code using code already running on the board uploaded using USB once.
If this is thé way, how do I go about this? Are there examples somewhere?
Last edited: