web: refuse frame-blast SoCs instead of failing at the wire - #122
Conversation
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 "<chip> — 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 <noreply@anthropic.com>
PR Summary by Qodoweb: block frame-blast SoCs in browser UI and add profile parity guard
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo
1.
|
Both raised by Qodo on #122, both reproduced before fixing. Stranded local file selection. The frame-blast branch cleared firmwareData on the way out, but the file input keeps its selection, so the normal path won't reload it — it only clears when no file is selected — and the change handler doesn't re-fire. Selecting a local image, browsing to a CLI-only chip and back left Start disabled with a file still visibly selected. Drop the clear: Start is already gated by needsFrameBlast(), and moving between two supported chips still invalidates a downloaded image via the existing path. CRLF-brittle PROFILES extraction. The parity test anchored on `};\n`, which doesn't match `};\r\n`, so a checkout with core.autocrlf=true failed on a line ending rather than on real drift. Verified: the old pattern finds no match against CRLF input, the new one parses all 109 profiles under both endings. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Both findings were real — reproduced each before fixing, pushed as 1. Local firmware state desync — valid, fixed. Confirmed the path: Took the suggested preferred fix: drop the 2. Brittle PROFILES extraction — valid, fixed. Verified the failure rather than assuming it: A checkout with On the three alternative approaches in the summary: agreed, and that's the split between this PR and #121. Generating 86 tests pass locally. |
Interim fix for #121.
The problem
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 the0x20markers, plus aPRESTEP0block sent ahead ofDDRSTEP0.web/implements neither, and the inlinePROFILESblob has hadPRESTEP0stripped from every entry, so the data isn't even there to send.Until now those chips were selectable. The user picks one, watches the U-Boot download succeed and verify its SHA-256, hits Start Recovery, and then sits 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,hi3518ev200+ ~60 STB partsgk7202v300,gk7205v200,gk7205v300,hi3518ev300,hi3516cv200,hi3516dv300, …hi3516ev300is one of the most widely deployed parts we support — and we have been actively driving traffic here from OpenIPC/wiki#484 and from replies on firmware#1494/#1532/#1674/#1827. Two of those replies recommended the browser tool forhi3516ev300specifically; both have been corrected.The fix
Block them clearly rather than implement frame-blast in JS:
FRAME_BLAST_SOCS+needsFrameBlast()inprotocol.js<chip> — CLI only, and the count now reads "43 of 109 supported in browser" instead of "109 supported"Why this drifted unnoticed — and the guard for it
Profile lookup follows alias files, and an alias holds nothing but a filename.
hi3516ev300.jsoncontains the single linehi3516ev200.json. Checkinghi3516ev300.jsonfor aPRESTEP0finds none because it has no fields at all, which reads as "plain handshake" unless you resolve the alias first. I made exactly that mistake before catching it, which is why the guard is part of this PR rather than a follow-up.web/profile-parity.test.jsresolves aliases the same wayloader.pydoes, recomputes the frame-blast set fromsrc/defib/profiles/data, and fails if it disagrees withFRAME_BLAST_SOCSin either direction. It also asserts every web chip has a CLI profile behind it, and thatPRESTEP0data never reappears in the web blob without an implementation to use it.Wired into CI alongside the existing suite.
Verification
Confirmed the guard actually catches the regression by deleting
hi3516ev300fromFRAME_BLAST_SOCS:Inline page JS syntax-checked, and
needsFrameBlastconfirmed reachable as a global fromindex.html(protocol.jsis loaded via<script src>).Not hardware-tested — I don't have a frame-blast part in front of me. The claim that these chips can't work is a read of the code path, not an observed failure; if some of them tolerate the plain handshake, this PR is over-strict for those and the list should shrink.
Does not close #121
The real fix is generating
PROFILESfrom the CLI profile data and implementing the frame-blast path inprotocol.js. This just stops the silent failure in the meantime.