Problem getting console log esp32-s3 #12031
-
I had problems getting console log with USB-CDC board. ESP default console is UART0. During system development being able to see console log is important to say the least. I manage to force ESP to write log to UART1. A needed part of sdkconfig.board where console was defined as follows:
After the firmware was built and flashed, we need to create uart object corresponding to the console defined in sdkconfig.board.
Now take a jumper wire and short (connect) GPIO1 and GPIO3. Since the firmware was built with CONFIG_LOG_DEFAULT_LEVEL_DEBUG, debug messages will be written to the console, take for example the network module.
It is clear that we can see something of what was going on, which is what we want. Increasing the txbuf and rxbuf will store more debugging messages. This trick works for both MP w/IDF4x and MP w/IDF5x. Working with ESP32-S3 without a debug log is a pain. CONFIG_ESP_CONSOLE_USB_CDC does not work. If anyone knows an easy way, please let me know. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Here is a simple class we can use with the setup.
Example of how to use.
|
Beta Was this translation helpful? Give feedback.
-
I found an easier way. You need to call init the tusb console in
You'll have to |
Beta Was this translation helpful? Give feedback.
-
Thanks @shlomozippel this: $ diff usb.c usb.c-ORIG
30d29
< #include "tusb_console.h"
90d88
< ESP_ERROR_CHECK(esp_tusb_init_console(CDC_ITF)); // to get debuging info has done the job nicely and easily. You should tell the core team about your findings, others may be interested. |
Beta Was this translation helpful? Give feedback.
I found an easier way. You need to call init the tusb console in
ports/esp32/usb.c
:You'll have to
#include "tusb_console.h"
for that to work