mirror of
https://github.com/agessaman/MeshCore.git
synced 2026-07-20 17:51:07 +00:00
tools/append_provision.py appends [magic MCPV1\0][uint16-LE len][payload] [uint32-LE CRC32] to a built app .bin (replacing any existing trailer); esptool flashes the whole file so the trailer lands in the app partition right after the image. At boot, if neither /provision nor /provision_done exists, the firmware walks the running image's segment table to find the image end, validates magic + CRC + the provision header, and writes the payload to /provision — the existing auto-apply then runs it. 'provision' status reports trailer presence. Consequences documented in PROVISIONING.md: 'provision remove' (or erase) + reboot re-provisions from the trailer, and the trailer does not survive an OTA to the other slot. nRF52/RP2040 are explicitly unsupported (signed DFU / no UF2 side channel). CRC32 is a local zlib-compatible implementation so the firmware doesn't depend on which ROM CRC variant a given Arduino core exposes. The image- end walk was verified byte-exact against real esptool output for both Heltec_v3 build flavors.