Skip to content

fix(loader): refuse a BlackBox on M-VAVE V22 or later before writing anything - #35

Open
steponme82 wants to merge 1 commit into
isod89:mainfrom
steponme82:v22-guard
Open

steponme82 wants to merge 1 commit into
isod89:mainfrom
steponme82:v22-guard

Conversation

@steponme82

Copy link
Copy Markdown
Contributor

@isod89 @VinSpee

This stops the black screens in #31 and #33, and very likely the Windows reports in #32.

The cause: M-VAVE's BlackBox firmware V22 and later moved the app area of the flash from 0x4000 to 0x6000, behind a bigger boot loader that runs to 0x5CA0. Our update loader writes [0x4000, 0xA3000) without looking, so over V22 or V23 it overwrites the end of that boot loader and the pedal no longer starts. Pedals that never had V22 or later are fine.

What this PR does:
1: The update loader reads the pedal's own flash head before erasing anything (the same entries the chip key check already reads). If app_dir_head is not at 0x4000, or the boot loader runs past it, it writes nothing, erases the update record and restarts the pedal on its own firmware. The official BlackBox V16, V20 and V21 heads pass: I checked them with flashes built from the real packages.
2: The page refuses a pedal that reports BlackBox_022 or later before sending anything, keeps the Install button off and says why. When the loader refuses, the page now says so at once instead of waiting 3 minutes.
3: Tests: a V22 layout flash in the fixtures, the page refusal, the loader refusal (nothing written, record erased, pedal back on its own firmware).
4: README and RESCUE.md: why, and the way back for a pedal that already went dark: M-VAVE's own flash.bin written back with the UBOOT rescue, as igniferr did in #31.

This overlaps with #34 in pxota.js, index.html and test_installer.mjs. The newer firmware check there is the right spot on the page side, but for a BlackBox on 022 or later it should refuse, not ask: confirming still bricks the pedal. The loader check here is what holds even when the page is bypassed. Happy to rebase this on #34, or to move the loader part into it, whichever you prefer.

The app images don't change. The packages need rebuilding at release to carry the new loader; the page part works as soon as the site is updated.

Not tried on a real V22 or V23 pedal, I don't have one. The refusal runs in the simulated pedal with the real loader code.

🤖 Generated with Claude Code

…er, before anything is written

M-VAVE's BlackBox firmware V22 (2026-11-12) and later moved the app area from 0x4000 to 0x6000, behind a boot loader that
runs to 0x5CA0 (isd_config at 0x5CA0). The update loader writes [0x4000, 0xA3000): over such a head it overwrote the boot
loader's end and the pedal stayed dark (isod89#31, isod89#33, and the reports gathered in isod89#32).

- loader/ldr_core.c, step 1b: the pedal's own JLFS top entries (as the chip-key check reads them) must put app_dir_head at
  0x4000, with nothing before it running past 0x4000 (the official BlackBox V16, V20 and V21 heads, Pocket X 016).
  Otherwise nothing is written: the update records are erased (step 4's sweep, now shared), the host is told why (a read of
  0xF1000000 + the reason, 1 to 5) and loader.c resets, so the SPL boots the pedal's own firmware.
- docs/pxota.js: NEW_LAYOUT (an official BlackBox_022 or later) is refused before anything is sent; the loader's refusal is
  answered at once (error code "layout") instead of the write's 3-minute wait. docs/index.html: for such a pedal the Install
  button stays off, with the reason; the message after a refusal says what to do.
- tests/fixtures.py builds flash_v22.bin (the same flash, its head's entries moved as V22's); tests/test_installer.mjs: the
  page refuses BlackBox_022 (nothing sent, nothing written), the loader refuses a V22 head behind an older identity (nothing
  written in [0, 0xA3000), the update record erased, the pedal back on its own firmware, the page told in under a second).
  tests/devsim.c restarts the simulated pedal on its own firmware after a refusal. Also checked by hand: flashes built from
  the official BlackBox V16, V20 and V21 packages still install (their heads pass).
- README and docs/RESCUE.md: why, and the way back for a pedal that already went dark (M-VAVE's own flash.bin written back
  by the UBOOT rescue, whose head check passes: the route of isod89#31).

The app images are unchanged; the packages change by their update loader.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
VinSpee added a commit to VinSpee/undertone that referenced this pull request Nov 22, 2026
…rmware 22+ on the installer (#53)

* fix(loader): refuse a flash head the loader does not know, and BlackBox V22 and later on the page

The update loader now reads the pedal's own flash head before it erases anything. Unless the head puts the app area at
0x4000 with nothing before it running into it, the loader writes nothing to the head or the app area, erases its
update record so the pedal boots its own firmware, tells the host why, and restarts. M-VAVE's BlackBox V22 and V23 put
the app area at 0x6000 behind a boot loader that runs to 0x5CA0, which the old loader overwrote.

The installer page and `node tools/op.mjs flash` refuse a BlackBox on official firmware 022 or later before anything
is sent, with no confirmation that lifts it, and say in words when the loader refused a head.

The check comes from upstream pull request isod89#35.

The app image is unchanged. The packages carry the new loader, so the release pin moves on purpose.

* no-mistakes(document): Document loader flash-head refusal in handbook and README

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant