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.

Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
This commit is contained in:
Daniël van de Giessen
2023-06-29 14:55:34 +02:00
committed by Damien George
parent ba8aad3d1d
commit f8bd6778c8
6 changed files with 26 additions and 13 deletions

View File

@@ -89,10 +89,10 @@ void mp_task(void *pvParameter) {
#if MICROPY_PY_THREAD
mp_thread_init(pxTaskGetStackStart(NULL), MP_TASK_STACK_SIZE / sizeof(uintptr_t));
#endif
#if CONFIG_USB_OTG_SUPPORTED
usb_init();
#elif CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG
#if CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG
usb_serial_jtag_init();
#elif CONFIG_USB_OTG_SUPPORTED
usb_init();
#endif
#if MICROPY_HW_ENABLE_UART_REPL
uart_stdout_init();