ESP32-C3 first programming via USB

andrea.longobardi85
Posts: 3
Joined: Mon Feb 27, 2023 2:23 pm

ESP32-C3 first programming via USB

Postby andrea.longobardi85 » Mon Feb 27, 2023 2:37 pm

Hello,

I have built a custom board with the ESP32-C3 and I was intending to program (and debug) the ESP32-C3 only via USB.
Although it seems that to program the device the very first time I need to hold the IO9 pin low. Even reading around in the forum it seems there people have to do it as well.
I would like to understand if it is mandatory and why it is that, as I thought the USB_JTAG core could directly flash the new firmware.
if confirmed this will slow down and complicate the mass production process of the final product as we need to drive an extra pin during programming (or maybe add a button just for this reason).

Thanks for your help!!!

Andrea

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

Re: ESP32-C3 first programming via USB

Postby ESP_Sprite » Tue Feb 28, 2023 12:53 am

It's not mandatory per se, but it is helpful. The issue is that an empty ESP32-C3 normally will try to boot from flash and fail. After a few attempts, the RTC watchdog will kick in to reset the entire chip. This is useful as it may clear any transient error that would stop a properly flashed chip from booting. However, it also resets the USB-serial-JTAG device, causing the OS to re-enumerate it. Going into download mode (either by pulling low GPIO9, or by successfully connecting using the flashing app) stops that from happening, allowing the chip to be flashed as normal.

Not having GPIO9 accessible will generally work (depending on how fast your OS is in detecting USB devices) but may require a few tries in flashing for the timing to be right.

(Another thing is that without forcing the chip into download mode, for old versions of esptool, a watchdog will keep running during the flashing process, which may interrupt flashing if the firmware is fairly large. Using a newer version of esptool should fix that, however.)

mihash
Posts: 2
Joined: Fri Sep 20, 2024 7:28 pm

Re: ESP32-C3 first programming via USB

Postby mihash » Fri Sep 20, 2024 7:36 pm

I have the same issue; I would like to program my custom PCBs with ESP32-C3 via UART or USB. I want to program it in auto-programming mode via UART, meaning I don’t want to press any boot or reset buttons. I tried using FT232 where GPIO9 goes to DTR and EN is connected to RTS, but it doesn’t work. It’s strange because this setup works for ESP32-WROOM. Could someone help me find the fastest and easiest way to program the ESP32-C3 with the final firmware? Im using Arduino IDE

mihash
Posts: 2
Joined: Fri Sep 20, 2024 7:28 pm

Re: ESP32-C3 first programming via USB

Postby mihash » Thu Sep 26, 2024 6:37 am

I found where the problem was GPIO8 must be in high state

Who is online

Users browsing this forum: No registered users and 103 guests