Revive ESP32-S3 flashed with MicroPython with no GPIO0 Connected - Wed, Oct 25, 2023
What can you do when you forgot to connect your BOOT0 pin.
OK. I have a custom board with ESP32-S3-MINI-1 on it. And I did not connect GPIO0 to a test pad. I flashed micropython without realizing the firmware does not expose a way to get the bootloader. What can I do?
Well it is easy. There exists a time period where the on-board USB-JTAG peripheral is still active (as micropython has not booted yet) when you power the board up. esptool.py
will not be able to catch this one moment, but openocd
can.
First unplug the board. Put this
openocd -f board/esp32s3-builtin.cfg -c "init;halt;"
in your terminal but don’t press enter.
Plug it in. Wait about 0.5s-1.5s and press enter. If it does not work, unplug, and try with another delay amount. If you see this
Open On-Chip Debugger v0.11.0-esp32-20221026 (2022-10-26-14:48)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001
Info : esp_usb_jtag: capabilities descriptor set to 0x2000
Warn : Transport "jtag" was already selected
Info : esp_usb_jtag: serial
Info : esp_usb_jtag: Device found. Base speed 40000KHz, div range 1 to 255
Info : clock speed 40000 kHz
Info : JTAG tap: esp32s3.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32s3.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : starting gdb server for esp32s3.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
Info : [esp32s3.cpu0] Debug controller was reset.
Info : [esp32s3.cpu0] Core was reset.
That’s great. Now Ctrl+C
and exit openocd. The ESP32-S3 will stay in reset state. It’s time to get esptool.py
:
esptool.py --chip esp32s3 --port /dev/cu.usbmodem101 erase_flash
Congratulations, your ESP32-S3 is alive again!