From 86a3cb50b1833d3327cfd7fb87f389151f681a17 Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Sun, 16 Aug 2026 22:36:24 +0300 Subject: [PATCH 1/2] web: refuse frame-blast SoCs instead of failing at the wire MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 66 of the 109 chips in the browser dropdown cannot be recovered by this build. Their bootrom needs a frame-blast handshake — an active 0xAA+HEAD blast rather than passively waiting for the 0x20 markers, plus a PRESTEP0 block sent ahead of DDRSTEP0 — and web/ implements neither. The inline PROFILES blob has had PRESTEP0 stripped from every entry, so the data isn't even present to send. Until now those chips were selectable. A user picked one, watched the U-Boot download succeed and verify its SHA-256, hit Start Recovery, and then sat through a handshake that was never going to complete, with nothing on screen suggesting the tool couldn't drive their part. The affected list is not exotic: hi3516ev300, hi3516ev200, hi3516cv300, hi3516cv500, hi3516av200 and hi3518ev200 are all common camera SoCs, and hi3516ev300 in particular is one of the most widely deployed parts we support. We have been actively pointing people here from OpenIPC/wiki#484 and from replies on firmware#1494/#1532/#1674/#1827. This is the interim fix from #121 — block them clearly rather than implement frame-blast in JS: - FRAME_BLAST_SOCS + needsFrameBlast() in protocol.js - affected options render as " — CLI only"; the count now reads "43 of 109 supported in browser" - selecting one replaces the download UI with the equivalent CLI command and a link to #121, and Start Recovery stays disabled Why the drift went unnoticed: profile lookup follows alias files, and an alias holds nothing but a filename — hi3516ev300.json contains the single line "hi3516ev200.json". Checking hi3516ev300.json for a PRESTEP0 finds none because it has no fields at all, which reads as "plain handshake" unless you resolve the alias first. I got this wrong myself before catching it. So the guard resolves aliases the same way loader.py does, recomputes the frame-blast set from src/defib/profiles/data, and fails if it disagrees with FRAME_BLAST_SOCS in either direction. Verified it catches the regression by deleting hi3516ev300 from the list. Also asserts every web chip has a CLI profile behind it, and that PRESTEP0 data never reappears in the web blob without an implementation to use it. Does not close #121 — the real fix is generating PROFILES from the CLI data and implementing frame-blast in protocol.js. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/ci.yml | 2 +- web/index.html | 42 +++++++++++++-- web/profile-parity.test.js | 104 +++++++++++++++++++++++++++++++++++++ web/protocol.js | 33 ++++++++++++ 4 files changed, 177 insertions(+), 4 deletions(-) create mode 100644 web/profile-parity.test.js diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bdef5b1..ce12c5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,4 +87,4 @@ jobs: node-version: "22" - name: Run JS tests - run: node --test web/protocol.test.js + run: node --test web/protocol.test.js web/profile-parity.test.js diff --git a/web/index.html b/web/index.html index 88d075f..376b3e5 100644 --- a/web/index.html +++ b/web/index.html @@ -71,6 +71,12 @@ .status-msg { padding: 12px 16px; border-radius: var(--radius); margin-top: 12px; font-weight: 600; text-align: center; } .status-msg.success { background: rgba(158,206,106,0.15); color: var(--green); } .status-msg.failure { background: rgba(247,118,142,0.15); color: var(--red); } +.notice-warn { margin-top: 10px; padding: 12px 14px; border-radius: var(--radius); + background: rgba(224,175,104,0.12); border: 1px solid rgba(224,175,104,0.35); + font-size: 0.88em; line-height: 1.5; } +.notice-warn pre { margin: 8px 0; padding: 8px 10px; border-radius: 6px; + background: rgba(0,0,0,0.28); overflow-x: auto; font-size: 0.95em; } +.notice-warn code { background: rgba(0,0,0,0.28); padding: 1px 4px; border-radius: 3px; } .unsupported { background: var(--red); color: #fff; padding: 16px; border-radius: var(--radius); text-align: center; margin-bottom: 16px; @@ -95,6 +101,7 @@

defib

Recovery Setup

+