Not able to program ESP32-C3-MINI-1-N4

EmilEmilchen
Posts: 8
Joined: Sun Feb 25, 2024 7:21 pm

Not able to program ESP32-C3-MINI-1-N4

Postby EmilEmilchen » Sun Feb 25, 2024 7:49 pm

I recently built my own dev board with some extra functionality utilizing the ESP32-C3-MINI-1-N4. However the device shows up in the Windows Device Manager but I'am unable to flash anything or connect to it.
Windows Device Manager:
Image
When I use esptool.py to try and flash anything I get the following error message which I'am already used to from driver issues with the CH430 UART Bridge Chip in D1 mini esp8266 dev boards:
Image
(The error message is in german, translation: A device attached to the system is not functioning properly)
I read somewhere that the ESP32-C3 chips didn't come "with any firmware". I don't know if I have to program the chip using UART to work with USB? I - in my infinite wisdom - forgot to expose the RX and TX pins though... I also forgot to expose GPIO9 to enter boot mode but here: https://docs.espressif.com/projects/esp ... nsole.html under "USB Pin Reconfiguration" it says that "...the device disappears from the system. After fixing the issue in the application, you need to manually put the ESP32-C3 into download mode by pulling low GPIO9 and resetting the chip." but my device didn't "disappear from the system. I could desolder the device and manually attach wires to the pins to try and reprogram it this way but I would like to know if this is even going to help or not.
I also tried installing the driver like suggested in this thread: viewtopic.php?t=22908. Didnt have any effect either.

I would appreciate any help! Thanks in advance!

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

Re: Not able to program ESP32-C3-MINI-1-N4

Postby ESP_Sprite » Mon Feb 26, 2024 3:01 am

Without firmware, the ESP32-C3 will reboot every few seconds, which makes the USB device disappear and reappear. (This is behaviour that can clear a possible fault with flash communication on bootup.) Normally, you'd use GPIO9 to put the thing into download mode, which stops that behaviour. If GPIO9 is unavailable, one way is to simply retry flashing a bunch of times, hoping esptool can connect during the time frame the device is available: as soon as it does, it'll also stop the rebooting.

EmilEmilchen
Posts: 8
Joined: Sun Feb 25, 2024 7:21 pm

Re: Not able to program ESP32-C3-MINI-1-N4

Postby EmilEmilchen » Mon Feb 26, 2024 12:46 pm

Thank you for the reply but unfortunately this didnt work. I tried spamming the command and even wrote a script and let it run for a few minutes. Didn't help. Also the device doesn't disappear or anything. It's just there all the time and doesn't work. Really confusing to me. I also tried on Linux. Slightly different error message but the same deal.
On another windows device it didn't work either.

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

Re: Not able to program ESP32-C3-MINI-1-N4

Postby ESP_Sprite » Tue Feb 27, 2024 2:15 am

That is odd. If you're willing to try again under Linux: can you double-check if the device disconnects and reconnects by running 'sudo dmesg' in a terminal and copy-pasting the last screenful or two here?

EmilEmilchen
Posts: 8
Joined: Sun Feb 25, 2024 7:21 pm

Re: Not able to program ESP32-C3-MINI-1-N4

Postby EmilEmilchen » Tue Feb 27, 2024 5:54 am

Sure.
Heres the snippet in text form:

Code: Select all

[   65.870701] ucsi_acpi USBC000:00: GET_CONNECTOR_STATUS failed (-110)
[   66.162728] usb 3-3: new full-speed USB device number 5 using xhci_hcd
[   66.312719] usb 3-3: New USB device found, idVendor=303a, idProduct=1001, bcdDevice= 1.01
[   66.312735] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   66.312740] usb 3-3: Product: USB JTAG/serial debug unit
[   66.312744] usb 3-3: Manufacturer: Espressif
[   66.312747] usb 3-3: SerialNumber: DC:DA:0C:D7:D5:EC
[   66.336046] cdc_acm 3-3:1.0: ttyACM0: USB ACM device
[   66.336067] usbcore: registered new interface driver cdc_acm
[   66.336069] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[   72.008656] ucsi_acpi USBC000:00: GET_CONNECTOR_STATUS failed (-110)
[  153.511781] usb 3-3: USB disconnect, device number 5
[  162.340021] usb 3-1: new full-speed USB device number 6 using xhci_hcd
[  162.536407] usb 3-1: Device not responding to setup address.
[  162.744496] usb 3-1: Device not responding to setup address.
[  162.952281] usb 3-1: device not accepting address 6, error -71
[  163.356509] usb 3-1: new full-speed USB device number 7 using xhci_hcd
[  163.552560] usb 3-1: device descriptor read/64, error -71
[  163.856862] usb 3-1: device descriptor read/64, error -71
[  163.964944] usb usb3-port1: attempt power cycle
[  164.445076] usb 3-1: new full-speed USB device number 8 using xhci_hcd
[  164.445379] usb 3-1: Device not responding to setup address.
[  164.653354] usb 3-1: Device not responding to setup address.
[  164.861151] usb 3-1: device not accepting address 8, error -71
[  165.057374] usb 3-1: new full-speed USB device number 9 using xhci_hcd
[  165.057688] usb 3-1: Device not responding to setup address.
[  165.265626] usb 3-1: Device not responding to setup address.
[  165.473550] usb 3-1: device not accepting address 9, error -71
[  165.473727] usb usb3-port1: unable to enumerate USB device
[  171.000452] usb usb2-port1: attempt power cycle
[  179.499889] usb usb2-port1: unable to enumerate USB device
[  207.063225] usb 3-2: new full-speed USB device number 10 using xhci_hcd
[  207.212841] usb 3-2: New USB device found, idVendor=303a, idProduct=1001, bcdDevice= 1.01
[  207.212854] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  207.212859] usb 3-2: Product: USB JTAG/serial debug unit
[  207.212863] usb 3-2: Manufacturer: Espressif
[  207.212865] usb 3-2: SerialNumber: DC:DA:0C:D7:D5:EC
[  207.216927] cdc_acm 3-2:1.0: ttyACM0: USB ACM device
And heres a screenshot:
Image
Weirdly I get error messages (as shown above) when connecting to any but one of my USB Ports (usb 3-2 works). But seeing as it does work and even gets the Manufacturer and SerialNumber on this port I think this only has to do with OS. I'm not 100% sure though.

Heres the Linux esptool error message:

Code: Select all

emil@kubuntu-leptop:~$ esptool -p /dev/ttyACM0 flash_id
esptool.py v4.6.2
Serial port /dev/ttyACM0
Connecting...
Traceback (most recent call last):
  File "/usr/bin/esptool", line 37, in <module>
    esptool._main()
  File "/usr/lib/python3/dist-packages/esptool/__init__.py", line 1073, in _main
    main()
  File "/usr/lib/python3/dist-packages/esptool/__init__.py", line 678, in main
    esp = esp or get_default_connected_device(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/esptool/__init__.py", line 956, in get_default_connected_device
    _esp = detect_chip(
           ^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/esptool/cmds.py", line 94, in detect_chip
    detect_port.connect(connect_mode, connect_attempts, detecting=True)
  File "/usr/lib/python3/dist-packages/esptool/loader.py", line 647, in connect
    last_error = self._connect_attempt(reset_strategy, mode)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/esptool/loader.py", line 532, in _connect_attempt
    reset_strategy()  # Reset the chip to bootloader (download mode)
    ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/esptool/reset.py", line 100, in __call__
    self._setRTS(False)
  File "/usr/lib/python3/dist-packages/esptool/reset.py", line 40, in _setRTS
    self.port.setRTS(state)
  File "/home/emil/.local/lib/python3.11/site-packages/serial/serialutil.py", line 600, in setRTS
    self.rts = value
    ^^^^^^^^
  File "/home/emil/.local/lib/python3.11/site-packages/serial/serialutil.py", line 463, in rts
    self._update_rts_state()
  File "/home/emil/.local/lib/python3.11/site-packages/serial/serialposix.py", line 708, in _update_rts_state
    fcntl.ioctl(self.fd, TIOCMBIC, TIOCM_RTS_str)
OSError: [Errno 71] Protocol error
And as a picture:
Image

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

Re: Not able to program ESP32-C3-MINI-1-N4

Postby ESP_Sprite » Tue Feb 27, 2024 9:13 am

Thanks. That is odd and kind-of feels like a hardware error. Can you share your schematics and/or pcb design?

EmilEmilchen
Posts: 8
Joined: Sun Feb 25, 2024 7:21 pm

Re: Not able to program ESP32-C3-MINI-1-N4

Postby EmilEmilchen » Tue Feb 27, 2024 1:22 pm

Sure, heres a picture of the schematic:
Image
and the PCB design:
Image
I'll also attach a PDF with the schematic and PCB design and a zip fie with the entire KiCad project but I used quiet a few components from custom libraries which might not be included.
But essentialy the usb connector is just directly connected to the IO19 and 18 pins with 2 1uF Caps in between (I even left these out in the assembly though, I also didn't put the R10 resistor (10k) just to be sure that there wouldn't be any weird interference there).
(I think) I also encountered the same weird behavior when using another ESP32-C3-MINI-1-N4 and just handsolering some wires to it. I'am not 100% sure about this one though as I shorted something and killed the board in the process. I am going to try again with a third module (and handsoldered wires) and another (3rd) different windows mashine. I'll repeat all the steps mentioned above with the new configuration as well.

Edit: I also left the MPU-6050 out as I was worried about some of the solder pads getting shorted because they are so much smaller then the ESPs (I used slightly crappy solder paste). I also checked all connections exposed through pins (see the bottom of the schematic) for shorts and connectivity between e.g. the usb port and the pins, and the pads for the ESP
Attachments
KiCadPorject.zip
(5.83 MiB) Downloaded 158 times
PCB.pdf
(309.4 KiB) Downloaded 166 times
schematic.pdf
(330.92 KiB) Downloaded 199 times

EmilEmilchen
Posts: 8
Joined: Sun Feb 25, 2024 7:21 pm

Re: Not able to program ESP32-C3-MINI-1-N4

Postby EmilEmilchen » Tue Feb 27, 2024 2:03 pm

The Board draws around 70 mA@3V3. I tried using a macbook (not on the desoldered module though):

Code: Select all

MacBook-Air:~ emil$ python3 -m esptool -p /dev/tty.usbmodem1411 flash_id
esptool.py v4.7.0
Serial port /dev/tty.usbmodem1411
Connecting......................................

A fatal error occurred: Failed to connect to Espressif device: No serial data received.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
MacBook-Air:~ emil$ python3 -m esptool -p /dev/tty.usbmodem1411 flash_id
esptool.py v4.7.0
Serial port /dev/tty.usbmodem1411
Connecting......................................

A fatal error occurred: Failed to connect to Espressif device: No serial data received.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
MacBook-Air:~ emil$ python3 -m esptool -p /dev/tty.usbmodem1411 flash_id
esptool.py v4.7.0
Serial port /dev/tty.usbmodem1411
Connecting......................................

A fatal error occurred: Failed to connect to Espressif device: No serial data received.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
MacBook-Air:~ emil$ python3 -m esptool -p /dev/tty.usbmodem1411 flash_id
esptool.py v4.7.0
Serial port /dev/tty.usbmodem1411
Connecting......................................

A fatal error occurred: Failed to connect to Espressif device: No serial data received.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
MacBook-Air:~ emil$ python3 -m esptool -p /dev/tty.usbmodem1411 flash_id
esptool.py v4.7.0
Serial port /dev/tty.usbmodem1411
Connecting......................................

A fatal error occurred: Failed to connect to Espressif device: No serial data received.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
MacBook-Air:~ emil$ python3 -m esptool -p /dev/tty.usbmodem1411 flash_id
esptool.py v4.7.0
Serial port /dev/tty.usbmodem1411
Connecting......................................

A fatal error occurred: Failed to connect to Espressif device: No serial data received.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
MacBook-Air:~ emil$ 

It tries to connect a little longer but always fails after the same amount of time. I tried spamming it here as well, but it didn't disconnect at all either.
Another weird thing I noticed is, that on a 3rd windows/Linux mashine the device wouldnt get recognized in any of the USB ports but one as well. Just like shown in the snippet from the dmesg command. On the MacBook it worked with every port.

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

Re: Not able to program ESP32-C3-MINI-1-N4

Postby ESP_Sprite » Wed Feb 28, 2024 2:00 am

C1 and C5 will absolutely destroy your USB signal; good choice to not populate them.
What use are all the Schottkys from your POWER net down to the various components? Assuming your LDO is 3.3V, the voltage drop over those might be enough to make things malfunction. If not now, you'll get into trouble with them later: the ones that are in your project can handle 100mA at max, and an ESP32 will spike at much more during e.g. WiFi calibration. As a test, I'd suggest at least replacing D5 with a short, see if that improves things.

(Also, I'm not sure what you want to do with a PCB that has both an accelerometer, a battery and a HV transformer on them, but please be very careful with whatever you're planning with that if it involves any living human or animal...)

EmilEmilchen
Posts: 8
Joined: Sun Feb 25, 2024 7:21 pm

Re: Not able to program ESP32-C3-MINI-1-N4

Postby EmilEmilchen » Wed Feb 28, 2024 6:25 am

The 2 Capacitors have the values I thought I had read somewhere (I seem to have been wrong)... Thank you for the information though! I can assure you, that I'm not planning to to any harm to anyone or thing. The Transformer and IMU are for different projects. That's why the transformer part can be broken off (in theory).
About the diodes: I figured that without any diodes before the capacitors the Ground and Power NET would be directly connected by all capacitors which in my mind wouldn't be good. Anyway, I think the Voltage Drop Would be fine but the 100mA not, you're right. I seem to have missed this important detail in the datasheet. Desoldered and shorted D5 though and this didn't have any appearance effect. Still recognized, doesn't keep disconnecting but also doesn't work.

Who is online

Users browsing this forum: No registered users and 94 guests