ESP32-C3 does not start with USB Serial console output enabled

ysba90
Posts: 4
Joined: Wed Nov 03, 2021 2:54 pm

ESP32-C3 does not start with USB Serial console output enabled

Postby ysba90 » Wed Nov 03, 2021 3:08 pm

Hello,

I'm working in an application in which I'd like to keep UART0 free to communicate with another device, so I don't want to print console output in this port.

Also, I'd like to have console output for debuging purposes in USB Serial/JTAG Controller. However, when I enable the option "Channel for console output" in menuconfig, the device seems to be stalled until I open the virtual serial port. When the port is opened, the device runs normally and prints to the USB virtual serial console.

This problem only occurs when setting "USB Serial/JTAG Controller" in "Channel for console output". Setting any other option, no problem occurs ("Default: UART0", "Custom UART" or "None").

In the USB Serial/JTAG Controller Console documentation page, at the "Limitations" section (https://docs.espressif.com/projects/esp ... light=jtag), it says something that ESP32-C3 chip would stall if it receives bytes that are not read. But it do not mention what would happen if the application is trying to write console output to USB port when there is no other device attached to it.

Is this a normal behavior, or I may be missing something?

As a workaroud, I redirected my debuging console output to a Custom UART because I have some spare gpios. However I'd like to understand why USB issue ie happening.

Thank you.

Yuri

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

Re: ESP32-C3 does not start with USB Serial console output enabled

Postby ESP_Sprite » Thu Nov 04, 2021 7:46 am

It's a known bug in esp-idf; we merged a fix for it to our internal master branch two days ago and as soon as it passes the CI, it'll be in master. If you can't wait, I think this patch, albeit somewhat hacky, fixes the issue.

ysba90
Posts: 4
Joined: Wed Nov 03, 2021 2:54 pm

Re: ESP32-C3 does not start with USB Serial console output enabled

Postby ysba90 » Thu Nov 04, 2021 12:47 pm

Hello, I'm glad this issue is being addressed. Fortunately I can wait. I'll keep up with master branch to test this fix as soon as it's available. Thank you very much.

rainman
Posts: 9
Joined: Mon Nov 16, 2015 10:50 pm

Re: ESP32-C3 does not start with USB Serial console output enabled

Postby rainman » Fri Nov 05, 2021 5:01 pm

You made my day Jero :)
I've spent half of the day in hardware checks of our circuit trying to understand why the code was not working when connected via the onboard battery. Everything was looking good from the power point of view, in fact, the only difference was that the internal USB serial was not connected. (Yeah, I know, I didn't think to switch to the uart serial).

Will wait for the fix release and use the linked patch in the meantime.

Cheers and have a nice week end

ysba90
Posts: 4
Joined: Wed Nov 03, 2021 2:54 pm

Re: ESP32-C3 does not start with USB Serial console output enabled

Postby ysba90 » Fri Nov 05, 2021 8:55 pm

Just for the record, I've applied the suggested diff patch and it worked. Thank you.

Who is online

Users browsing this forum: No registered users and 65 guests