Skip to content

programming + reset issue with CDC/USB-JTAG on ESP32C3 #7190

Closed
@0x0fe

Description

@0x0fe

Board

ESP32C3 custom board

Device Description

Custom ESP32C3 board ;
The ESP32C3 is only connected to USB-C port, two 74HCT245D buffers (inputs only) and a tact switch (details below).
This ESP32C3 design block, which follows the hardware design guide, has already been used in several boards and products without issue, there is however always differences between the designs on the pullup/pulldowns presents on the various GPIOs, nontheless all designs have pullup on 2 and 8 boot strap pins, this one is no exception.

Hardware Configuration

PIN MAP:

  • 2, 3, 4, 5, 6, 7, 8, 10, 20, 21 to 74HCT245 inputs
  • 9 to tact switch (no external pullup)
  • 10K pullups on 2, 8 and 20
  • RC reset on EN (10K pullup + 1uF to GND)

High quality 3.3V LDO with very low drop at max load and high PSRR.
Sufficient decoupling all over (100nF 50V X7R class),
Sufficient storage capacitors on the 3.3V rail with large derating (2*22uF 16V).
Ferrite bead on 5V rail plus 3.3V rail filtering as per hardware design reference.

Version

v2.0.4

IDE Name

Arduino

Operating System

windows 10

Flash frequency

80M

PSRAM enabled

no

Upload speed

921600 (not relevant for CDC)

Description

  • when plugged to USB, the board runs normally and the USB port is recognized normally
  • when trying to program, the CDC does not manage to reset the board in programming mode, i get the follwing error
Connecting......................................
A fatal error occurred: Failed to connect to ESP32-C3: Wrong boot mode detected (0xc)! The chip needs to be in download mode.

The only way to program is to unplug, hold the tact switch (gpio9) plug USB and release tact to force PROG mode
the programming then executes normally, however it does not manage to reset and run afterwards, a manual power cycle has to be executed.

Is there another bootstrap pin causing the issue? (other than 2 and 8 which are already pulled high)
is it something with the RC reset?
It is unclear to me how only the CDC reset fails but when i cold boot (aka plug USB) the board starts in the correct RUN mode, and when i use GPIO9 it starts in the correct PROG mode.

Note :

  • the board does resets briefly a few time during programming attemps, so the CDC tries to reset, but fails to set the PROG mode.
  • the issue is not related to the firmware itself, as the error can be reproduced with a test firmware doing nothing else than running printf + delay in the main loop.

Sketch

void setup() {
  Serial.begin(115200);
  while(!Serial) delay(1);
  printf("init\n");
}
void loop() {
  printf("test\n"); 
  delay(500);
}


### Debug Message

```plain
Connecting......................................
A fatal error occurred: Failed to connect to ESP32-C3: Wrong boot mode detected (0xc)! The chip needs to be in download mode.


### Other Steps to Reproduce

HW setup with two buffer and pullups as described will reproduce the issue

### I have checked existing issues, online documentation and the Troubleshooting Guide

- [X] I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions