You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fbuild-deploy: pre-deploy artifact size validation against board flash region #690
fbuild deploy currently does not validate the firmware artifact's size against the target board's flash region before invoking the deployer. esptool does this on its side for ESP, so the gap is invisible there. For LPC8xx (64 KB flash on LPC845, 32 KB on LPC804), Teensy, STM32, and RP2040 the silent path is "build a too-large binary → pyocd flash succeeds at writing the bytes that fit → device boots into garbage." This is a class of "the device looks dead" bug that the FastLED #3300 / #3325 / #3339 LPC bring-up incident sat next to but never tripped (firmware was 53.85 KB / 64 KB, well under the ceiling).
Now that we're up against the LPC845 ceiling (84% flash used per #3339's verification table), every future PR can push it over. Worth catching at fbuild time, not flash time.
Proposed shape
Pre-deploy check inside whatever orchestrator runs the deploy. Board JSON already carries upload.maximum_size (and ESP-side variants); fbuild reads it. The check is one line + one error:
Warn at >90% of maximum_size so the user sees the ceiling approaching before it bites.
Per-region check for boards with split flash regions (LPC845 has CRP region carved out by the linker; RP2040 has XIP boot region). Read the linker map (firmware.elf.map) or the board JSON region table, whichever fbuild already parses.
Acceptance criteria
Pre-deploy size check lives in fbuild-deploy's top-level orchestrator, runs before every deploy backend is invoked.
Error type carries actual, max, board so a bash autoresearch <board> failure shows the user exactly what overflowed.
Boards without a maximum_size (esp32 catch-all) skip the check with a debug log.
Activity
ci(hooks): forbidden_commands.py — block pyocd/esptool/dfu-util/picot…
feat(deploy): pre-deploy artifact size validation (#690) (#707)