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
Follow-up from #98 (multi-firmware support). The firmware-flash core works — the chunked storage_write transfers data correctly (md5 verified on-device for files up to 1.58 MB) — but the full end-to-end official↔Momentum flash does not yet complete reliably over USB. This issue tracks the robustness hardening needed to make a complete flash reliable, plus the on-device end-to-end validation.
No firmware update was ever executed during validation; every attempt aborted safely before the reboot-into-updater step.
Findings from hardware validation (Momentum mntm-012, USB)
Fixed in Multi-firmware support + firmware-flash tooling #98 — storage_write timeout floor was 3 s, which failed a 117 KB write whose data had actually transferred (md5 matched). Now flush-aware (max(15, len/40000)).
storage_md5sum returns None immediately after a large write. The device is still flushing to SD; the verify reads None and the installer treats it as a mismatch and aborts. The same 1.58 MB file md5-matched once the device had settled. Evidence:
768 KB write → md5 matched.
1.0 MB and 1.58 MB writes → write_ok=True but immediate storage_md5sum returned None; a later read of the same file returned the correct hash.
RPC session can wedge after aggressive back-to-back large writes — start_rpc_session negotiation fails, get_device_info returns empty, SD reads unavailable. Recovered only by a physical power-cycle. Suggests the post-write/inter-command sequence needs settle/drain and possibly host-side pacing.
Proposed work
In the installer's per-file verify, add a short settle delay + bounded storage_md5sum retry (treat None as "not ready, retry" rather than "mismatch"). Distinguish a real digest mismatch from an unreadable digest.
Investigate host-side pacing / inter-chunk drain in (or around) storage_write for multi-MB files to avoid the session wedge; consider a brief settle between files in install_bundle.
Consider a session-health check / re-sync (drain + re-start_rpc_session) between large operations, and surface a clear recovery message (power-cycle / DFU) if the session wedges mid-flash.
On-device end-to-end validation: real flipperzero_firmware_install official→capture official golden fixtures→back to Momentum (Task 12/13 from the plan), then the integration+usb flash round-trip test.
Reorganize golden fixtures to tests/golden/fixtures/{momentum,official}/ and parametrize the golden suite (depends on the official capture above).
Clean up leftover /ext/update/diag and /ext/update/mcp-update folders left on the test device's SD card.
Notes
The per-file md5 verify means a failed/corrupted push aborts before any reboot, so this is a reliability problem, not a bricking risk.
Diagnosis scripts used during validation were ad-hoc (/tmp), not committed.
Context
Follow-up from #98 (multi-firmware support). The firmware-flash core works — the chunked
storage_writetransfers data correctly (md5 verified on-device for files up to 1.58 MB) — but the full end-to-end official↔Momentum flash does not yet complete reliably over USB. This issue tracks the robustness hardening needed to make a complete flash reliable, plus the on-device end-to-end validation.No firmware update was ever executed during validation; every attempt aborted safely before the reboot-into-updater step.
Findings from hardware validation (Momentum mntm-012, USB)
storage_writetimeout floor was 3 s, which failed a 117 KB write whose data had actually transferred (md5 matched). Now flush-aware (max(15, len/40000)).storage_md5sumreturnsNoneimmediately after a large write. The device is still flushing to SD; the verify readsNoneand the installer treats it as a mismatch and aborts. The same 1.58 MB file md5-matched once the device had settled. Evidence:write_ok=Truebut immediatestorage_md5sumreturnedNone; a later read of the same file returned the correct hash.start_rpc_sessionnegotiation fails,get_device_inforeturns empty, SD reads unavailable. Recovered only by a physical power-cycle. Suggests the post-write/inter-command sequence needs settle/drain and possibly host-side pacing.Proposed work
storage_md5sumretry (treatNoneas "not ready, retry" rather than "mismatch"). Distinguish a real digest mismatch from an unreadable digest.storage_writefor multi-MB files to avoid the session wedge; consider a brief settle between files ininstall_bundle.start_rpc_session) between large operations, and surface a clear recovery message (power-cycle / DFU) if the session wedges mid-flash.flipperzero_firmware_installofficial→capture official golden fixtures→back to Momentum (Task 12/13 from the plan), then theintegration+usbflash round-trip test.tests/golden/fixtures/{momentum,official}/and parametrize the golden suite (depends on the official capture above)./ext/update/diagand/ext/update/mcp-updatefolders left on the test device's SD card.Notes
/tmp), not committed.