update: overhauled firmware ui. Added public flash page.

This commit is contained in:
2026-03-18 17:49:40 +02:00
parent 4381a6681d
commit d0ac4f1d91
45 changed files with 6798 additions and 1723 deletions

View File

@@ -177,16 +177,16 @@ def _build_page(entries: List[bytes], slot_counts: List[int], seq: int = 0) -> b
return page
def generate(serial_number: str, hw_type: str, hw_version: str) -> bytes:
def generate(serial_number: str, hw_family: str, hw_revision: str) -> bytes:
"""Generate a 0x5000-byte NVS partition binary for a Vesper device.
serial_number: full SN string e.g. 'BSVSPR-26C13X-STD01R-X7KQA'
hw_type: board family e.g. 'vesper', 'vesper_plus', 'vesper_pro'
hw_version: zero-padded revision e.g. '01'
hw_family: board family e.g. 'vesper-standard', 'vesper-plus'
hw_revision: hardware revision string e.g. '1.0'
Writes the NEW schema keys (2.0+) expected by ConfigManager:
Writes the schema keys expected by ConfigManager (struct DeviceConfig):
serial ← full serial number
hw_family ← board family (hw_type value, lowercase)
hw_family ← board family (lowercase)
hw_revision ← hardware revision string
Returns raw bytes ready to flash at 0x9000.
@@ -196,8 +196,8 @@ def generate(serial_number: str, hw_type: str, hw_version: str) -> bytes:
# Build entries for namespace "device_id"
ns_entry, ns_span = _build_namespace_entry("device_id", ns_index)
uid_entry, uid_span = _build_string_entry(ns_index, "serial", serial_number)
hwt_entry, hwt_span = _build_string_entry(ns_index, "hw_family", hw_type.lower())
hwv_entry, hwv_span = _build_string_entry(ns_index, "hw_revision", hw_version)
hwt_entry, hwt_span = _build_string_entry(ns_index, "hw_family", hw_family.lower())
hwv_entry, hwv_span = _build_string_entry(ns_index, "hw_revision", hw_revision)
entries = [ns_entry, uid_entry, hwt_entry, hwv_entry]
spans = [ns_span, uid_span, hwt_span, hwv_span]