Offer the OTAFIX bootloader factory-erase file for nRF52 - #431
Draft
jamesarich wants to merge 1 commit into
Draft
jamesarich wants to merge 1 commit into
jamesarich wants to merge 1 commit into
Conversation
…tion
public/uf2/meshtastic_factory_erase.uf2 is a single 512-byte UF2 block with
family ID 0x4D455348 ("MESH") and an all-zero payload, copied from
Adafruit_nRF52_Bootloader_OTAFIX tools/meshtastic_factory_erase.uf2 at
c8ccd1d (PR meshtastic#41, MIT). No OTAFIX release contains it yet; swap the copy for
a release asset once one exists. sha256
6ef3146505c40079ee9e7e692448e40a793dad636f55d1545063299d28908f0d.
A bootloader that recognises the family erases its own App Data reservation
(LittleFS config, keys, bonds, node DB) and keeps the installed firmware, so
one file fits every nRF52 board and no SoftDevice 6.1.1/7.3.0 choice is
needed. The old serial-monitor step goes away with it: there is no sketch
waiting on CDC, the port is the bootloader's own.
Attestation instead of detection: the bootloader advertises support with a
"Factory-Erase:" line in INFO_UF2.TXT, but the flasher has no way to read the
DFU drive (no File System Access API here), and an older bootloader ignores
the file silently, leaving the user thinking the erase happened. So the file
is served only when the user ticks a checkbox saying the line is there;
unticked, today's SoftDevice-specific path is unchanged. The checkbox resets
on target change.
Open product question: whether to ship this before an OTAFIX release
carrying the feature is widespread. Until then nearly every device will lack
the line and the checkbox is a promise almost nobody can keep.
|
@jamesarich is attempting to deploy a commit to the Meshtastic Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
public/uf2/meshtastic_factory_erase.uf2(512 bytes, one UF2 block, family0x4D455348, from meshtastic/Adafruit_nRF52_Bootloader_OTAFIX#41 atc8ccd1d7, MIT) and a checkbox in the nRF52 erase dialog: "My bootloader's INFO_UF2.TXT shows a Factory-Erase line". When checked, the download link serves that file and the serial-monitor step is replaced by a note that the drive comes back on its own; the installed firmware stays. Unchecked, nothing changes: the SoftDevice-specific images and the serial monitor as today. RP2040 untouched.The flasher cannot read the DFU drive, so it cannot detect the line itself; hence the attestation. Older bootloaders ignore the file silently, which the hint says.
Open product question: whether to ship this before an OTAFIX release carrying the feature is common, or hold the PR. Draft until then. Related: meshtastic/api#136, meshtastic/Meshtastic-Android#7058, meshtastic/Meshtastic-Apple#2433, meshtastic/meshtastic#2650.
Two pre-existing strings on this path are now inaccurate for the new file (
flash.erase_uf2.dfu_warning"erase your device completely",flash.uf2.copy_instructions"will start with the new firmware"); left for a follow-up.Type of Change
Testing
vitest run: 277 passed including 4 newdeviceStorecases.eslint .: no new problems (the tree has 282 pre-existing). Ran the binaries directly: the workspace's pnpm 11 failspnpm lint/pnpm test:runbefore they start withERR_PNPM_IGNORED_BUILDS; CI does not pin a pnpm major. Not exercised in a browser.