Repository navigation
Fix ESP32 RGB: Prevent I2S MCLK Defaulting to GPIO0 - #3552
Merged
mha1 merged 3 commits intoMar 3, 2026
Merged
Conversation
i2s_pin_config_t omitted mck_io_num, which zero-initializes to 0 (GPIO0). This unintentionally enables I2S MCLK on GPIO0 on ESP32 devices. Explicitly set mck_io_num to I2S_PIN_NO_CHANGE to prevent routing clock to GPIO0.
thegreenheaven
marked this pull request as ready for review
February 23, 2026 12:05
Collaborator
|
Nice find. Thanks for this. |
pkendall64
approved these changes
Feb 23, 2026
mha1
approved these changes
Mar 3, 2026
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.
Issue
On ESP32 targets, GPIO0 unexpectedly outputs a high-frequency clock signal when the RGB (I2S) driver is initialized.
Problem
In
esp32rgb.cpp, thei2s_pin_config_tstructure does not explicitly initializemck_io_num.Because the structure is zero-initialized,
mck_io_numdefaults to0, which corresponds to GPIO0 on ESP32.As a result, the I2S driver unintentionally routes the MCLK signal to GPIO0.
GPIO0 is a strapping/boot pin on ESP32 devices. Driving a high-frequency clock on this pin can interfere with normal boot behavior and cause instability during flashing or startup.
Solution
Explicitly set:
.mck_io_num = I2S_PIN_NO_CHANGE,This prevents MCLK from being routed to GPIO0 and removes reliance on implicit zero-initialization.