ESP32-C6, ESP32-S3, etc.: MICROPY_HW_ENABLE_UART_REPL should be disabled for boards that have both direct USB and UART connectors
Description
On many ESP32 boards, there are two USB connectors: one connected directly to the MCU and the other connected via a USB/UART bridge chip.
The default ESP32 build for these boards puts the REPL on both ports, making it impossible to use the USB/UART connector as an independent UART for other purposes.
See discussion at #17633 .
Code Size
No response
Implementation
I hope the MicroPython maintainers or community will implement this feature
Code of Conduct
Yes, I agree
ports/esp32: Support JTAG console, free up UART.
CONFIG_USB_OTG_SUPPORTED is automatically set by the ESP-IDF when the chip supports USB-OTG, which is the case for the ESP32-S2 and ESP32-S3.
When trying to use the JTAG console with these chips, it would not work because our USB implementation will take over control over the USB port, breaking the JTAG console in the process.
Thus, when the board is configured to use the JTAG console, we should not enable our USB console support.
Additionally, this change also frees up UART0 when an USB-based console is configured, since there's no reason to prevent (re)configuration of UART0 for other uses in that case.