ESP32-C3 Log output only on USB

ashesman
Posts: 20
Joined: Sun Jun 02, 2019 9:25 pm

ESP32-C3 Log output only on USB

Postby ashesman » Tue Aug 09, 2022 11:47 pm

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 ???

chegewara
Posts: 2174
Joined: Wed Jun 14, 2017 9:00 pm

Re: ESP32-C3 Log output only on USB

Postby chegewara » Thu Aug 11, 2022 6:47 am

Screenshot from 2022-08-11 08-46-47.png
Screenshot from 2022-08-11 08-46-47.png (117.58 KiB) Viewed 2079 times

ashesman
Posts: 20
Joined: Sun Jun 02, 2019 9:25 pm

Re: ESP32-C3 Log output only on USB

Postby ashesman » Sun Aug 14, 2022 10:32 pm

Bump... Anyone have any ideas on ensuring debug output is entirely only on USB?

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

Re: ESP32-C3 Log output only on USB

Postby ESP_Sprite » Mon Aug 15, 2022 1:45 am

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.

Who is online

Users browsing this forum: sangk82 and 73 guests