fix(fw): 4.3C IO expander bootloop — use direct register protocol#3
Merged
Conversation
The board's IO expander (schematic U10) is a custom MCU expander, NOT a real
CH422G: it has SWDIO/PWM/ADC pins and speaks a register-pointer protocol at
I2C 0x24 (reg 0x02 = direction mask, reg 0x03 = output latch). The vendored
Espressif esp_io_expander_ch422g driver uses the real-CH422G multi-address
protocol (0x23/0x38/...) which NACKs on this board -> esp_io_expander_new_i2c
aborts in board_display_init -> boot loop, screen never comes up.
Fix: talk to the expander directly with two I2C register writes (matches
Waveshare's reference io_extension, verified on hardware). Remove the vendored
esp_io_expander*.{c,h} + stub header. Silence the legacy-i2c deprecation notice.
Verified on hardware: boots past IO expander, RGB+LVGL init, TinyUSB composite
enumerates as 'TokenPulse' (CDC /dev/cu.usbmodemTP_00011 + HID), no more abort.
…ffer The static dashboard only produced dirty regions for the first frame, so with avoid_tearing's two RGB framebuffers only one ever got painted; the panel flashed white whenever it swapped to the never-drawn second framebuffer. Set full_refresh so every frame repaints the whole screen -> both framebuffers always hold the complete image. Compile-verified.
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.
Symptom
Flashed 4.3C firmware boot-loops; screen never lights up. Serial log:
Root cause
The board's IO expander (schematic U10) is not a real CH422G — it's a custom MCU-based expander (it exposes SWDIO/PWM/ADC pins, which a CH422G lacks). It speaks a simple register-pointer protocol at I2C 0x24 (reg
0x02= direction mask, reg0x03= output latch). The vendored Espressifesp_io_expander_ch422gdriver uses the real-CH422G multi-address protocol (writes to 0x23/0x38/…), which NACKs here →esp_io_expander_new_i2c_ch422gaborts inboard_display_init→ boot loop.(The Task-2 review recommended keeping the vendored driver over a hand-rolled one; on real hardware that was the wrong call — the vendored driver doesn't match this board's expander.)
Fix
Talk to the expander directly with two I2C register writes (matches Waveshare's reference
io_extension, which the knowledge base documents as working on this exact board). Remove the vendoredesp_io_expander*.{c,h}+ stub header. Also silence the intentional legacy-i2c deprecation notice.Verified on hardware
Boots past the IO expander → RGB + LVGL init → TinyUSB composite enumerates as
TokenPulse/Espressifwith CDC/dev/cu.usbmodemTP_00011+ HID. No more abort. (Visual render + end-to-end data push still to be eyeballed.)