# USB enumeration deterministic recovery v2 target proof

Status: complete
Result: complete; bounded production enumeration recovery target-proven
Type: evidence
Updated: 2026-08-01
Next Action: none; the BOT correction and representative cross-device delta regression are complete
Campaign: 003-complete-bounded-hpt-slow-export-firmware-ticket
Final Evidence: work/evidence/usb-bot-representative-delta-regression-20260801.md
Project Map: work/maps/map-smi-firmware-stabilization-and-qualification.md
Workpackage: work/wp/completed/wp-restore-broad-usb-compatibility-baseline.md
Software Candidate: work/evidence/usb-enumeration-deterministic-test-v2-software-candidate-20260801.md

## Result

PASS. Controller B deterministically traversed USBX's exhausted-enumeration
failure disposition and the production bounded recovery path performed exactly
one root-port retry. `USB03_32G` then mounted at high speed with a valid
USBX/FileX session, zero application/system errors, and no VBUS action. An
ordinary powered removal and reinsertion advanced the media generation without
starting a second recovery attempt.

The qualification-only hook was then removed and the exact frozen production
enumeration-recovery image was restored. Source matches the production recovery
checkpoint for all three hook-bearing files, qualifier symbols are absent, and
focused gates plus canonical Debug and Release rebuilds pass.

This proves the bounded retry mechanism and its once-per-physical-attachment
guard. It does not claim that all future enumeration failures or USB devices
will succeed.

## Target identity and baseline

- Setup: Controller B
- Controller serial: `1751219`
- J-Link serial: `69660123`
- Hardware variant: `1`
- USB specimen: `USB03_32G`
- Protocol card status: `5`
- CID-valid status: `1`
- Representative-sector-read status: `1`
- Manufacturer: MID `0x03` (SanDisk)
- OEM/application ID: `SD`
- Product name: `SS08G`
- Product revision: `8.0`
- Serial number: `2540634245`
- Manufacturing date: `2024-05`
- Raw 128-bit CID: `035344535330384780976F0085018507`

The same CID and representative-sector result were captured after each relevant
program/reset transition. USB identity was independently checked on the Pi as
model `USB 2.0 FD`, serial `071C49DE25C08808`, volume label `USB03_32G`.

## Deterministic proof

The guarded v2 image was armed only while no USB drive was attached. Inserting
`USB03_32G` produced the following terminal state:

- qualification state `4` (`FINALIZED`), injection count `3/3`, live command
  cleared;
- recovery state `3` (`COMPLETE`), attempt count exactly `1`;
- root extraction status `0`, enumeration-semaphore status `0`;
- USB mounted, configured state `3`, high-speed state `2`;
- valid FileX/application ownership and acceptance mask `15`;
- zero application and system error counts; and
- no controller-driven VBUS action.

The retained USBX system error count of one with last error `68` was the
intentionally injected native `UX_DEVICE_ENUMERATION_FAILURE`. It was expected
proof input, not an unplanned target failure.

After an ordinary powered remove/reinsert, media generation advanced from `1`
to `2`, the drive mounted normally at high speed, the qualification command
remained cleared, and the recovery attempt count remained exactly `1`.

## Frozen images and readback

Qualification v2 candidate:

- Release ELF SHA-256:
  `B6C1F73064D996C70BAA8EE013ECE04391ED1E9725940E2099A0262875CF6407`
- Release S-record SHA-256:
  `C99F166F0F7326942D9033DEBCAFF05608408190105FB0624A09CBD885276756`
- Controller B full 4 MiB readback SHA-256:
  `8E93D9B2C2E4AAE44F307AE1DF20AA794993D004DAD2142EE30312013AC877C9`

Restored production enumeration-recovery baseline:

- Debug ELF SHA-256:
  `1B541E411EB9FF3D08DA71ED76BFCB584327B8290C5EC83418751C82D4ACFEE9`
- Debug S-record SHA-256:
  `DC2E7E5EB1DE2E0466548CCF7D690D1D07B08AD80C82E189D334EA2B58000C1C`
- Release ELF SHA-256:
  `6E89C5664D3B4F7FDBAC1910BA826D5049934E895D9CDE28A60DF0F520766205`
- Release S-record SHA-256:
  `E31845E8EA8993B7271F2123E8830113213FE954968B2CA133BE1FF0B217B888`
- Controller B full 4 MiB readback SHA-256:
  `9CAF4ED22E2E7E06B900D6098D110650DB8987A2DE629783CE91AD43D9D3AEF2`

The restored no-drive capture showed HPT ready, complete CID and representative
sector identity, zero system/application/USBX errors, and no qualification
symbols in the production ELF.

## Validation

Passed:

- `script/check-usb-mass-storage-workflows.ps1`
- `script/check-usb-write-size-diagnostic.ps1` (`9/9`)
- `script/check-usb-transaction-inventory.ps1`
- `script/check-hpt-customer-export.ps1` (`34/34`)
- `script/check-code-review-mitigations.ps1` (`15/15`)
- `script/check-sd-card-cid.ps1` (`25/25`)
- `python script/test-usb-mass-storage-workflows.py` (`9/9`)
- Python compile checks for the USB host tests/bench scripts
- PowerShell parser check for the qualification capture script
- canonical managed Debug rebuild
- canonical managed Release rebuild

Raw target captures are retained under the ignored paths:

- `work/evidence/hpt-log-store-circular-mirror/controller-b/usb-enumeration-v2-predeploy-20260801/`
- `work/evidence/hpt-log-store-circular-mirror/controller-b/usb-enumeration-deterministic-v2-target-proof-20260801/`
