Skip to content

fix: keep ESP32-C3 from booting into download mode after flashing - #62

Merged
deadprogram merged 1 commit into
mainfrom
fix-small-flashing
Aug 25, 2026
Merged

fix: keep ESP32-C3 from booting into download mode after flashing#62
deadprogram merged 1 commit into
mainfrom
fix-small-flashing

Conversation

@deadprogram

Copy link
Copy Markdown
Member

Three causes of the "wait usb download" after a successful flash (#60):

  • The ROM's RTC_CNTL_OPTION1 force-download-boot bit survives a reset, so clear it before resetting (C3, S3), as esptool does.
  • Reset() ended the stub session with reboot=true, rebooting into the ROM bootloader and re-enumerating USB, so the DTR/RTS reset that followed hit a stale fd. Use reboot=false and let the hard reset restart the chip.
  • C3 USB-Serial/JTAG detection picked the UARTDEV_BUF_NO address from a revision decoded out of MAC eFuse bytes, so it usually read the wrong address and missed the interface. Match on USB VID/PID instead, as esptool does, with the ROM variable as fallback.

Also report failed DTR/RTS writes instead of logging "Device reset."

Three causes of the "wait usb download" after a successful flash (#60):

- The ROM's RTC_CNTL_OPTION1 force-download-boot bit survives a reset, so
  clear it before resetting (C3, S3), as esptool does.
- Reset() ended the stub session with reboot=true, rebooting into the ROM
  bootloader and re-enumerating USB, so the DTR/RTS reset that followed hit
  a stale fd. Use reboot=false and let the hard reset restart the chip.
- C3 USB-Serial/JTAG detection picked the UARTDEV_BUF_NO address from a
  revision decoded out of MAC eFuse bytes, so it usually read the wrong
  address and missed the interface. Match on USB VID/PID instead, as
  esptool does, with the ROM variable as fallback.

Also report failed DTR/RTS writes instead of logging "Device reset."

Signed-off-by: deadprogram <ron@hybridgroup.com>
@deadprogram

Copy link
Copy Markdown
Member Author

Any comments/feedback before merge?

@deadprogram

Copy link
Copy Markdown
Member Author

Merging since it is working well in my testing.

@deadprogram
deadprogram merged commit c3b720c into main Aug 25, 2026
3 checks passed
@deadprogram
deadprogram deleted the fix-small-flashing branch August 25, 2026 16:47
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.

1 participant