#34525·ardupilot

AP_Bootloader: stale MatekH743 binary associated with flash erasure on battery power-up

Author: NeoUKRCreated Sep 28, 2026Updated Sep 28, 2026

Bug Report

Issue details

The prebuilt MatekH743 bootloader currently shipped in Tools/bootloaders/MatekH743_bl.bin matches an older binary than the one shipped with Copter-4.6.3. On our board, replacing only the bootloader while retaining a working Copter-4.7.1 installation was followed by application flash erasure on the second battery power-on.

Reproduction and evidence

Application Bootloader identified by DFU readback Operator-observed result
Copter 4.6.3, 3fc7011a Matches Copter-4.6.3 repository binary 10/10 successful power-cycle tests
Copter 4.7.1, dbe79216 Retains the same 4.6.3 bootloader 10/10 successful tests
Same 4.7.1 installation, after bootloader replacement Matches Copter-4.7.1 repository binary Failed on second battery power-on

The operator reports that USB-only power-ons do not reproduce the failure; their count and detailed power wiring have not yet been recorded. This is one physical board, not a fleet-wide result.

The working 4.7.1 application readback matches all 1,549,916 bytes of both our APJ payload and HEX application payload. After bootloader replacement, its entire 128 KiB region matches the official repository binary (FF-padded). A complete 2 MiB DFU readback after failure shows:

  • Bootloader sector 0 unchanged from the verified replacement.
  • Entire application area 0x08020000..0x081BFFFF contains 0xFF. Sector 13 was already blank before failure.
  • Parameter sector 14 is now entirely 0xFF; 32,945 previously non-FF bytes disappeared.
  • Parameter sector 15 is unchanged, containing only 5 non-FF bytes.

No erase, download, unprotect, option-byte write or recovery command was used during acquisition. MCU identity was checked. Raw flash dumps are retained locally; only derived comparisons are published. Application was not reread between the bootloader-only update and the failed test, so that interval is an evidence limitation.

Binary provenance

Both readbacks exactly match the official repository bootloader binaries, padded with FF to 128 KiB:

  • Working: 19,764-byte binary from Copter-4.6.3, last changed by 6de03b6581a70db5a11f4d77a4a569917685a857 (2025-06-13), "rebuild bootloaders for boards with flash param storage", removing ECC checking. Region SHA256: 167111d2c515dfb69cc843fb2792560de2a7698b79754a3fb2d1b8d7b90ea66b.
  • Failing configuration: 39,900-byte binary from Copter-4.7.1, last changed by 4490e462e99b629ec4840a83ce8994b5a1c163fa (2025-04-22). Region SHA256: bce5bc7d7102a6699cfa6c8b33b50d35f33b97379a134eb1165b589072635282.
  • Current master still contains that April MatekH743 binary.

The April source checks both single- and double-bit ECC flags during startup and can erase application pages. This suggests a stale prebuilt artifact reintroduces destructive ECC handling. The triggering ECC registers and supply waveform were not captured, so the exact trigger and executed code path remain unproven. Potentially related to #30058 and #30031; this report specifically concerns the shipped MatekH743 binary and reproducible replacement comparison.

Expected: updating the bootloader does not reintroduce application erasure on power-up.

Version Copter 4.7.1 dbe79216, ChibiOS d103983f; control Copter 4.6.3 3fc7011a, ChibiOS 88b84600.

Platform

  • Copter

Airframe type Quad, QUAD/X_REV.

Hardware type MatekH743 target, APJ board ID 1013, STM32H743 device ID 0x0450, 2 MiB flash. Physical board described as H743 Slim; exact revision pending confirmation.

Logs Full pre/post-failure flash readbacks, sector hashes, and MAVLink snapshots are retained locally. Runtime log enumeration reported zero onboard logs. The relevant non-private byte-comparison findings and hashes are included above; full dumps are not published.

Report prepared with AI assistance; physical test outcomes are operator reports and binary comparisons were performed with read-only acquisition scripts. A narrowly scoped rebuild of the prebuilt MatekH743 bootloader against current source is being prepared in our fork; hardware testing of that new artifact is pending.