ESP32-C3 Log output only on USB
Posted: 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 ???
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 ???