Boost_Gauge¶
STI boost / flex-fuel gauge: STM32G491 + Waveshare 1.47" 172x320 LCD (JD9853 over SPI1, AXS5106L touch on I2C 0x63).
Repo: ~/engineering/repos/Boost_Gauge (remote EmbeddedEra/Boost_Gauge). Firmware in Firmware/Gauge_Boost_001/.
Open¶
- Push
feat/boot-screen(local commit 1fa043e on top of the remote d8e5a50, not pushed) and open the PR once the panel check below is done. - On the bench: flash 1fa043e, time one
BootScreen_Draw()with the DWT cycle counter (enabled inApp_Init) at a sweep-phase step and a static step, and eyeball the 4-step background fade on the panel. The 8-12 fps figure for the old code is an estimate, never measured. - If the sweep phase (8-29k px per frame) still stutters on the device: SPI DMA with double-buffered rows (fix 3 in the 2026-10-19 review). Not started.
-
BRINGUP_TODO.mditem "Change full-screen updates to dirty rectangles only" still open for the gauge screens (boot band is done).
Decisions¶
- The display is written incrementally: only pixels that change are sent. The boot band (rows 8..213) uses per-element dirty spans against the previous frame's parameters; static frames send 0 px. 2026-10-19.
bgfadeis quantised to 4 steps (<1 LSB per step) so the background is not repainted every frame. 2026-10-19.
Gotchas¶
- SPI1 is 20 MHz, 8-bit, blocking
HAL_SPI_Transmit, no DMA, so pixel count is the cost. Panel X offset is 34. RGB565, no framebuffer. - Head glow radius 34 changes at the 1-LSB level, so shrinking its region would break the bit-exact equivalence below.
Verification¶
Tools/boot_host_test/dirty_check.sh(setCC=if no C compiler; zig works:exec uvx --from ziglang python -m ziglang cc "$@") hashes the framebuffer after every frame against a forced-full-band reference. Bit-identical for step sizes 16, 33, 50, 100, 250, 600 ms and random; a negative control fails as it should.
Log¶
- 2026-10-19: reviewed Angel's push (d8e5a50) for frame issues. Host test showed 88% of boot-band pixels rewritten unchanged (890,802 written vs 105,671 changed at 100 ms steps). Implemented fixes 1 and 2 (skip static frames, per-element dirty regions): 217,689 written vs 100,459 changed, first frame 0 px, frames at t>=2300 ms 0 px. Committed locally as 1fa043e.
Handoff (2026-10-19)¶
- Files:
Core/Src/boot_screen.c(BandParams/BandCtx, dirty_* helpers,draw_animated_band),Tools/boot_host_test/dirty_check.{c,sh},Tools/boot_host_test/README.md. - Checks passed: host equivalence on 7 step patterns with negative control. Not done: any on-device run.
- Next action: bench timing + panel look, then push and PR.