update: Added NVS Gen on the Flasher

This commit is contained in:
2026-03-27 11:17:10 +02:00
parent 2b05ff8b02
commit 7a5321c097
3 changed files with 34 additions and 14 deletions

View File

@@ -851,6 +851,7 @@ function StepFlash({ device, bespokeOverride, onFlashed }) {
const [serial, setSerial] = useState([]);
const [serialAutoScroll, setSerialAutoScroll] = useState(true);
const [error, setError] = useState("");
const [nvsSchema, setNvsSchema] = useState("new");
const loaderRef = useRef(null);
const portRef = useRef(null);
@@ -993,9 +994,10 @@ function StepFlash({ device, bespokeOverride, onFlashed }) {
const partUrl = bespokeOverride
? `/api/manufacturing/devices/${sn}/partitions.bin?hw_type_override=${bespokeOverride.hwFamily}`
: `/api/manufacturing/devices/${sn}/partitions.bin`;
const nvsSchemaParam = nvsSchema === "legacy" ? "&nvs_schema=legacy" : "";
const nvsUrl = bespokeOverride
? `/api/manufacturing/devices/${sn}/nvs.bin?hw_type_override=${bespokeOverride.hwFamily}&hw_revision_override=1.0`
: `/api/manufacturing/devices/${sn}/nvs.bin`;
? `/api/manufacturing/devices/${sn}/nvs.bin?hw_type_override=${bespokeOverride.hwFamily}&hw_revision_override=1.0${nvsSchemaParam}`
: `/api/manufacturing/devices/${sn}/nvs.bin${nvsSchema === "legacy" ? "?nvs_schema=legacy" : ""}`;
appendLog("Fetching bootloader binary…");
const blBuffer = await fetchBinary(blUrl);
@@ -1232,16 +1234,32 @@ function StepFlash({ device, bespokeOverride, onFlashed }) {
</button>
)}
{portConnected && !done && (
<button
onClick={handleStartFlash}
className="flex items-center gap-2 px-5 py-2 text-sm rounded-md font-medium hover:opacity-90 transition-opacity cursor-pointer"
style={{ backgroundColor: "var(--btn-primary)", color: "var(--text-white)" }}
>
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13 10V3L4 14h7v7l9-11h-7z" />
</svg>
Start Flashing
</button>
<>
<select
value={nvsSchema}
onChange={(e) => setNvsSchema(e.target.value)}
disabled={flashing}
className="px-3 py-2 text-sm rounded-md border cursor-pointer font-medium"
style={{
backgroundColor: "var(--bg-input)",
borderColor: "var(--border-primary)",
color: "var(--text-secondary)",
}}
>
<option value="new">NVS: Current Gen</option>
<option value="legacy">NVS: Legacy Gen</option>
</select>
<button
onClick={handleStartFlash}
className="flex items-center gap-2 px-5 py-2 text-sm rounded-md font-medium hover:opacity-90 transition-opacity cursor-pointer"
style={{ backgroundColor: "var(--btn-primary)", color: "var(--text-white)" }}
>
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13 10V3L4 14h7v7l9-11h-7z" />
</svg>
Start Flashing
</button>
</>
)}
</div>
)}