Store the ADV Controller image in LittleFS instead of embedding it in the ESP firmware
The ESP build embeds adv-controller.bin (about 50 KB) as a PROGMEM array via tools/adv-controller-image.py. The ESP uses it to check the HC32's build ID and update it over the link. That's convenient, but the image stays in the sketch for as long as that firmware is installed, even once the HC32 is up to date. On boards with no ADV Controller (a standard GBS-C) it is never used.
Program space is getting tight: about 93 % of the 1,044 KB sketch area on current builds. LittleFS has 1 MB (eagle.flash.4m1m.ld) and is mostly empty.
Proposal
- Allow building the ESP firmware without the embedded image.
advControllerImageSize() == 0already handles this. - Accept
adv-controller.binas a web upload, saved as e.g./adv-controller.binin LittleFS. - Run the existing checks on the file: ADVC header at 0x400, length, CRC32. Then compare its CRC with the HC32's build ID and offer the update exactly as now, reading the image from the file instead of PROGMEM.
- Delete the file once the HC32 reports the new build ID.
- Later: the OTA manifest could name the ADV image too (optional keys, which the v1 parser already ignores), so an internet update can fetch it into LittleFS and users still see a single update.
Benefits
- About 50 KB of program space back for features.
- No wasted space on standard boards.
- ESP and ADV releases no longer have to ship together.
Trade-off: until the OTA manifest carries the ADV image, an ADV update is a separate upload. That's why embedding would stay the default for now.
I'm working on a PR for the first part (LittleFS image source, upload, delete after the update, embedding as a build option that stays on by default).