Skip to content

Add iMXRT ESP32 programmer app#106

Merged
hathach merged 21 commits into
masterfrom
imxrt-usb2uart
Mar 26, 2021
Merged

Add iMXRT ESP32 programmer app#106
hathach merged 21 commits into
masterfrom
imxrt-usb2uart

Conversation

@hathach
Copy link
Copy Markdown
Member

@hathach hathach commented Mar 25, 2021

  • Refactor build system to allow building useful applications such as erase_firmware, self-update, esp32programmer. Although they are not considered as part of bootloader, they are useful for production/recovery purpose. Put it in this repo allow to use the current board_api abstraction easily. These should not be used for complicated application though.
  • Separate NO_TINYUF2_BUILD into BUILD_APPLICATION and BUILD_NO_TINYUSB` (some app may still use tinyusb)
  • Add esp32programmer app for imxrt specifically (may generalize it later on if needed), baudrate changed based on terminal is also supported
  • Simple tests look good.

@ladyada Can you test the attached uf2 to see if it works on the metro m7. esp32programmer-metro_m7_1011.zip

I have trouble putting the esp32 into DFU mode, since I dont have an esp32 breakout and have to use one of the dev board (with cp2104). However, once put into the DFU mode manually. It can flash with 115200 and 921600 as follow.

$ esptool.py --port /dev/ttyACM1 --before no_reset --baud 115200 write_flash 0 NINA_W102-1.7.1.bin 
esptool.py v3.0
Serial port /dev/ttyACM1
Connecting.....
Detecting chip type... ESP32
Chip is ESP32-D0WDQ6 (revision 0)
Features: WiFi, BT, Dual Core, Coding Scheme None
Crystal is 40MHz
MAC: 18:fe:34:6a:93:2c
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Compressed 1159168 bytes to 633525...
Wrote 1159168 bytes (633525 compressed) at 0x00000000 in 55.8 seconds (effective 166.1 kbit/s)...
Hash of data verified.
$ esptool.py --port /dev/ttyACM1 --before no_reset --baud 921600 write_flash 0 NINA_W102-1.7.1.bin 
esptool.py v3.0
Serial port /dev/ttyACM1
Connecting....
Detecting chip type... ESP32
Chip is ESP32-D0WDQ6 (revision 0)
Features: WiFi, BT, Dual Core, Coding Scheme None
Crystal is 40MHz
MAC: 18:fe:34:6a:93:2c
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Compressed 1159168 bytes to 633525...
Wrote 1159168 bytes (633525 compressed) at 0x00000000 in 10.6 seconds (effective 877.9 kbit/s)...
Hash of data verified.

We can have some DTR, RTS manipulation to enter DFU mode as well https://github.com/adafruit/tinyuf2/blob/imxrt-usb2uart/ports/mimxrt10xx/apps/esp32programmer/main.c#L161 . Though the above issue get into testing.

@hathach hathach marked this pull request as ready for review March 25, 2021 14:22
@hathach
Copy link
Copy Markdown
Member Author

hathach commented Mar 25, 2021

side note for myself regarding epstool using dtr, rts to put esp32 into bootloader

@hathach hathach merged commit 74a86e1 into master Mar 26, 2021
@hathach hathach deleted the imxrt-usb2uart branch March 26, 2021 04:48
@ladyada
Copy link
Copy Markdown
Member

ladyada commented Mar 26, 2021

i tested, this is great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants