Skip to content

Fix ESP32 RGB: Prevent I2S MCLK Defaulting to GPIO0 - #3552

Merged
mha1 merged 3 commits into
ExpressLRS:masterfrom
thegreenheaven:fix/esp32rgb-disable-mck-gpio0
Mar 3, 2026
Merged

mha1 merged 3 commits into
ExpressLRS:masterfrom
thegreenheaven:fix/esp32rgb-disable-mck-gpio0

Conversation

@thegreenheaven

Copy link
Copy Markdown
Contributor

Issue

On ESP32 targets, GPIO0 unexpectedly outputs a high-frequency clock signal when the RGB (I2S) driver is initialized.

Problem

In esp32rgb.cpp, the i2s_pin_config_t structure does not explicitly initialize mck_io_num.

Because the structure is zero-initialized, mck_io_num defaults to 0, 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.

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
thegreenheaven marked this pull request as ready for review February 23, 2026 12:05
@pkendall64

Copy link
Copy Markdown
Collaborator

Nice find. Thanks for this.

Comment thread src/lib/LED/esp32rgb.cpp Resolved
@mha1
mha1 merged commit cc502e0 into ExpressLRS:master Mar 3, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants