Implement conditional ARDUINO_USB_MODE: dev=1, release=0 to fix boot hanging #263
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.
ESP32-C3, ESP32-S2, and ESP32-S3 devices were configured with
ARDUINO_USB_MODE=1
which causes them to wait for a USB debugger connection and never boot WLED without a USB data connection. This prevented end users from powering their devices from regular power supplies or wall adapters.Problem
When
ARDUINO_USB_MODE=1
is set, these ESP32 variants:However, developers need
ARDUINO_USB_MODE=1
for USB debugging capabilities during development.Solution
Implemented a conditional approach using a PlatformIO script (
pio-scripts/conditional_usb_mode.py
) that automatically detects the build context:Development Builds (Default)
WLED_RELEASE
environment variable is not setCI/Release Builds
WLED_RELEASE
environment variable is set toTrue
(as done in GitHub Actions CI)The script runs as a pre-build step and modifies the build flags dynamically based on the environment context.
Impact
This conditional approach ensures that CI-built binaries are suitable for end users while preserving full developer functionality for debugging workflows.
Fixes #255.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.