feat: support USB_SERIAL_JTAG primary console for REPL#211
Open
laurigates wants to merge 2 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds first-class support for
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=yas the primary console for the Bluepad32 REPL. When that path is active,uni_console_init()usesesp_console_new_repl_usb_serial_jtag()withesp_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=ywithout 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
depends on ESP_CONSOLE_UART→depends on ESP_CONSOLE_UART || ESP_CONSOLE_USB_SERIAL_JTAG). Until fix: restrict BLUEPAD32_USB_CONSOLE_ENABLE to UART primary console #210 merges, this PR's diff will show two commits.Not in this PR
esp_console_new_repl_*helper; still unsupported.btstack_stdio_esp32.c:150CONFIG_ESP_CONSOLE_UART_BAUDRATEreference — separate upstream issue.Test plan
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=yprimary on ESP32-S3:idf.py -C src buildsucceeds; REPL accepts commands over USB-JTAG;list_devices,help, and at least one Bluepad32 command round-trip.CONFIG_ESP_CONSOLE_UART_DEFAULT=yprimary (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_ENABLEis unselectable (unchanged behavior).src/sdkconfig.ci.plat_*CI configs continue to pass.