Skip to content

fix: revert console to UART primary so device boots on USB-only power - #176

Open
joaosouz4dev wants to merge 1 commit into
memovai:mainfrom
joaosouz4dev:fix/console-uart-primary
Open

fix: revert console to UART primary so device boots on USB-only power#176
joaosouz4dev wants to merge 1 commit into
memovai:mainfrom
joaosouz4dev:fix/console-uart-primary

Conversation

@joaosouz4dev

@joaosouz4dev joaosouz4dev commented May 21, 2026

Copy link
Copy Markdown

Summary

Commit 2b68d56 (feat: include spiffs.bin in release and switch console to USB-JTAG) switched the primary console to CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y. In practice this regresses standalone (host-less) operation on ESP32-S3:

  • When the board is powered from a USB charger or power bank with no host PC attached, the early ESP_LOGI calls in app_main block on the USB CDC TX queue and boot never progresses past the banner.
  • The 50 ms TX timeout that motivated the switch is not enough to cover all standalone-power scenarios; users report the device "only works while plugged into a computer".
  • README.md line 215 still documents the previous configuration (CONFIG_ESP_CONSOLE_UART_DEFAULT=y), so the sdkconfig and the docs are currently out of sync.

This PR restores the configuration that was in place before 2b68d56 (matching commit 10c9a5e and the workflow described in the README):

-CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
+CONFIG_ESP_CONSOLE_UART_DEFAULT=y
+CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y

UART as primary is non-blocking when nothing is connected. The secondary USB-Serial/JTAG keeps flash, debug, and log output working through the USB port, so the idf.py -p <usb-jtag-port> flash monitor workflow is unaffected. The unrelated spiffs.bin-in-release change from 2b68d56 is left intact.

Test plan

  • Build with the patched sdkconfig: idf.py fullclean && idf.py build
  • Flash via the USB-JTAG port: idf.py -p <PORT> flash monitor — logs still appear via USB
  • Disconnect from the host PC and power the board from a USB charger or power bank
  • Confirm the device joins WiFi and the Telegram bot starts responding (verify via router DHCP table or by messaging the bot)
  • REPL still works on the UART port as documented in README.md "USB (JTAG) vs UART" section

Summary by CodeRabbit

  • Chores
    • Updated console and serial configuration to use UART as the primary console with USB Serial/JTAG maintained as secondary for flash, debug, and log operations.

Review Change Stack

Commit 2b68d56 switched the primary console to USB Serial/JTAG. When the
board is powered from a USB charger or power bank with no host PC attached,
early ESP_LOGI calls in app_main block on the USB CDC TX queue and boot
never progresses past the banner. The 50 ms TX timeout that motivated the
switch is not enough to cover all standalone-power scenarios.

Restore the prior configuration (matching commit 10c9a5e and the workflow
documented in README.md line 215):

  CONFIG_ESP_CONSOLE_UART_DEFAULT=y
  CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y

UART is non-blocking when nothing is listening, and the secondary
USB-JTAG keeps flash + debug + log output working through the USB port.
@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 61ed68d8-e132-4a19-8336-65d5336034f6

📥 Commits

Reviewing files that changed from the base of the PR and between bb10ea0 and 3a2e3dc.

📒 Files selected for processing (1)
  • sdkconfig.defaults.esp32s3

📝 Walkthrough

Walkthrough

The sdkconfig.defaults.esp32s3 configuration is updated to switch the ESP32-S3 console from USB Serial/JTAG primary to UART primary (non-blocking), while keeping USB Serial/JTAG as the secondary console for debug, flash, and log output.

Changes

Console I/O Configuration

Layer / File(s) Summary
UART Primary Console and USB Secondary Configuration
sdkconfig.defaults.esp32s3
Console I/O routing is switched to use UART as the primary non-blocking console; USB Serial/JTAG is configured as the secondary console for debug, flash, and log output.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • memovai/mimiclaw#152: Both PRs modify sdkconfig.defaults.esp32s3 console configuration, switching the primary console between UART and USB Serial/JTAG.
  • memovai/mimiclaw#61: Both PRs configure UART-first console routing in sdkconfig.defaults.esp32s3, keeping USB Serial/JTAG as secondary.

Suggested labels

ready to merge

Suggested reviewers

  • crispyberry

Poem

🐰 The console now speaks through UART's voice,
USB steps back—a thoughtful choice!
Logs flow free, unblocked and true,
Debug and flash still have their due! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: reverting the console configuration from USB Serial/JTAG to UART primary to fix boot failures on USB-only power.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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