ESP32C6: USB not in board.json `features` but GPIO pins are disabled anyway
Description
IMHO the default value for MICROPY_HW_ESP_USB_SERIAL_JTAG should be "is the USB feature turned on in the board.json file".
An even better default might be "micropython checks the EFuse flags and enables the pins iff these flags are set".
The relevant efuse bits are DIS_PAD_JTAG and DIS_USB_JTAG, see tech manual 9.2.4 "JTAG Signal Source Control" page 378/379.
Code Size
No response
Implementation
I would like to sponsor development of 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.