Flashing through USB, do I need reset and boot buttons?

virpio
Posts: 2
Joined: Mon Aug 26, 2024 1:42 am

Flashing through USB, do I need reset and boot buttons?

Postby virpio » Sat Sep 21, 2024 11:22 pm

I am trying to eliminate the UART interface on my PCB by connecting the USB port to the USB data pins on the ESP32 (C6 in this case, in case it matters).

When I try this with a dev board I notice that I do not have to press the boot or reset pins to flash a new firmware. I would like to get some clarification on when those are actually needed and when the ESP can handle things by itself.

If I route the USB data pins to the ESP32C6, are there any situations in which I would need the boot and reset buttons to be able to flash it?

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: Flashing through USB, do I need reset and boot buttons?

Postby ESP_Sprite » Sun Sep 22, 2024 6:26 am

Yes. The very first flash will be a bit tricky without those, as without valid firmware the ESP32 will end up in a bootloop and without a boot button you need to time the flash exactly right to get the C6 into its bootloader. Also, if your firmware somehow disables USB-serial-JTAG (by e.g. immediately going into sleep mode, or reconfiguring the USB GPIOs), you need a button to get USB connectivity back.

Note that if your device can be powered off in hardware (e.g. it's fed from USB, or it has a battery with a hard switch), you can usually get away without the reset button as a power-on achieves the same effect. If your devices needs buttons anyway, it's easy to connect one to the GPIO9 pin; during normal operation, it acts like a normal button, but in an emergency you can hold it while powering on the device and you can always reflash it.

Who is online

Users browsing this forum: No registered users and 349 guests