@protoboardai/ext-drone 0.0.0-stage → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,126 @@
1
+ ---
2
+ name: firmware-verify
3
+ description: Verify a generated flight-controller configuration on the real hardware, props off — apply the CLI, diff the result, then check ports, receiver and telemetry, OSD, GPS, compass alignment, motor order and direction, bidirectional DShot and the current sensor, resolving every UNVERIFIED item in the firmware reference — and record the result as measured test data. Use after firmware-config, before any flight, and after any firmware or wiring change. Physical effects: a person performs or authorises each step.
4
+ ---
5
+
6
+ # Firmware verify (bench)
7
+
8
+ Everything here happens on a physical unit. An agent can prepare the
9
+ checklist, read dumps and logs, and record results; a person connects the
10
+ battery and spins motors. **Props off for every step.** First power through a
11
+ current limiter (smoke stopper or bench supply at ~1 A).
12
+
13
+ ## Purpose
14
+
15
+ Close the gap between a configuration that agrees with the model and one
16
+ that works on the unit: pads, directions, alignment and sensor scales can
17
+ only be confirmed on hardware. Use it after **firmware-config**, before any
18
+ flight, and after any firmware or wiring change. In **build-a-project** it
19
+ comes after the release (stage 11): the unit under test is built from a
20
+ release, and the result is recorded against it. An agent prepares and
21
+ records; a person performs or authorises every physical step.
22
+
23
+ ## Inputs
24
+
25
+ | Input | Where | From |
26
+ | --- | --- | --- |
27
+ | The release and unit under test | release name and unit serial | **release** |
28
+ | The generated configuration and its record | `firmware/<fw>/cli.txt`, `operations/` | **firmware-config** |
29
+ | Firmware version and build options it asks for | the CLI header (`# Target … firmware >= … cloud build options …`) | **firmware-config** |
30
+ | The UNVERIFIED list | `firmware-config/references/betaflight-reference.md` | **firmware-config** |
31
+ | The generator's warnings | `npx protoboard run betaflight-cli --format json` → `data.warnings` | **firmware-config** |
32
+ | A person at the bench | with the unit, a current-limited supply, a clamp meter, a multimeter | the operator |
33
+
34
+ ## Steps
35
+
36
+ ### 1. Prepare
37
+
38
+ - The release/revision and unit serial under test (**release**).
39
+ - `firmware/<fw>/cli.txt` and its operation record; the firmware version and
40
+ build options it asks for.
41
+ - The UNVERIFIED list from the reference
42
+ ([betaflight-reference.md](../firmware-config/references/betaflight-reference.md))
43
+ and the generator's warnings:
44
+
45
+ ```bash
46
+ npx protoboard run betaflight-cli --format json # data.warnings; the run must not change cli.txt (git diff firmware/)
47
+ ```
48
+
49
+ ### 2. Flash and apply (a person does this)
50
+
51
+ 1. Flash the stated firmware with the stated build options (a missing `MAG`
52
+ option silently compiles the compass driver out).
53
+ 2. CLI: `diff all` → save as `firmware/<fw>/bench/<date>-before.txt`.
54
+ 3. Paste `cli.txt`; the FC reboots on `save`.
55
+ 4. `diff all` again → `…-after.txt`. Every generated line must appear (or be
56
+ the firmware default, which `diff` omits); any rejected line is a finding
57
+ against the reference.
58
+
59
+ ### 3. Checks (each: expected from the model, observed, pass/fail)
60
+
61
+ | Check | Expected (model) | How |
62
+ | --- | --- | --- |
63
+ | Pads = UARTs | the link's UART is the pad you soldered | Ports tab lists the functions on the right UARTs; each peripheral works (below). Resolves "pads labelled as the target expects". |
64
+ | Receiver | CRSF on the receiver link's UART | Receiver tab: sticks move the right channels; telemetry (RSSI, battery) reaches the radio. |
65
+ | OSD | MSP DisplayPort on the air-unit link's UART | OSD elements visible in the goggles, HD canvas. |
66
+ | GPS | GNSS on its UART, auto-config | Sats and fix in the GPS tab (outdoors); the module's baud was negotiated. |
67
+ | Compass | detected at the model's I2C address; `align_mag` per the maker | Sensors tab shows MAG; rotate the craft: heading follows (N-E-S-W), no mirror. Resolves the alignment item. |
68
+ | Motor order | Quad-X order from the phase links | Motors tab, props off: M1 rear-right, M2 front-right, M3 rear-left, M4 front-left spin. |
69
+ | Motor direction | the spin the model states for each arm | Each motor's direction matches its prop's handedness; fix with the ESC tool (AM32) or `motor_direction` per the firmware, then record. |
70
+ | Bidirectional DShot | both parts state it (weak source: say which) | Motors tab shows RPM with ~0 % error. Otherwise turn it off and record the finding against the part. |
71
+ | Current sensor | the ESC's `ibata_scale` | Compare the FC's current with a clamp meter at 2–3 loads; adjust scale only with a recorded measurement. |
72
+ | Voltage | `vbat_scale` default | FC voltage vs multimeter within 0.05 V/cell. |
73
+
74
+ ### 4. Record
75
+
76
+ Write `docs/test-data/firmware-bench.json` (status `measured`; **test-and-measure**):
77
+ conditions (release, unit, firmware version, build options, cli.txt sha256),
78
+ columns `check`, `expected`, `observed`, `pass`, one row per check, raw files
79
+ (`before`/`after` dumps, screenshots, Blackbox logs). Validate it:
80
+
81
+ ```bash
82
+ npx tsx node_modules/@protoboardai/ext-hardware/skills/test-and-measure/scripts/test-data.ts docs/test-data/firmware-bench.json
83
+ ```
84
+
85
+ Feed every failure back: a wrong pad mapping or alignment becomes a model fix
86
+ (part fact or link), then regenerate the CLI — never a hand edit of
87
+ `cli.txt`.
88
+
89
+ ## Decision points
90
+
91
+ | Decision | Rule |
92
+ | --- | --- |
93
+ | Continue after a failed check | Stop before anything that spins or powers more: fix the model, regenerate, re-apply, re-check. |
94
+ | A rejected CLI line | A finding against the reference; correct the reference (source-pinned) and the generator, not the dump. |
95
+ | Adjust a scale | Only with a recorded measurement at two or more loads. |
96
+ | The NOT FLIGHT-TESTED header | May be reconsidered only when every check passes, and only for the recorded firmware version and unit. |
97
+ | Who acts | A person performs every physical step; an agent prepares, reads and records. |
98
+
99
+ ## Outputs
100
+
101
+ | Output | Where |
102
+ | --- | --- |
103
+ | Before/after dumps | `firmware/<fw>/bench/<date>-before.txt`, `<date>-after.txt` |
104
+ | The measured result | `docs/test-data/firmware-bench.json` |
105
+ | Model fixes | the parts and links (through **uhd-part-author**, **system-compose**), then a regenerated `cli.txt` |
106
+
107
+ ## Verification
108
+
109
+ `test-data.ts` passes on `firmware-bench.json`; every row of the checks table
110
+ has an observed value and pass/fail; every UNVERIFIED item in the reference
111
+ is resolved or still listed with the reason; the release and unit are named
112
+ in the file's conditions.
113
+
114
+ ## Failure handling
115
+
116
+ | Code or symptom | Means | Do |
117
+ | --- | --- | --- |
118
+ | A generated line rejected by the CLI | The reference is wrong for this version | Fix the reference and generator (**firmware-config** step 2) |
119
+ | A peripheral works on another UART than the link says | Pads not labelled as the target expects, or the link is wrong | Fix the link or the FC part's pad facts; regenerate |
120
+ | Heading mirrored or rotated | `align_mag` is wrong for the mounting | Fix the GNSS part's alignment fact from the maker; regenerate |
121
+ | A motor in the wrong position or direction | Phase links or spins disagree with the mixer | Remap or rewire, record the decision; fix the model to match |
122
+ | RPM telemetry errors | Bidirectional DShot does not work with this ESC firmware | Turn it off; record the finding against the part |
123
+ | `test-data.ts` fails | The record is incomplete or has placeholders | Complete it; never commit a placeholder as measured |
124
+ | `UHD_PROP_HANDEDNESS` | Spins not set or mismatched in the model | **system-compose**: set `spin` per arm |
125
+
126
+ Every other code: **system-compose** [diagnostic codes](../system-compose/references/diagnostic-codes.md).