Repository navigation
Conversation
A BlackBox that shows a black screen or restarts in a loop after an install is restored by tools/uboot_rescue.py from the chip's USB boot state (UBOOT). That tool ran on macOS only (libusb under sudo). It now also runs on Windows. A browser cannot do this step on any system: in UBOOT the pedal is a USB mass-storage device, and WebUSB refuses mass-storage interfaces (a protected class) whatever driver is installed, so a WinUSB or Zadig driver does not help a web page. On Windows the tool sends the same SCSI commands through Windows' own mass-storage driver (IOCTL_SCSI_PASS_THROUGH_DIRECT), with the Python standard library only and no driver change, as kagaimiq/jl-uboot-tool does. Windows allows that only to an administrator. The pedal is found by sending INQUIRY, which only reads, to each disk and drive letter, and only the one that answers WL82 UBOOT1.00 is kept open. Every guard of the tool runs unchanged on top of the new transport: the SHA-256 pinned RAM loader, the chip key and the 1 MiB flash id, the full flash backup, the head check, sector-by-sector erase, write and read-back compare, the writable range [0x4000, end of image) below 0xFF000, the command whitelist, and resume. RESCUE.bat checks for an administrator and for Python 3, then runs the tool. The tool no longer imports pwd at load time, which failed on Windows, and `op.mjs rescue` no longer refuses Windows. Tests run the read-only pass, the write, the resume and the refusals (chip key, flash size, head) through the Windows transport on a fake kernel32, check the SPTD layout against the ntddscsi.h offsets, check that only the pedal's disk stays open, and check that a non-administrator is refused. A new test covers a sector that reads back differently: the tool tries it three times, then stops before run-app. Not tested on real hardware: no pedal and no Windows machine were used. The Windows transport is verified only against a simulated device.
…install BlackBox owners report pedals that no longer start after an install from the web installer (a black screen after installing OpenPocket over a later official firmware). The USB rescue tool restored such pedals. This change brings its safeguards to the installer where the installer can apply them. The two paths work differently. The installer talks MIDI to the firmware the pedal runs, and the pedal's own update loader (loader/ldr_core.c) erases and writes its flash. The rescue talks to the chip's USB boot state and writes the flash itself. So each rescue safeguard either already exists on the pedal side of an install, can be done by the page before the first command, or cannot be done over MIDI: | Rescue tool safeguard | Installer before this change | Now | | --- | --- | --- | | Wait for the pedal and start the moment it appears | Rescue mode does it over MIDI | unchanged | | SHA-256 pinned blob before use | CLI checked the manifest SHA-256; the page checked only the identity | the page checks size, SHA-256, identity and every UFW CRC (verifyPackage) before anything is sent | | Chip key must match | the loader checks that the package decrypts with this chip's key before erasing | unchanged (pedal side) | | Flash id / size | not readable over MIDI | model identity only (unchanged) | | Full flash backup before a write | not possible: the update protocol has no flash read | not ported; the USB rescue keeps it | | Flash head must match the image | not readable over MIDI | new start check: an OpenPocket package over an official firmware newer than the newest the page knows (PocketX_016, BlackBox_021) waits for the user's confirmation | | Write only differing sectors; erase, write, read back | the loader does it | unchanged (pedal side) | | Hard writable range | the loader writes only [0x4000, 0xA3000) | unchanged (pedal side) | | Command whitelist (no chip erase, no key burn) | the page sends only identity, INFO, upgrade and the UBOOT key | unchanged | | Resume after an interruption | Resume button, or --rescue --package | messages now say to reconnect and resume, never to switch the pedal off during an update | | Run-app at the end | the loader resets into the new app | unchanged | The start check runs in Updater.installOn before the upgrade command, so the page, its rescue mode and tools/flash.mjs all get it. It is a precaution, not a block: nothing shows yet that a newer official release is what left pedals unable to start. The page shows a warning and a checkbox, and Install stays disabled until it is ticked; flash.mjs stops with exit 2 (also in a dry run) unless --accept-newer-official is given, then prints the warning and goes on. Windows: the page names a MIDI port that another program holds (on Windows only one program at a time can open it), and the rescue section gives the Mac and the Windows USB rescue steps, read-only check first. Tests: the installer, flasher and page tests stop an unconfirmed install over an unknown official firmware (PocketX_017) with no update step run and the flash unchanged, and complete it once confirmed; the page refuses a package whose bytes differ from the manifest, and a held MIDI port is named. Verified with the simulated pedal only; no real pedal and no Windows browser were used.
flash/installer-fm1buddy-pocketx.bat was stored with LF line endings, unlike every other .bat in the repository, and one echo line used unescaped ">" characters, which redirected output into stray files instead of printing step 4. The file now has CRLF line endings and the line escapes them. Checked by reading only; it was not run on Windows.
A BlackBox owner whose pedal no longer starts should be able to run the USB rescue without reading the whole technical guide. docs/RESCUE.md now opens with "Quick start: rescue a BlackBox that will not boot": what to download, what to install once, the exact line to type, how to tell the read-only check passed, the one extra line that writes, and what to do when it fails. Mac and Windows each get a short numbered list, and the Windows list says plainly that it has not been tested on a real pedal. The installer page carries the same steps in a folded "How to run the rescue on your computer" block in its rescue section, links to the full guide, and the rescue-mode hint points to it. README.md links the quick start. Long messages in the page's status line now wrap, so a SHA-256 refusal no longer widens the page on a phone. The page test checks that the block is folded, that both lists hold the read-only check and the write, that Windows is called untested, that the full guide is linked, and that the page does not scroll sideways at 360 px.
VinSpee
marked this pull request as ready for review
November 18, 2026 15:34
Contributor
Author
|
if anyone has a windows machine I'd appreciate a test of the rescue |
|
i followed all the steps to unbrick the pedal, but this is what i get - - - - |
This branch has not been deployed
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.
Summary
Add a Windows USB rescue, check the package and the pedal's running firmware before an install, and fix the fm1buddy installer's Windows batch file.
Details
This was verified in simulation only (headless Chromium with a mocked Web MIDI pedal, a simulated UBOOT pedal, a fake Windows API) and nothing ran on a real BlackBox or a Windows PC, so an install and a rescue on a pedal that does not boot, and whether a pedal in UBOOT state shows as a disk an administrator can open on Windows, still need hardware. The check for an official firmware newer than the installer knows only warns and asks for confirmation; it is a precaution, not a known cause of the failed boots.