esp32S3 The USB function is occupied by USB jtag/serial (VID_303A&PID_1001)
Port, board and/or hardware
esp32S3
MicroPython version
MicroPython v1.24.1
Reproduction
No, I've provided everything above.
Expected behaviour
Like 1.19, there is no need to plug or unplug the USB cable, and USB related functions can be used normally
Observed behaviour
on win10
After connecting the USB cable and booting up, the pc system will generate a USB jtag port. After entering micropython, all USBs do not work (such as my microPython USB CDC repl), and the USB jtag port will continue to exist (not work,VID_303A&PID_1001). Only by plugging and unplugging the USB cable once can the relevant USB functions work properly
V1.19 does not have this issue (but on 1.19, IDF's bootloder performs some pin detection to enter different OTA apps. detection stays for >200ms, the same issue will also occur)
Additional Information
No, I've provided everything above.
Code of Conduct
Yes, I agree
esp32s3 USB JTAG Serial interface should be enabled to access the mpy terminal
Problem Description
I want to use the built-in USB serial functionality comes with the ESP32-S3 SoC in addition to the UART interface (not simultaneously). However, I found that the firmwares (both v1.18 (2022-01-17) .bin and v1.18-473-g7883ae413 (2022-05-19) .bin do not support the serial over USB JTAG Serial interface. The sympton was that the device got reset as soon as I opened the USB serial port.
I compile my own firmware using the master branch
(7883ae413ddfa6181d784533b236658658383d0c) with
make -C mpy-cross
make -C ports/esp32 SER_C_MODULES=../../../examples/usercmodule/micropython.cmake FROZEN_MANIFEST=$(pwd)/ports/esp32/boards/manifest_test.py BOARD=GENERIC_S3_SPIRAM
make -C ports/esp32 submodules BOARD=GENERIC_S3_SPIRAM
make -C ports/esp32 BOARD=GENERIC_S3_SPIRAM
and flashed the firmware with
python -m esptool --chip esp32s3 -b 460800 --before default_reset --after no_reset --chip esp32s3 write_flash 0x0 bui
ld-GENERIC_S3_SPIRAM/bootloader/bootloader.bin 0x8000 build-GENERIC_S3_SPIRAM/partition_table/partition-table.bin 0x10000 build-GENERIC_S3_SPIRAM/micropython.bin
The USB serial no longer reset the board. However, the USB Serial terminal has no feedback: I can see from the UART terminal that the input was accepted (e.g., more >>> after hit the enter key) but nothing showed up in the USB Terminal.
Solution
I have added one line to micropython/ports/esp32/boards/GENERIC_S3_SPIRAM/sdkconfig.board file:
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
And the USB terminal works just fine. It is shared by the UART one but both side will see the same feedback consistently.
In addition, I have tried to comment out the line inmicropython/ports/esp32/boards/GENERIC_S3_SPIRAM/mpconfigboard.cmake:
set(IDF_TARGET esp32s3)
set(SDKCONFIG_DEFAULTS
boards/sdkconfig.base
# boards/sdkconfig.usb
boards/sdkconfig.spiram_sx
boards/GENERIC_S3_SPIRAM/sdkconfig.board
)
And the USB terminal still works.
Below is the screen record of how two terminals are working simultaneously. The left panel (COM4) is CH340 USB Serial bridge and the right one (COM5) uses the internal USB JTAG Serial.

Recommendations
Add CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y to the esp32s3 boards so that the USB serial will be enabled.
Possible related issues
#8524