Repository navigation
Patch 0018: a fresh ESP-IDF clone builds the S3 again; lock at the KeDei merges - #35
Merged
Merged
Conversation
…xist (a fresh ESP-IDF v5.5.4 clone broke every S3 build with cameraif or displayif); modules.lock: displayif and pydevices at the KeDei merges
bdbarnett
added a commit
that referenced
this pull request
Oct 19, 2026
…35) picodvi was the one framebuffer backend here with no fill_rect, so on an RP2040 or RP2350 with a DVI output every displaydev.FBDisplay.fill_rect fell off the end of the dispatch ladder onto per-row memoryview assigns from Python. On the ESP32-P4, where the same fallback was measured on hardware, a 400x240 fill costs 2.46 s that way against 3.5 ms through the native fill -- a factor of 698 (#28). Nobody has measured it on an rp2, but the ladder is the same one, and an app that clears a region reads as a hung program rather than a slow one. It was left out of #33 for a real reason: unlike the other five backends this one is not fixed at 16bpp. color_depth is 1, 2, 4, 8, 16 or 32 and defaults to 8, across two different SoC backends, so it cannot use the shared displayif_fb_fill_rect16 and the sub-byte depths need partial-byte masking at the left and right edges that none of the others has to think about. So the masking goes in the shared header as displayif_fb_fill_rect_packed, beside the 16bpp fill, and picodvi is a thin caller of it -- bounds through the same displayif_fb_rect_ok, so it refuses exactly the rectangles the other five refuse. Which end of a byte is the LEFT pixel is not a choice and the header says where it is read from: the RP2350 HSTX command expander pops pixels by shifting the word RIGHT, so the first pixel on the wire is the low bits. Getting that backwards does not crash and does not look like a fill_rect defect -- a fill comes out mirrored within each byte, which at 1bpp is a four-pixel stagger along an edge. It is written down once so the board bring-up has something to check rather than something to discover. The deinit guard is not decoration either: picodvi_rp2350_deinit() m_free()s the framebuffer and sets it NULL, so a fill after deinit would write through freed memory. RuntimeError and the wording match rgbmatrix's guard beside it. Proven two ways, neither of them a DVI monitor. tests/test_fb_fill_packed.c runs the packed fill against a naive per-pixel reference over 4908 rectangles across all six depths, walking every start and width the byte boundaries can produce rather than sampling a few, with canary bytes either side because writing outside the rectangle is this code's first failure mode. Three planted faults: MSB-first packing (1615 failures), a whole-byte write that spills past the right edge (1605), and OR instead of replace (3 -- caught only by the fill-with-zero case, which is why that case is there). And mod_picodvi.c compiles for rp2350 with the real ARM toolchain, no warnings. THE BOARD PROOF IS OWED: no rp2 board is here, nothing was flashed, and the pixel order above has not been seen on a screen.
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.
The second cloud run of
scripts/exercise_build.sh(2026-10-06) built every target in one go, ESP-IDF fetched bybuild_mp.pyincluded, except the ESP32-S3. It failed at configure:Include directory '.../esp_hw_support/mspi_timing_tuning/port/esp32s3/include' is not a directory.The cause. ESP-IDF v5.5.4's S3 port declares that
includedirectory but tracks no files in it, so a fresh clone never creates it. ESP-IDF itself tolerates that. MicroPython's esp32 port doesn't.usermod.cmakegathers include directories transitively from every library a user C module links, and cameraif and displayif link ESP-IDF driver components that pull inesp_hw_support.idf_component_register()then refuses the missing directory. The ESP-IDF in the workspace had once been at an older tag and still had the empty directory, which hid it. With that removed, so the checkout matches a clean v5.5.4, the failure reproduced here in 28 seconds.The fix. Overlay patch 0018 drops non-existent directories (generator expressions are kept) from
MICROPY_INC_USERMODbeforeidf_component_register(). It's in the series' usual form, with a justification header and its checksum inprovenance.json.apply_patches.py --check: the series applies clean to v1.29.0. With it, the S3 LCD-7--modules allbuild passes against the clean ESP-IDF (9 m 0 s, autosize included). It's an upstream MicroPython bug too, and the draft for upstream is a separate issue.modules.lockmoves displayif to PyDevices/displayif#48 (mipidsinon_burst/continuous_clock) and pydevices to PyDevices/pydevices#123 (the DEV-KIT + KeDei board config), both proven on Brad's bench today.