4.3 Firmware Loading & Device Programming
Firmware loading is where hardware gains its true identity, transforming from a blank assembly into a functional, trusted device. This stage not only installs application code but also provisions each unit with unique credentials, secure keys, and configuration data that define how it behaves in the field. By combining controlled programming flows, guarded fixtures, and HSM-backed provisioning, the process ensures every unit boots with the right software, the right security posture, and a traceable lineage. Order and discipline are crucial—when images, identities, and fuses are applied in sequence, the result is a reliable product foundation that resists both errors and tampering.
4.3.1 Purpose (in one line)
Put the right bits and the right identity into the unit—once, verifiably, and tied to the serial number.
4.3.2 What you’re actually doing
- Programming: bootloader/app images into MCU/SoC internal flash, SPI/QSPI/NAND/NVMe/eMMC, CPLD/FPGA config, PMIC tables.
- Provisioning: unique data—SN, MAC/IMEI, certificates/keys, region features, calibration constants.
- Lifecycle steps: enable secure boot, burn fuses/OTP, and (later) lock debug—in the right order.
4.3.3 Transports & targets (cheat sheet)
4.3.4 Fixtures that make success boring
- Bed-of-nails with pogo for SWD/JTAG/UART/USB; prefer Tag-Connect pads or edge fingers over loose cables.
- Interlocked lid, E-stop; target power from a clean supply (no shared lab bricks).
- Guides & strain relief for any cabled connectors (no dangling USB-C).
- ESD discipline: mat/strap; ionizer for films.
- Power sense & reset lines under software control (hold in BOOT/ROM reliably).
4.3.5 Image management (one truth)
- Golden image set = bootloader + app + option bytes/efuses + partition map + default NVM.
- Every set has a Manifest: product PN/Rev, image hashes, toolchain versions, expected anti-rollback number, and signing cert ID.
- Store in a versioned vault; station pulls by SKU/Variant scan (no drag-and-drop from desktop).
- Hash verify before program and readback verify after (full or sampled per policy).
4.3.6 Security & keys (do it right the first time)
- Keys, certs, IMEI/MAC blocks live in an HSM or secure server, not in the fixture PC.
- Just-in-time provisioning: unit asks the server for one identity; server marks it used on success.
- No duplicates: station blocks reuse; MES alarms on collision.
- Lock sequence:
- Program bootloader/app.
- Run functional test sanity.
- Inject keys/IDs.
- Enable secure boot / readout protection.
- Disable debug (or move to restricted RMA mode) after all tests that need it.
4.3.7 Programming flow (station playbook)
- Scan unit SN / SKU / Variant → station fetches the right recipe (images + limits).
- Fixture clamps; ESD check; target power ON; force BOOT mode (strap/jumper/GPIO).
- Erase target region(s); program image(s); verify hash/readback.
- Provision: write SN/MAC/certs/region flags/cal constants; read back to confirm.
- Lifecycle: set fuses/OTP, secure-boot flags; lock debug if flow allows.
- Reboot to app; quick smoke test (USB enumerate, LED pattern, console ID).
- Record: push versions, hashes, fuses state, and IDs to MES bound to SN.
- Label: print any labels that mirror identities (MAC/IMEI) from MES only.
4.3.8 Timing & capacity (meet takt)
- Use gang programmers or two fixtures (ping-pong) if program time > takt.
- Pre-program modules (e.g., Wi-Fi/BT modules) offline when allowed; verify again in final box.
- Cache large images locally with hash pinning to avoid network jitter; still verify against manifest.
4.3.9 Power integrity (no brownouts, no bricks)
- Dedicated programmable PSU with current limit; log V/I during flash.
- Hold reset during attach; release per tool script.
- Don’t hot-plug debug headers not designed for it; use series resistors and keyed cables to avoid latch-up.
4.3.10 Calibration & regions (keep them separate)
- Put calibration data and region options in a separate NVM partition so field updates don’t erase them.
- Version cal tables; attach ambient temp to cal if relevant.
- Region flags should match label kit and safety test selection.
4.3.11 Data to record (minimum that saves you later)
Attach to SN:
- Recipe ID, image hashes, tool versions, programmer FW rev.
- Provisioned fields: MAC/IMEI/SN, cert thumbprints, region flags.
- Fuse/OTP map: RDP level, secure-boot, JTAG lock state.
- Timestamps, operator, fixture ID, V/I trace during program.
- Any retries and exact step of failure.
4.3.12 Acceptance cues (fast eyes)
4.3.13 Common traps → smallest reliable fix
4.3.14 Pocket checklists
Before
- Scan SKU/Variant/SN → recipe pulled; images hashed OK
- Fixture closed; ESD OK; target power stable; boot strap set
- HSM/key service reachable; label printer tied to MES
Run
- Erase → Program → Verify pass
- Provision IDs/keys → Readback match
- Set fuses/OTP as recipe; debug state per plan
- Reboot to app; smoke test green
After
- Results (hashes, IDs, fuses) to MES by SN
- Labels (MAC/IMEI/etc.) printed from MES, applied per map
- Any fail to NG-QUAR with exact step noted