ESP32-C3-MINI-1 Flash via UART
-
- Posts: 7
- Joined: Tue Nov 01, 2022 10:24 am
ESP32-C3-MINI-1 Flash via UART
Hello everyone,
I am fairly new to the ESP32 development and wanted to develope a simple bluetooth switch. E.g: A dedicated pin is switch high when a bluetooth signal is transmitted. Therefore I programmed the code and checked it with the ESP32-C3_DevKitM-1. Everything worked perfectly fine.
After confirming that everything is working as desired I designed and ordered a small PCB with the respective circuit. My idea was, to flash the ESP32-C3 via UART connection (Tx,Rx) using a USB to TTL Bridge. I verified that this way of flashing is wortking with the DevKit as well. When trying to flash the chip on my PCB via UART no serial communication can be established. I checked the USB-TTL-Brdge multiple times and I also checked my circuit. I tried to change the baud-rate and verified every change with the DevKit. From my understanding everything should work properly. But due to whatever reason I get the following erro code when trying to flahs:
esptool.py v3.3.2-dev
Serial port COM5
Connecting......................................
A fatal error occurred: Failed to connect to ESP32-C3: No serial data received.
For troubleshooting steps visit: https://docs.espressif.com/projects/esp ... oting.html
* Der Terminalprozess "C:\Users\patip\.espressif\python_env\idf4.4_py3.8_env\Scripts\python.exe 'C:\Users\patip\esp\esp-idf\components\esptool_py\esptool\esptool.py', '-p', 'COM5', '-b', '460800', '--before', 'default_reset', '--after', 'hard_reset', '--chip', 'esp32c3', 'write_flash', '--flash_mode', 'dio', '--flash_freq', '80m', '--flash_size', 'detect', '0x0', 'bootloader/bootloader.bin', '0x10000', 'gatt_server_service_table_demo.bin', '0x8000', 'partition_table/partition-table.bin'" wurde mit folgendem Exitcode beendet: 2.
My board design is as follows: As you can see the circuit is pretty simple. The power connection when flashing is done completely via the UART Debug connector and I am pulling GPIO9 LOW to enter Boot mode. I verified using a Multimeter and a Osciloscope that GPIO8 and GPIO2 are HIGH. I am unable to find the bug that is causing me such a headache.
I would be thankfull if someone can give me a hint where the issue is burried or can give the solution.
Thanks in advance.
I am fairly new to the ESP32 development and wanted to develope a simple bluetooth switch. E.g: A dedicated pin is switch high when a bluetooth signal is transmitted. Therefore I programmed the code and checked it with the ESP32-C3_DevKitM-1. Everything worked perfectly fine.
After confirming that everything is working as desired I designed and ordered a small PCB with the respective circuit. My idea was, to flash the ESP32-C3 via UART connection (Tx,Rx) using a USB to TTL Bridge. I verified that this way of flashing is wortking with the DevKit as well. When trying to flash the chip on my PCB via UART no serial communication can be established. I checked the USB-TTL-Brdge multiple times and I also checked my circuit. I tried to change the baud-rate and verified every change with the DevKit. From my understanding everything should work properly. But due to whatever reason I get the following erro code when trying to flahs:
esptool.py v3.3.2-dev
Serial port COM5
Connecting......................................
A fatal error occurred: Failed to connect to ESP32-C3: No serial data received.
For troubleshooting steps visit: https://docs.espressif.com/projects/esp ... oting.html
* Der Terminalprozess "C:\Users\patip\.espressif\python_env\idf4.4_py3.8_env\Scripts\python.exe 'C:\Users\patip\esp\esp-idf\components\esptool_py\esptool\esptool.py', '-p', 'COM5', '-b', '460800', '--before', 'default_reset', '--after', 'hard_reset', '--chip', 'esp32c3', 'write_flash', '--flash_mode', 'dio', '--flash_freq', '80m', '--flash_size', 'detect', '0x0', 'bootloader/bootloader.bin', '0x10000', 'gatt_server_service_table_demo.bin', '0x8000', 'partition_table/partition-table.bin'" wurde mit folgendem Exitcode beendet: 2.
My board design is as follows: As you can see the circuit is pretty simple. The power connection when flashing is done completely via the UART Debug connector and I am pulling GPIO9 LOW to enter Boot mode. I verified using a Multimeter and a Osciloscope that GPIO8 and GPIO2 are HIGH. I am unable to find the bug that is causing me such a headache.
I would be thankfull if someone can give me a hint where the issue is burried or can give the solution.
Thanks in advance.
-
- Posts: 9739
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32-C3-MINI-1 Flash via UART
Can you try to start a serial terminal program (115200, n81) on that USB-TTL converter and see if you can see the boot messages when the C3 powers on?
If not, can you scope the TX line of the C3, see if you see the message there?
What's your power supply like? If you try to feed the chip from the USB-TTL converter itself, be aware that those boards usually have a too small power supply to properly power the C3.
(Also note that the C3 does have an internal USB-serial-JTAG converter that you can use to program/debug it. Simply attach an USB cable to gnd/GPIO18/GPIO19, plug it in, and it should show up on your PC, and you should be able to program it using that. If you still can reach those pads on the mini module, that may be worth a try.)
If not, can you scope the TX line of the C3, see if you see the message there?
What's your power supply like? If you try to feed the chip from the USB-TTL converter itself, be aware that those boards usually have a too small power supply to properly power the C3.
(Also note that the C3 does have an internal USB-serial-JTAG converter that you can use to program/debug it. Simply attach an USB cable to gnd/GPIO18/GPIO19, plug it in, and it should show up on your PC, and you should be able to program it using that. If you still can reach those pads on the mini module, that may be worth a try.)
-
- Posts: 7
- Joined: Tue Nov 01, 2022 10:24 am
Re: ESP32-C3-MINI-1 Flash via UART
Thank you for your reply.
I checked the power consumption of the USB-TTL-Bridge when powering the ESP32-C3-DevKitM1 and roughly 72mA / 3,3V is provided to the DevKit. The DevKit is turning on and can be flashed. I also checked the Serial communication of the DevKit using Putty and everything works like a charm with the DevKit and the USB-TTL-Bridge.
After that I checked the power consumption of my circuit. At 3,3V my circuit only uses around 8mA of power. Somehow my circuit is not receiving enough power and is therefore not turning on, can't be flashed and does not show any serial communication in Putty.
I checked the circuit again and ensured that I have a smiliar circuit as used in the DevKit. The Schematic of the DevKit is referenced here: https://dl.espressif.com/dl/schematics/ ... 00915A.pdf
To design my circuit I used the Peripheral Schematic in the ESP32-C3-MINI-1 datasheet. I verified that I used the correct components (resistors and capacitors).
The issue seems to be coming from my circuit, whereas I still don't get it as I am using the same circuit as in the DevKit for UART, Power , CHIP_PO/EN and GPIO9.
Is there something I am missing?
Thanks in advance.
I checked the power consumption of the USB-TTL-Bridge when powering the ESP32-C3-DevKitM1 and roughly 72mA / 3,3V is provided to the DevKit. The DevKit is turning on and can be flashed. I also checked the Serial communication of the DevKit using Putty and everything works like a charm with the DevKit and the USB-TTL-Bridge.
After that I checked the power consumption of my circuit. At 3,3V my circuit only uses around 8mA of power. Somehow my circuit is not receiving enough power and is therefore not turning on, can't be flashed and does not show any serial communication in Putty.
I checked the circuit again and ensured that I have a smiliar circuit as used in the DevKit. The Schematic of the DevKit is referenced here: https://dl.espressif.com/dl/schematics/ ... 00915A.pdf
To design my circuit I used the Peripheral Schematic in the ESP32-C3-MINI-1 datasheet. I verified that I used the correct components (resistors and capacitors).
The issue seems to be coming from my circuit, whereas I still don't get it as I am using the same circuit as in the DevKit for UART, Power , CHIP_PO/EN and GPIO9.
Is there something I am missing?
Thanks in advance.
-
- Posts: 9739
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32-C3-MINI-1 Flash via UART
Well, if anything that TPS71433 can only output 80mA; I'm not sure if that is the cause of your issues in flashing but it will absolutely lead to issues later on. As the hardware design guidelines state, we recommend a power supply capable of providing at least 500mA@3.3V.
Additionally, not sure if you realized but as your circuit does not have an auto-download-mode type of circuit, you'll need to put the ESP32C3 into download mode manually: lower EN by jumpering J4, make GPIO9 low, remove the jumper.
(While I'm at it: it's unlikely that Q1 does what you intend it to do either.)
Additionally, not sure if you realized but as your circuit does not have an auto-download-mode type of circuit, you'll need to put the ESP32C3 into download mode manually: lower EN by jumpering J4, make GPIO9 low, remove the jumper.
(While I'm at it: it's unlikely that Q1 does what you intend it to do either.)
-
- Posts: 7
- Joined: Tue Nov 01, 2022 10:24 am
Re: ESP32-C3-MINI-1 Flash via UART
Thanks again for the response and the tipps.
To give an update I checked the following:
- I disconnected the LDO (U2 in schematic) and the Transistor (Q1) so that I only have the power circuit for the Esp32-C3
- I connected the circuit to a laboratory power supply so that the power supply is ensured to not be the root-cause
- I checked the soldering of the chip and build a special sample where I wired the respective connections to the correct pins to be absolutely sure that the soldering is robust and working. The reason for this is I have observed that the ESP32-C3 was pretty hard to solder as it did not wanted to accepted the solder. A colleague of mine said that this could be due wrong / bad storage of the chip.
Independent from my actions I am not ableto power the ESP32-C3 using my circuit as the chip is always using only ~ 8mA at 3,3V. Can it be that the chip has no default FW flashed on it and is therefore not booting? As I am pretty sure that I have checked everything in my schematic and can't find any root-cause.
Just to be sure: When powering the ESP32-C3 up I have the following pin configuration:
EN/CHIP_PO (Pin8) - HIGH
GPIO2 (Pin5) - HIGH
GPIO8 (Pin22) - HIGH
GPIO9 (Pin23) - checked with HIGH an LOW on Startup
Am I missing something to power up correctly? Are there any other ideas or things that I can try to solve my issue?
To give an update I checked the following:
- I disconnected the LDO (U2 in schematic) and the Transistor (Q1) so that I only have the power circuit for the Esp32-C3
- I connected the circuit to a laboratory power supply so that the power supply is ensured to not be the root-cause
- I checked the soldering of the chip and build a special sample where I wired the respective connections to the correct pins to be absolutely sure that the soldering is robust and working. The reason for this is I have observed that the ESP32-C3 was pretty hard to solder as it did not wanted to accepted the solder. A colleague of mine said that this could be due wrong / bad storage of the chip.
Independent from my actions I am not ableto power the ESP32-C3 using my circuit as the chip is always using only ~ 8mA at 3,3V. Can it be that the chip has no default FW flashed on it and is therefore not booting? As I am pretty sure that I have checked everything in my schematic and can't find any root-cause.
Just to be sure: When powering the ESP32-C3 up I have the following pin configuration:
EN/CHIP_PO (Pin8) - HIGH
GPIO2 (Pin5) - HIGH
GPIO8 (Pin22) - HIGH
GPIO9 (Pin23) - checked with HIGH an LOW on Startup
Am I missing something to power up correctly? Are there any other ideas or things that I can try to solve my issue?
-
- Posts: 9739
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32-C3-MINI-1 Flash via UART
The ESP32C3 modules indeed have no default firmware flashed to them: if you start them up without having programmed them first, the ROM goes into a boot loop attempting to boot from flash. You should still see that on the UART, though.
To debug this, I'll repeat the questions I asked earlier:
- Can you try to start a serial terminal program (115200, n81) on that USB-TTL converter and see if you can see the boot messages when the C3 powers on?
- If not, can you scope the U0TX line of the C3, see if you see the message there?
To debug this, I'll repeat the questions I asked earlier:
- Can you try to start a serial terminal program (115200, n81) on that USB-TTL converter and see if you can see the boot messages when the C3 powers on?
- If not, can you scope the U0TX line of the C3, see if you see the message there?
-
- Posts: 7
- Joined: Tue Nov 01, 2022 10:24 am
Re: ESP32-C3-MINI-1 Flash via UART
Hello again,
I checked using Putty the Serial communication. Most of the times when connecting the device to the USB-TTL Bridge I get nothing. Sometimes I get the following output:
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x1 (POWERON),boot:0xc (SPI_FAST_FLASH_BOOT)
invalid header: 0xffffffff
After that I will just get invalid header: 0xffffffff. But this situation is pretty hard to reproduce.
When trying to flash in this state I get the following error code: "A fatal error occurred: Failed to connect to ESP32-C3: Serial data stream stopped: Possible serial noise or corruption."
As it seems something has changed because last time I checked I was not able at all to get any message in the serial monitor.
To answer your questions directly:
- Can you try to start a serial terminal program (115200, n81) on that USB-TTL converter and see if you can see the boot messages when the C3 powers on?
---- I checked the boot in the serial terminal program. Rarely I get messages as shown above in Putty using (115200, n81). Most of the time nothing happens in the terminal.
- If not, can you scope the U0TX line of the C3, see if you see the message there?
---- I checked the U0TX lines in parallel and can confirm that most of the time there is no communication at all on the Tx line. When receiving the messages there is some message on Tx but as it seems it is not robust. When trying to flash I see some messages on the TX line but as the error message indicates the TX signal is not as expectedand therefore flashing is not possible. The TX signal is continously HIGH and during communication with the Terminal the TX is pulled Low to transmit the bytes as expected.
I hope I could answer the questions clearly. Is there anything else I can try?
Thank you very much.
I checked using Putty the Serial communication. Most of the times when connecting the device to the USB-TTL Bridge I get nothing. Sometimes I get the following output:
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x1 (POWERON),boot:0xc (SPI_FAST_FLASH_BOOT)
invalid header: 0xffffffff
After that I will just get invalid header: 0xffffffff. But this situation is pretty hard to reproduce.
When trying to flash in this state I get the following error code: "A fatal error occurred: Failed to connect to ESP32-C3: Serial data stream stopped: Possible serial noise or corruption."
As it seems something has changed because last time I checked I was not able at all to get any message in the serial monitor.
To answer your questions directly:
- Can you try to start a serial terminal program (115200, n81) on that USB-TTL converter and see if you can see the boot messages when the C3 powers on?
---- I checked the boot in the serial terminal program. Rarely I get messages as shown above in Putty using (115200, n81). Most of the time nothing happens in the terminal.
- If not, can you scope the U0TX line of the C3, see if you see the message there?
---- I checked the U0TX lines in parallel and can confirm that most of the time there is no communication at all on the Tx line. When receiving the messages there is some message on Tx but as it seems it is not robust. When trying to flash I see some messages on the TX line but as the error message indicates the TX signal is not as expectedand therefore flashing is not possible. The TX signal is continously HIGH and during communication with the Terminal the TX is pulled Low to transmit the bytes as expected.
I hope I could answer the questions clearly. Is there anything else I can try?
Thank you very much.
-
- Posts: 9739
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32-C3-MINI-1 Flash via UART
That looks like something is still super-unstable in your circuit... generally the chip is trying to do the right thing (hence esptool.py getting a bit further) but seems to fail. Is your power supply OK, and also is the stuff connected to the EN line working? Do you have multiple PCBs with this on it, and do they all show the same behaviour?
-
- Posts: 7
- Joined: Tue Nov 01, 2022 10:24 am
Re: ESP32-C3-MINI-1 Flash via UART
Hi,
I checked multiple PCBs with the same routing and all showed similar behavior. The Power supply is definitely stable because I can run the dev kit with the power supply without any issues. Therefore my guess would be that something is wrong with my circuit or the chip.
Might it be that this issue can be caused by "wrong" capacitors? I checked the circuit used in the dev-kit of the ESP32-C3-Mini-1 in the datashee again and compared to the capacitor I am using. Even if the capacitors have the same capacitance they differ in the Voltage rating. The designators below are with reference to my circuit, meaning that C2 is C2 in my circuit:
Designator | Value in DevKit | Value in my circuit
C2 | 10µF/25V(20%) | 10µF/6,3V (20%)
C3 & C6 | 0,1µF/50V(10%) | 0,1µF/50V(-20,+80%)
C4 |1µF/16V(10%) | 1µF/16V(10%)
Could this be the rootcause of the issue? If the issue can not be caused by these differences between the dev-kit and my circuit I am out of ideas.
Anyway I will redesign my circuit to use the ESP32-C3-WROOM-U2 as it is easier to solder by hand and can be used in my project as well. For powering I will copy the dev-kit schematic as good as possible to be sure that I am not causing any issues with my circuit design.
I would really appreciate your feedback about my question. Any tipps for my nexst circuit are very much welcome.
I checked multiple PCBs with the same routing and all showed similar behavior. The Power supply is definitely stable because I can run the dev kit with the power supply without any issues. Therefore my guess would be that something is wrong with my circuit or the chip.
Might it be that this issue can be caused by "wrong" capacitors? I checked the circuit used in the dev-kit of the ESP32-C3-Mini-1 in the datashee again and compared to the capacitor I am using. Even if the capacitors have the same capacitance they differ in the Voltage rating. The designators below are with reference to my circuit, meaning that C2 is C2 in my circuit:
Designator | Value in DevKit | Value in my circuit
C2 | 10µF/25V(20%) | 10µF/6,3V (20%)
C3 & C6 | 0,1µF/50V(10%) | 0,1µF/50V(-20,+80%)
C4 |1µF/16V(10%) | 1µF/16V(10%)
Could this be the rootcause of the issue? If the issue can not be caused by these differences between the dev-kit and my circuit I am out of ideas.
Anyway I will redesign my circuit to use the ESP32-C3-WROOM-U2 as it is easier to solder by hand and can be used in my project as well. For powering I will copy the dev-kit schematic as good as possible to be sure that I am not causing any issues with my circuit design.
I would really appreciate your feedback about my question. Any tipps for my nexst circuit are very much welcome.
-
- Posts: 9739
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32-C3-MINI-1 Flash via UART
Those caps should not be an issue; as long as they're rated for the voltage rails they're stabilizing it's no problem, and your capacitors are.
Who is online
Users browsing this forum: No registered users and 92 guests