ESP32-S3 USB serial controller as first class interface?
Posted: Mon Feb 07, 2022 4:19 am
I would very much like to see the USB/JTAG controller serial interface be a full replacement for a UART interface, allowing me to remove the CP2102 from my design and simplifying the BOM.
When I try to use this interface the way that I use the UART interface, it seems like the USB serial is a secondary target (not fully functional or tested). This work is done with the espresso ESP32-S3-DevKit and using esp-idf v5.0-dev-1452-g93106c9348 (reported by git described). I'm using a Mac running macOS 12.2.
Using the getting-started/hello_world example, everything works just fine using both devices (USB serial controller = /dev/tty.usbmodem21401, UART = /dev/tty.SLAB_USBtoUART)
Using the system/console/basic example, when building for target esp32s3, but with no other changes to the sdkconfig file, I get the following when using "idf.py monitor -p /dev/tty.usbmodem21401":
and the device does not accept input. The similar command using the UART device (in the same window) works just fine and I get console interaction as I have become accustomed to when using the UART.
Additionally, when compiling the same example on Raspberry Pi 4 (aarch64, Debian bullseye), the console app when run through the USB/JTAG controller (/dev/ttyACM0) get this far:
and hangs with no further output and no response to keyboard input. Ctrl-] doesn't exit, and only killing the idk_monitor.py script gets me back to the shell. Using the UART device (/dev/ttyUSB0) works as expected.
And then back on the Mac when I configure the build with ESP_CONSOLE_USB_SERIAL_JTAG=y, the build (again, of the system/console/basic example) fails with:
On a lark, I tried compiling examples/system/console/basic using USB CDC (ESP_CONSOLE_USB_CDC=y), which fails to compile:
Are these issues that are expected to be resolved before the chip goes into full production?
When I try to use this interface the way that I use the UART interface, it seems like the USB serial is a secondary target (not fully functional or tested). This work is done with the espresso ESP32-S3-DevKit and using esp-idf v5.0-dev-1452-g93106c9348 (reported by git described). I'm using a Mac running macOS 12.2.
Using the getting-started/hello_world example, everything works just fine using both devices (USB serial controller = /dev/tty.usbmodem21401, UART = /dev/tty.SLAB_USBtoUART)
Using the system/console/basic example, when building for target esp32s3, but with no other changes to the sdkconfig file, I get the following when using "idf.py monitor -p /dev/tty.usbmodem21401":
Code: Select all
....
I (325) example: Command history enabled
Type 'help' to get the list of commands.
Use UP/DOWN arrows to navigate through command history.
Press TAB when typing command name to auto-complete.
Your terminal application does not support escape sequences.
Line editing and history features are disabled.
On Windows, try using Putty instead.
Done
Additionally, when compiling the same example on Raspberry Pi 4 (aarch64, Debian bullseye), the console app when run through the USB/JTAG controller (/dev/ttyACM0) get this far:
Code: Select all
...
I (273) sleep: Enable automatic switching of GPIO sleep configuration
I (280) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (326) example: Command history enabled
Type 'help' to get the list of commands.
Use UP/DOWN arrows to navigate through command history.
And then back on the Mac when I configure the build with ESP_CONSOLE_USB_SERIAL_JTAG=y, the build (again, of the system/console/basic example) fails with:
Code: Select all
/Users/zoo/esp32/esp-idf-latest-20220204/examples/system/console/basic/main/console_example_main.c: In function 'app_main':
/Users/zoo/esp32/esp-idf-latest-20220204/components/console/esp_console.h:91:18: error: 'CONFIG_ESP_CONSOLE_UART_BAUDRATE' undeclared (first use in this function); did you mean 'CONFIG_ESP_CONSOLE_UART_NUM'?
.baud_rate = CONFIG_ESP_CONSOLE_UART_BAUDRATE, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/zoo/esp32/esp-idf-latest-20220204/examples/system/console/basic/main/console_example_main.c:69:49: note: in expansion of macro 'ESP_CONSOLE_DEV_UART_CONFIG_DEFAULT'
esp_console_dev_uart_config_t uart_config = ESP_CONSOLE_DEV_UART_CONFIG_DEFAULT();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/zoo/esp32/esp-idf-latest-20220204/components/console/esp_console.h:91:18: note: each undeclared identifier is reported only once for each function it appears in
.baud_rate = CONFIG_ESP_CONSOLE_UART_BAUDRATE, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/zoo/esp32/esp-idf-latest-20220204/examples/system/console/basic/main/console_example_main.c:69:49: note: in expansion of macro 'ESP_CONSOLE_DEV_UART_CONFIG_DEFAULT'
esp_console_dev_uart_config_t uart_config = ESP_CONSOLE_DEV_UART_CONFIG_DEFAULT();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Code: Select all
/Users/zoo/esp32/esp-idf-latest-20220204/components/esp_system/port/soc/esp32s3/usb_console.c:77:1: error: static assertion failed: "usb_osglue_*_int is not multicore capable"
_Static_assert(SOC_CPU_CORES_NUM == 1, "usb_osglue_*_int is not multicore capable");
^~~~~~~~~~~~~~