fix: restrict BLUEPAD32_USB_CONSOLE_ENABLE to UART primary console#210
Open
laurigates wants to merge 1 commit into
Open
fix: restrict BLUEPAD32_USB_CONSOLE_ENABLE to UART primary console#210laurigates wants to merge 1 commit into
laurigates wants to merge 1 commit into
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
5 tasks
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
BLUEPAD32_USB_CONSOLE_ENABLEcurrently depends only on!ESP_CONSOLE_NONE, so it stays selectable whenESP_CONSOLE_USB_SERIAL_JTAG=yorESP_CONSOLE_USB_CDC=yis the primary console. In that configuration,uni_console_init()(and itsregister_bluepad32()helper) fails to compile because it uses UART-only REPL APIs that ESP-IDF only declares whenESP_CONSOLE_UARTis set:esp_console_dev_uart_config_t/ESP_CONSOLE_DEV_UART_CONFIG_DEFAULT()— guarded by#if CONFIG_ESP_CONSOLE_UART_DEFAULT || CONFIG_ESP_CONSOLE_UART_CUSTOMincomponents/console/esp_console.h.esp_console_new_repl_uart()— same gating.Tighten the Kconfig dependency to
ESP_CONSOLE_UARTso the option cannot be selected in an incompatible configuration, and document the supported primary consoles in the help text.A working setup remains: UART primary + USB_SERIAL_JTAG as secondary console (
CONFIG_ESP_CONSOLE_UART_DEFAULT=y,CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y).Fixes #209.
Note: this PR is deliberately Kconfig-only. Adding first-class USB_SERIAL_JTAG REPL support (via
esp_console_new_repl_usb_serial_jtag()) will be a separate PR since it needs validation on actual JTAG hardware and relaxes the dependency this PR tightens.BTstack's
btstack_stdio_esp32.c:150reference toCONFIG_ESP_CONSOLE_UART_BAUDRATEis a separate upstream issue in the BTstack submodule and not addressed here.Test plan
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=yprimary:BLUEPAD32_USB_CONSOLE_ENABLEis no longer selectable inidf.py menuconfig, andidf.py -C src buildsucceeds onesp32s3.CONFIG_ESP_CONSOLE_UART_DEFAULT=yprimary:BLUEPAD32_USB_CONSOLE_ENABLE=ycontinues to build and the REPL works onesp32andesp32s3.CONFIG_ESP_CONSOLE_UART_DEFAULT=y+CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y: builds and REPL works on both channels.src/sdkconfig.ci.plat_*CI configs continue to pass.