mirror of
https://github.com/ruppert/fmini-1.git
synced 2026-12-06 04:44:27 +01:00
Installer: find the update-mode FM-1 by its new name (FMini-1 Update); the port filter knew only fm-1 / felucca / ota
Since v1.4.29 the update loader is named "FMini-1 Update" (v1.4.28: the running device "FMini-1"); neither matches /fm-1|felucca|ota|.../, so the page never probed the loader's port: stuck at 6 % in "update mode", then "noloader". fm1ota.js and tools/fm1_install.py also look for "fmini"; test_web.mjs now installs and resumes through the names the firmware has had (Felucca / FMini-1, with their Update loaders). The firmware package is unchanged (v1.5). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QUF6pQ1NkTwmBC8SR8AK94
This commit is contained in:
4 files changed
+18
-6
No files matched your search
+1
-1
@@ -745,7 +745,7 @@ class Updater {
|
||||
const outs = [...this.access.outputs.values()];
|
||||
for (const input of this.access.inputs.values()) {
|
||||
if (input.state === "disconnected") continue;
|
||||
if (!/fm-1|felucca|ota|composite|sinco|usb-midi/i.test(input.name || "")) continue; // never probe other gear
|
||||
if (!/fm-1|fmini|felucca|ota|composite|sinco|usb-midi/i.test(input.name || "")) continue; // never probe other gear
|
||||
const output = outs.find((o) => o.name === input.name && o.state !== "disconnected");
|
||||
if (!output) continue;
|
||||
try { await input.open(); await output.open(); } catch (_) { continue; }
|
||||
|
||||
@@ -36,7 +36,7 @@ LOADER_MARK = b"FELUCCA-LOADER-1"
|
||||
# the unmodified official FM-1 V15 (FM-1.fwsc from M-VAVE): returning to it is allowed without --force,
|
||||
# as the web installer's "Return to official V15" (web/fm1pkg.js validateStockPackage)
|
||||
STOCK_V15_SHA256 = "db1642b2b6fa5c2cccb11ffd13878068bb28601678d3644049f99dc40e7edb8a"
|
||||
PORT_RE = re.compile(r"fm-1|felucca|ota|composite|sinco|usb-midi", re.I) # never probe other gear
|
||||
PORT_RE = re.compile(r"fm-1|fmini|felucca|ota|composite|sinco|usb-midi", re.I) # never probe other gear
|
||||
|
||||
# seconds; the tests shorten them
|
||||
DELAY = {"open": 0.3, "start": 2.0, "reply": 0.01, "loader": 3.0, "reboot": 3.0, "retry": 1.0,
|
||||
|
||||
+1
-1
@@ -119,7 +119,7 @@ export class Updater {
|
||||
const outs = [...this.access.outputs.values()];
|
||||
for (const input of this.access.inputs.values()) {
|
||||
if (input.state === "disconnected") continue;
|
||||
if (!/fm-1|felucca|ota|composite|sinco|usb-midi/i.test(input.name || "")) continue; // never probe other gear
|
||||
if (!/fm-1|fmini|felucca|ota|composite|sinco|usb-midi/i.test(input.name || "")) continue; // never probe other gear
|
||||
const output = outs.find((o) => o.name === input.name && o.state !== "disconnected");
|
||||
if (!output) continue;
|
||||
try { await input.open(); await output.open(); } catch (_) { continue; }
|
||||
|
||||
+15
-3
@@ -1640,8 +1640,9 @@ const UPGRADE = [0xF0, 0x22, 0x24, 0x35, 0x7F, 0xF7];
|
||||
|
||||
/* an FM-1 on WebMIDI: identity, then "device asks, host answers" reads of the image */
|
||||
class FakeFM1 {
|
||||
constructor(image, { unplugAfter = Infinity } = {}) {
|
||||
constructor(image, { unplugAfter = Infinity, run = "Felucca", ota = "Felucca Update" } = {}) {
|
||||
this.image = image; this.unplugAfter = unplugAfter; this.served = 0; this.bad = 0;
|
||||
this.runName = run; this.otaName = ota; // the USB names: "Felucca" / "Felucca Update" (until v1.4.27), "FMini-1" / "FMini-1 Update" (v1.4.28+)
|
||||
this.access = { inputs: new Map(), outputs: new Map() };
|
||||
this.boot("FM-1_015", "FM-1");
|
||||
}
|
||||
@@ -1677,8 +1678,8 @@ class FakeFM1 {
|
||||
this.waiting = null;
|
||||
this.served++;
|
||||
if (this.served >= this.unplugAfter) { this.input.state = this.output.state = "disconnected"; return; }
|
||||
if (addr === 0xE0000000) setTimeout(() => this.boot("ota-FM-1_900", "Felucca Update"), 300);
|
||||
else if (addr === 0xF0000000) setTimeout(() => this.boot("FM-1_900", "Felucca"), 300);
|
||||
if (addr === 0xE0000000) setTimeout(() => this.boot("ota-FM-1_900", this.otaName), 300);
|
||||
else if (addr === 0xF0000000) setTimeout(() => this.boot("FM-1_900", this.runName), 300);
|
||||
else this.next();
|
||||
}
|
||||
}
|
||||
@@ -1703,6 +1704,17 @@ async function updater() {
|
||||
ok(got === "FM-1_900" && dev.bad === 0 && steps.includes("write") && steps.at(-1) === "done",
|
||||
`fm1ota.js: install: running firmware -> loader -> Felucca (${dev.served} reads)`);
|
||||
|
||||
/* the USB names the firmware has had: the update loader ("FMini-1 Update" since v1.4.29) must be found by its name too */
|
||||
for (const [run, ota] of [["FMini-1", "FMini-1 Update"], ["Felucca", "FMini-1 Update"], ["FM-1", "Felucca Update"]]) {
|
||||
const dn = new FakeFM1(image, { run, ota });
|
||||
dn.boot("FM-1_015", run);
|
||||
const gn = await new Updater(dn.access).install(image, "FM-1_900").then((v) => v, (x) => x.code || String(x));
|
||||
ok(gn === "FM-1_900" && dn.bad === 0, `fm1ota.js: install through the ports "${run}" -> "${ota}" -> "${run}" (${gn})`);
|
||||
const dr = new FakeFM1(image, { run, ota });
|
||||
dr.boot("ota-FM-1_900", ota);
|
||||
ok(await new Updater(dr.access).resume(image) === true, `fm1ota.js: resume finds the loader named "${ota}"`);
|
||||
}
|
||||
|
||||
const dev2 = new FakeFM1(image, { unplugAfter: 3 });
|
||||
dev2.boot("ota-FM-1_900", "Felucca Update");
|
||||
const t0 = Date.now();
|
||||
|
||||
Reference in new issue
Block a user