Skip to content

feat: support USB_SERIAL_JTAG primary console for REPL#211

Open
laurigates wants to merge 2 commits into
ricardoquesada:developfrom
laurigates:feat/usb-serial-jtag-repl
Open

feat: support USB_SERIAL_JTAG primary console for REPL#211
laurigates wants to merge 2 commits into
ricardoquesada:developfrom
laurigates:feat/usb-serial-jtag-repl

Conversation

@laurigates
Copy link
Copy Markdown

Summary

Adds first-class support for CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y as the primary console for the Bluepad32 REPL. When that path is active, uni_console_init() uses esp_console_new_repl_usb_serial_jtag() with esp_console_dev_usb_serial_jtag_config_t; the existing UART REPL path is preserved under #if CONFIG_ESP_CONSOLE_UART.

Motivating use case: ESP32-S3 / ESP32-C3 / ESP32-C6 boards whose only exposed serial interface is native USB (e.g. Waveshare ESP32-S3-Zero) can now use BLUEPAD32_USB_CONSOLE_ENABLE=y without an external UART bridge.

Related to #209 (the compile failure reported there is fixed by #210; this PR adds the feature that makes USB_SERIAL_JTAG a supported primary console rather than just a non-selectable one).

Depends on

Not in this PR

  • USB_CDC primary console — ESP-IDF does not expose a matching esp_console_new_repl_* helper; still unsupported.
  • BTstack submodule btstack_stdio_esp32.c:150 CONFIG_ESP_CONSOLE_UART_BAUDRATE reference — separate upstream issue.

Test plan

  • CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y primary on ESP32-S3: idf.py -C src build succeeds; REPL accepts commands over USB-JTAG; list_devices, help, and at least one Bluepad32 command round-trip.
  • CONFIG_ESP_CONSOLE_UART_DEFAULT=y primary (existing default): no regression on ESP32 and ESP32-S3.
  • CONFIG_ESP_CONSOLE_UART_DEFAULT=y + CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y: UART REPL continues to work; USB-JTAG acts as secondary log channel.
  • CONFIG_ESP_CONSOLE_NONE=y: BLUEPAD32_USB_CONSOLE_ENABLE is unselectable (unchanged behavior).
  • Existing src/sdkconfig.ci.plat_* CI configs continue to pass.

BLUEPAD32_USB_CONSOLE_ENABLE previously depended only on
!ESP_CONSOLE_NONE, so it stayed selectable when USB_SERIAL_JTAG or
USB_CDC was the primary console. uni_console_init() uses the UART-only
REPL APIs (esp_console_dev_uart_config_t,
ESP_CONSOLE_DEV_UART_CONFIG_DEFAULT, esp_console_new_repl_uart), which
ESP-IDF only declares when ESP_CONSOLE_UART is set. Tighten the
dependency to match and document the supported console configurations.

Fixes ricardoquesada#209
Allow BLUEPAD32_USB_CONSOLE_ENABLE to be selected when
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y is the primary console. When that
path is active, use ESP-IDF's esp_console_new_repl_usb_serial_jtag()
with esp_console_dev_usb_serial_jtag_config_t instead of the UART REPL
helpers. Fall back to an #error if neither UART nor USB_SERIAL_JTAG is
the primary console, which together with the Kconfig dependency makes
the incompatibility clear at configuration time rather than link time.

USB_CDC primary console remains unsupported because ESP-IDF does not
expose a matching esp_console_new_repl_* helper.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant