Page 1 of 1

ESP32-C3 Log output only on USB

Posted: Tue Aug 09, 2022 11:47 pm
by ashesman
Hi,

First project on an ESP32-C3. I am using the onboard USB-CDC port for log output and the onboard JTAG for debug. In this application (custom hardware), GPIO 20 and 21 are connected to a host MCU as UART. I do not want any debug output at all on UART0 as it ends up at the host processor and messes things up!

Using Visual Studio Code with Espressif plugin, I set the 'Channel for console output' to 'USB Serial/JTAG Controller', and 'Channel for console secondary output' to 'No secondary console'. This works to disable console output on UART0 from a certain point. Up to that point, I get the same debug output on UART0 and USB. The last thing I see on UART0 is a 'spi_flash: ...' output.

I tried setting the logging level for the bootloader to None which removed boot loader debug from both outputs. Ideally I would like to see that on USB only so dont want to completely disable it, just disable it on UART 0.

I see that the first stage ROM loader output requires EFUSE programming to disable its output so I understand I can probably not disable that from UART 0.

It is too late now to change to alternate GPIOs and use UART1 for the host MCU...

How do I make it so that all debug output remains enabled, but only goes to USB and not to UART0 ???

Re: ESP32-C3 Log output only on USB

Posted: Thu Aug 11, 2022 6:47 am
by chegewara
Screenshot from 2022-08-11 08-46-47.png
Screenshot from 2022-08-11 08-46-47.png (117.58 KiB) Viewed 2611 times

Re: ESP32-C3 Log output only on USB

Posted: Sun Aug 14, 2022 10:32 pm
by ashesman
Bump... Anyone have any ideas on ensuring debug output is entirely only on USB?

Re: ESP32-C3 Log output only on USB

Posted: Mon Aug 15, 2022 1:45 am
by ESP_Sprite
I don't think it's possible, sorry... you either get ROM chatter on both USB and UART, or (if you disable it via efuse) you don't get it at all. If your hardware depends on it, I'd simply disable it in efuse, honestly.