Update the notes, flashing guide and READMEs for the 2026-11-11 bench run

Document the MAC rotation (16-octet STATION_CONFIGURE), the ATT MTU of 517, the battery
reading fix, pairing and bonds with several boards, tools/station_tx_test.py, what was
dropped from the earlier MicrOBU version and what Niklas Dathe's latest firmware added,
and the measured results (BLE adds no transmit loss over USB). Test counts: 40 firmware,
131 app.
This commit is contained in:
Ashin Walpola
2026-11-11 15:32:42 +01:00
parent d02948d7fc
commit 38c21ed2a4
6 changed files with 82 additions and 16 deletions
+41 -4
View File
@@ -18,7 +18,7 @@ Layout:
| `external/vanetza/` | patched upstream Vanetza source (unchanged, see its `UPSTREAM`) |
| `docs/station-link.tex` | the link interface reference this firmware and the app implement: **revision 2**, Niklas Dathe's revision 1 plus our extensions (the original PDF is `microbu-firmware/docs/station-link.pdf`; build ours with `pdflatex`, no LaTeX is installed on the lab laptop) |
| `cmake/no_efuse_writes.cmake` | build guard: nothing in this firmware may program eFuses |
| `test/host/` | PC tests (`make` in that folder): the MicrOBU C code (`gn_unwrap.c`, `geonet.c`), the battery policy and, with `make firmware`, 39 unit tests of the link codec, V2X_RX and the policies |
| `test/host/` | PC tests (`make` in that folder): the MicrOBU C code (`gn_unwrap.c`, `geonet.c`), the battery policy and, with `make firmware`, 40 unit tests of the link codec, V2X_RX and the policies |
Take a newer release from Niklas Dathe by copying `firmware/{main,components,cmake}` and
`external/vanetza` over these folders and re-applying the `MicrOBU:` changes (search the sources
@@ -62,6 +62,12 @@ custom PCB; pick it in `menuconfig -> micrOBU firmware -> Board`.
- **Partition table**: 80 KB NVS (Niklas Dathe's 24 KB filled up and BLE bonds stopped persisting),
app at `0x20000`. A plain app-only flash of an older layout is wrong: flash everything.
- **Flash size 8 MB** (XIAO), TX power ceiling 20 dBm (`radio_policy.hpp` admits 20 dBm on channel 180).
- **ATT MTU 517** (`CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU`, Niklas Dathe's 512): the app asks for 517 and a 494-octet
V2X_RX is a 512-octet link message, which needs a value of 512, i.e. an MTU of 515. At 512 such a message was
split into fragments the app does not reassemble.
- **Link-layer address.** A signed station without a named MAC uses the address derived from its ticket; with the
16-octet STATION_CONFIGURE the phone names it (see "Unsigned transmission"). The CAM and VAM station ID still
rotates in the app; the app now rotates the MAC with it on a ride and keeps one fixed for the bench pinger.
### Link spec revision 2
@@ -69,14 +75,45 @@ custom PCB; pick it in `menuconfig -> micrOBU firmware -> Board`.
e4e4bd8, kept unchanged as `microbu-firmware/docs/station-link.pdf`) plus a section "MicrOBU extensions": `V2X_RX`
(0x90), unsigned transmission (security profile 0x01, or 0x00 with `security` 0; random MAC per configure),
the battery shutdown rule, no USB writes without a host, and a revision history. The wire format of
revision 1 is unchanged, so a revision 1 host still works. No LaTeX is installed on the lab laptop: build
the PDF with `pdflatex station-link.tex` (twice) elsewhere.
revision 1 is unchanged, so a revision 1 host still works. Build the PDF with `pdflatex station-link.tex`
(twice) and commit it with the `.tex`; the LaTeX build files next to it are ignored. The section "Naming the MAC"
documents the 16-octet STATION_CONFIGURE, which revision 1 retires but the station still decodes.
### Dropped from the earlier MicrOBU version, and why
The first port (2026-09-23) carried a few things that Niklas Dathe's current firmware makes unnecessary:
- **Bench listener** (`CONFIG_MICROBU_BENCH_LISTEN`): his `RAW_CAPTURE` / `RAW_FRAME` does the same over the link.
- **BLE pauses advertising while USB is in use**: his TX guard now holds each frame out of the BLE connection-event windows.
- **Battery flags at STATUS octets 103-105**: his layout puts channel-load fields there; the app derives low (3.50 V)
and critical (3.30 V) from `battery_mv` at octet 129.
- **The ETSI test channel** and the UART0 console: the log travels as LOG frames on the USB link.
- **`CONFIG_MICROBU_BATTERY_SCALE_PERMILLE`**: his battery code has no trim. The XIAO's reading was never compared
with a multimeter on the glued-in cell; the app shows 4.14-4.16 V on a charging cell, close to the charger's 4.20 V.
### What Niklas Dathe's latest firmware added over his earlier one
The station grew from about 580 to 1,360 lines. From his commit messages (not all of it read line by line): ITS clock
slewing, a TX guard against BLE collisions, stale-request refusal (`generated_at_ms`), a pending queue that replaces an
unsent VAM with a newer one, Adaptive DCC with channel-busy-ratio measurement, declared radio operating points from
EN 302 571 measurements, robust CCA counters and TX retry, heap diagnostics, asn1c tables kept in flash, BLE with no
eFuse-based gates, an on-device TS 102 941 client (enrolment and authorisation relayed by the phone, trust bootstrap and
update), the `RAW_CAPTURE` debug path, fragmentation of link messages, the XIAO and `mainboard-v5` boards, and the
battery reading.
### Measured on the bench, 2026-11-11
Production XIAO on COM10, Pixel 9 Pro on BLE, COM3 board as an on-air listener (details and open points in `TODO.md`):
the simulated car's CAMs reach the app; signed CAMs from the phone (tickets 1) and unsigned ones are heard by the
listener; over USB with BLE off 95.7 % of 300 signed CAMs were heard and over BLE with the screen on 95.7 % of 188, so
the BLE link adds no measurable loss; the BLE bond survives a board reset. `tools/station_tx_test.py` plays the phone
over USB and reads the station's own raw capture, which shows the 802.11 source address of what leaves the radio.
### What the new firmware changes for the phone
See `docs/station-link.tex` (revision history at its end). In short: `RESULT`/`STATUS` became `CONFIRM` (0x80) with the 131-octet
status in `CONFIRM.detail` of `STATUS_REQUEST`; STATION_CONFIGURE is 6 octets (type, channel, power,
security, beaconing; no MAC, the address derives from the ticket); BTP-DATA.request carries
security, beaconing; no MAC unless the 16-octet form names one, else the address derives from the ticket); BTP-DATA.request carries
`generated_at_ms` (requests older than 1 s are refused); request bodies up to 1536 and indications up
to 65535 octets are fragmented; logs travel as LOG frames (0x7F) on the USB link, so a XIAO needs no
UART adapter any more.