Rebuild obu-firmware on Niklas Dathe's microbu-firmware
Replace the vanetza-idf port with his current station firmware (microbu-firmware e4e4bd8: main/, components/microbu_v2x, components/vanetza, external/vanetza) and re-apply the MicrOBU additions, each marked "MicrOBU:" in the sources: - V2X_RX (opcode 0x90): every received ITS message, signed or not, through gn_unwrap.c, because the stack drops unsigned and foreign-root traffic. 0x85 is the spec's RAW_FRAME and 0x86 is reserved. The body is built in v2x_rx.hpp. - Unsigned transmission (geonet.c) for security profile 1 or station security 0, from a random MAC per configuration. - Radio polled from STATION_CONFIGURE on; manual country policy, TX power read-back, static RX buffer, short frames ignored. - Battery guard (battery_policy.hpp): deep sleep below 3.30 V with no phone on USB. - No USB writes without a host; last_frame_ms() for the guard. - 80 KB NVS with the app at 0x20000, 8 MB flash, XIAO ESP32-C5 board, 20 dBm. Remove the old C firmware, the bench listener and the old vanetza-idf copy. Add docs/station-link.tex as revision 2 of the interface reference (V2X_RX, unsigned sending, battery rule, revision history). Add 39 host unit tests (make firmware in test/host) next to the existing chain, replay, fuzz and battery tests, and point tools/station_status_watch.py at the new CONFIRM-based status.
This commit is contained in:
+87
-208
@@ -1,247 +1,126 @@
|
||||
# obu-firmware — setup & flashing notes
|
||||
# obu-firmware: build and flash
|
||||
|
||||
**Board (since 2026-10-05): Seeed XIAO ESP32-C5.** One USB-C port, which is the chip's native USB
|
||||
Serial/JTAG (VID/PID 0x303A/0x1001); no UART bridge, no second port. 8 MB flash (`esptool flash-id`),
|
||||
so `sdkconfig.defaults` sets `FLASHSIZE_8MB` (the earlier CH343 bench board had 16 MB). The same
|
||||
port flashes the board *and* carries the phone's station link, so the PC and the phone take turns on
|
||||
it. Pin map and what is wired: "Battery and pins" below. The sections that still say "UART-bridge
|
||||
port" or "COM3" describe the earlier two-port bench board.
|
||||
**Board: Seeed XIAO ESP32-C5.** One USB-C port, the chip's native USB Serial/JTAG (VID/PID
|
||||
0x303A/0x1001); no UART bridge. 8 MB flash. The same port flashes the board, carries the phone's
|
||||
station link and carries the log (as LOG frames, type 0x7F), so the PC and the phone take turns on
|
||||
it. Over BLE the phone does not need the cable.
|
||||
|
||||
## Two toolchains - use a dedicated terminal for each
|
||||
## Toolchain
|
||||
|
||||
Since 2026-09-23 this project builds against ESP-IDF **6.0.2** exactly
|
||||
(`C:\Espressif\frameworks\esp-idf-v6.0.2`): it is the vanetza-idf port (see
|
||||
NOTES.md), and vanetza-idf's `radio_c5.cmake` refuses any other version because
|
||||
the raw TX path pokes private Wi-Fi driver structures only validated there. The
|
||||
previous C firmware used the receiver firmware's IDF **6.1**; the separate
|
||||
`obu-cam-transmistter` project builds against the global ESP-IDF **5.5.4**.
|
||||
Exporting two of them in one PowerShell window fails: the second export
|
||||
inherits the first's `IDF_PYTHON_ENV_PATH` and reports every Python dependency
|
||||
as unmet. Don't run `install.bat` to "fix" that - open a fresh terminal, or
|
||||
clear the state with `$env:IDF_PYTHON_ENV_PATH = $null; $env:IDF_PATH = $null`.
|
||||
|
||||
The build is self-contained: the C-ITS library comes from
|
||||
`obu-firmware/external/vanetza-idf`, a copy of `external/vanetza-idf` from the
|
||||
colleague's microbu-esp32c5 repository (their commit cf4b99f, unchanged). Pass
|
||||
`-DVANETZA_IDF_DIR=<path>` to `idf.py` to build against another checkout. The
|
||||
first build downloads `espressif/esp-boost` into `managed_components/`.
|
||||
|
||||
Nothing is fetched from or pushed to the colleague's repository (HAW GitLab,
|
||||
urban-mobility-lab/microbu/microbu-esp32c5). To take a newer vanetza-idf from
|
||||
it, copy their `external/vanetza-idf` over this folder, rebuild and test, and
|
||||
commit it here. The rest of their tree (their own VAM firmware, PKI tooling,
|
||||
station-link Python tools, the V2X2MAP bridge) is not part of this repository.
|
||||
|
||||
## Every new PowerShell session
|
||||
ESP-IDF **6.0.2** exactly (`C:\Espressif\frameworks\esp-idf-v6.0.2`): `components/microbu_v2x`
|
||||
pins the C5 radio's private Wi-Fi driver ABI to it. Not the receiver firmware's 6.1, not
|
||||
`obu-cam-transmistter`'s 5.5.4. Exporting two IDFs in one PowerShell window fails; open a fresh
|
||||
window, or clear `$env:IDF_PYTHON_ENV_PATH` and `$env:IDF_PATH` first.
|
||||
|
||||
```powershell
|
||||
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
|
||||
$env:IDF_TOOLS_PATH = "C:\Espressif"
|
||||
C:\Espressif\frameworks\esp-idf-v6.0.2\export.ps1
|
||||
idf.py --version # v6.0.2
|
||||
```
|
||||
|
||||
## Build & flash
|
||||
|
||||
The XIAO flashes over its one USB-C port (COM10 on the bench; Device Manager → Ports shows it as
|
||||
"USB Serial Device"). esptool resets it into the bootloader by itself; no BOOT button is needed
|
||||
unless the running firmware has crashed the USB peripheral, then hold BOOT while plugging in.
|
||||
|
||||
```powershell
|
||||
cd C:\Users\Ashin\AndroidStudioProjects\MicrOBU\obu-firmware
|
||||
idf.py set-target esp32c5 # only needed once per clean build folder
|
||||
idf.py build
|
||||
idf.py -p COM10 -b 921600 flash
|
||||
idf.py set-target esp32c5 # once per clean build folder
|
||||
idf.py build # first build ~20 min; downloads espressif/esp-boost into managed_components/
|
||||
```
|
||||
|
||||
There is **no console on this port**: ESP_LOG stays on UART0 (GPIO11/GPIO12 = pads D6/D7), which a
|
||||
bare XIAO does not route to USB, and `idf.py monitor` would only see the link frames. To read the
|
||||
log, put a 3.3 V USB-UART adapter on D6 (TX) / D7 (RX), or set `CONFIG_MICROBU_LOG_OVER_LINK=y`
|
||||
(LOG frames of type 0x7F on the link; the Android app has not been checked against them). To read
|
||||
what the board says over the link, use `tools/station_status_watch.py COM10`.
|
||||
## Flash
|
||||
|
||||
The earlier two-port board flashed through its CH343 bridge port (COM3) with
|
||||
`idf.py -p COM3 -b 921600 flash monitor`; its console was on that port.
|
||||
Use `flash` (bootloader + partition table + app), not `app-flash`, whenever the
|
||||
partition table may differ from what the board has.
|
||||
|
||||
### First flash onto a board with the previous firmware
|
||||
|
||||
The partition table changed with the port (NVS 24 KB → 80 KB, app 0x10000 →
|
||||
0x20000), and the old NVS is full of Wi-Fi settings the previous firmware left
|
||||
behind. Erase the whole new NVS range once, then do a full flash:
|
||||
Use a full `flash` (bootloader + partition table + app), never `app-flash`: the partition table is
|
||||
not Niklas Dathe's (80 KB NVS, app at 0x20000).
|
||||
|
||||
```powershell
|
||||
python -m esptool --chip esp32c5 -p COM10 -b 921600 erase-region 0x9000 0x15000
|
||||
idf.py -p COM10 -b 921600 flash
|
||||
idf.py -p COM6 flash
|
||||
```
|
||||
|
||||
Without the erase, the board cannot store the BLE bond and the phone has to pair
|
||||
on every connection (2026-09-23). After it:
|
||||
**If the running firmware has taken the USB port down** (or the board holds an unrelated image),
|
||||
auto-reset fails with "No serial data received". Unplug, hold BOOT, plug in, release. If the flasher
|
||||
stub then fails to start (seen 2026-11-10 with esptool 5.4 on this board), flash without it, from
|
||||
`build/`:
|
||||
|
||||
- the boot log shows `0 bonded phone(s) in NVS`, `BLE advertising started as
|
||||
'micrOBU-XXXX'` and `station task ready`; the radio stays off until the app
|
||||
connects;
|
||||
- on the first Connect the app provisions the demo credentials once (the card
|
||||
says "Provisioning the demo credentials"); they stay in NVS from then on;
|
||||
- a phone that was paired with the board before must forget `micrOBU-XXXX` in
|
||||
Android's Bluetooth settings and pair again (passkey 123456).
|
||||
```powershell
|
||||
python -m esptool --chip esp32c5 -p COM6 --no-stub --before=no-reset --after=hard-reset write-flash "@flash_args"
|
||||
```
|
||||
|
||||
Erasing NVS later (e.g. after a partition change) has the same effects.
|
||||
A board left in download mode comes back after unplugging and replugging without BOOT.
|
||||
|
||||
## Going back to the previous firmware
|
||||
**Before flashing a board you did not flash yourself, read its app descriptor**
|
||||
(`esptool read-flash 0x10000 0x100`; `esp_app_desc_t` starts at 0x20): project name `microbu_firmware`
|
||||
is this firmware, `obu_firmware` an older MicrOBU one, `arduino-lib-builder` an Arduino sketch.
|
||||
Back the flash up first to `firmware-backups/` (gitignored).
|
||||
|
||||
The previous, unsigned C firmware (frame types 0x01-0x05, CAM over USB only)
|
||||
can come back two ways. The app detects it and falls back to its protocol.
|
||||
### First flash onto a board with other firmware
|
||||
|
||||
- **Image:** `firmware-backups/` in the repository root (gitignored, on the lab
|
||||
laptop only) holds a full-flash image of the COM3 board as it was before the
|
||||
port, with the esptool command in its README.txt. It restores the old
|
||||
partition table and NVS too.
|
||||
- **Source:** commit `7285fa1` is the last one before the port. Check it out in
|
||||
a separate worktree and build it with the receiver firmware's IDF 6.1
|
||||
(`its-g5-receiver-firmware\esp-idf\export.ps1`). Erase the NVS range as above
|
||||
first, then `flash` (full, since the partition table differs); erasing after
|
||||
flashing would wipe the start of the old app, which sits at 0x10000.
|
||||
Erase the NVS range once, so no old Wi-Fi or BLE data sits in the new 80 KB NVS:
|
||||
|
||||
## If the build fails
|
||||
```powershell
|
||||
python -m esptool --chip esp32c5 -p COM6 erase-region 0x9000 0x15000
|
||||
```
|
||||
|
||||
- **"includes X.h, provided by Y component(s)... not in the requirements
|
||||
list"** — IDF 5.x split the old monolithic `driver` component apart
|
||||
(`esp_driver_gpio`, `esp_driver_uart`, etc.). Add the named component to
|
||||
`REQUIRES` in `main/CMakeLists.txt` and rebuild. Already fixed once for
|
||||
`esp_driver_gpio` + `esp_driver_uart` — if a new header comes up, same fix.
|
||||
- Otherwise, start clean before re-building:
|
||||
```powershell
|
||||
idf.py fullclean
|
||||
idf.py build
|
||||
```
|
||||
Then: the boot log shows `BLE advertising started as 'micrOBU-XXXX'` and `station task ready`; the
|
||||
radio stays off until the app (or `tools/station_status_watch.py --configure`) sends
|
||||
STATION_CONFIGURE; the app provisions the demo credentials on the first Connect. A phone that was
|
||||
paired before must forget `micrOBU-XXXX` in Android's Bluetooth settings and pair again (passkey
|
||||
123456, `CONFIG_MICROBU_BLE_PASSKEY`).
|
||||
|
||||
## Connecting the phone (XIAO ESP32-C5)
|
||||
## Look at the board from the PC
|
||||
|
||||
The XIAO has a single USB-C port, the native USB Serial/JTAG one: the phone plugs into it via
|
||||
USB-OTG, the station link runs over it (below), and unplugging the phone and plugging the PC in
|
||||
is how it is flashed. Over BLE the phone does not need the cable at all (the board runs on its cell).
|
||||
```powershell
|
||||
py -3.11 tools/station_status_watch.py COM6 30 --configure --rx
|
||||
```
|
||||
|
||||
The rest of this section describes the earlier **ESP32-C5-WIFI6-KIT** bench board with two USB-C
|
||||
ports — use the right one:
|
||||
prints the log, the STATUS snapshot once a second (uptime, signing and radio counters, heap,
|
||||
battery) and the first V2X_RX messages heard on air. DTR/RTS stay low in the script because toggling
|
||||
them resets the board.
|
||||
|
||||
- **Native USB-C port** (labeled for JTAG/native USB, up to 12 Mbps) — this
|
||||
is where the phone plugs in via USB-OTG. The station link
|
||||
(`serial_link.cpp`: station-link messages as frame type 0x10 in the 0xAA55
|
||||
framing) runs over the ESP32-C5's native USB Serial/JTAG peripheral on this port, enumerating as a CDC-ACM device under Espressif's
|
||||
VID/PID (0x303A/0x1001).
|
||||
- **UART-bridge port** (labeled for flashing) — this is what you use for
|
||||
`idf.py flash monitor` from your PC. Leave the phone unplugged from this
|
||||
one; it only carries `idf.py`'s flashing protocol and the ESP_LOG console.
|
||||
## Production OBU checklist (board with the cell connected)
|
||||
|
||||
The app recognizes the ESP32-C5's VID/PID via a custom probe table in
|
||||
`UsbSerialTransport.kt` (the default `usb-serial-for-android` prober doesn't
|
||||
know Espressif's device IDs). If the phone doesn't detect anything when
|
||||
plugged into the native port, first confirm with a tool like "USB Device
|
||||
Info" (or `adb shell dumpsys usb` from a PC) that Android sees a USB device
|
||||
at all — that isolates a bad/charge-only OTG cable from an app-side issue.
|
||||
|
||||
## Bring-up checklist (phone <-> ESP32-C5 link)
|
||||
|
||||
Work down this list — each step isolates the layer below it.
|
||||
|
||||
1. **Flash and install together.** The app detects the firmware generation by
|
||||
its heartbeat and speaks either protocol, but only an app from 2026-09-23 on
|
||||
knows the station-link protocol; messages are at most 512 octets on both
|
||||
sides.
|
||||
2. **Does Android see the device at all?** Plug the phone into the **native**
|
||||
USB-C port, hit Connect, and read logcat for `UsbSerialTransport`. It logs
|
||||
every attached device *and* each device's interfaces. Empty list = cable /
|
||||
OTG / wrong port, below the app entirely.
|
||||
3. **Did the right interface get claimed?** The C5's USB Serial/JTAG is a
|
||||
composite device — expect CDC control (class 2) + CDC data (class 10) +
|
||||
vendor-specific JTAG (class 255) in that dump. Compare against the `ports=`
|
||||
count on the `matched device` line.
|
||||
4. **Is the link alive?** The firmware sends a STATUS at 1 Hz regardless of
|
||||
radio traffic, and the app marks the link ERROR after ~3.5 s of silence.
|
||||
Connected-and-staying-connected means device→host actually works. The board
|
||||
starts its radio only after the app's STATION_CONFIGURE, so nothing is
|
||||
received before Connect.
|
||||
5. **If it connects but no V2X_RX ever arrives** — suspect DTR. The app now
|
||||
asserts DTR/RTS on open (`openDevice()` in `UsbSerialTransport.kt`), because
|
||||
`CdcAcmSerialDriver` doesn't do it by default and the ESP32's USB Serial/JTAG
|
||||
endpoint may gate TX on the host opening the CDC line. **This is still
|
||||
unverified on real hardware** — test it both ways (with the `setDTR(true)`
|
||||
call and with it commented out) and record the answer in `serial_link.h`
|
||||
next to the VID/PID note, so nobody has to guess again.
|
||||
6. **Watch the counters, not just "Sent: N".** The CAM Pinger card shows
|
||||
consecutive write failures (phone side) and the firmware's tx-failure /
|
||||
RX-queue-drop / CRC-error totals from the heartbeat; the connection card
|
||||
shows tickets, signed and refused counts. A rising `tx fail` means messages
|
||||
reach the ESP32 but the radio refuses them — a radio problem, not a link
|
||||
problem. A rising `refused` with signing on usually means no ticket (NVS
|
||||
erased: reconnect so the app provisions again).
|
||||
|
||||
## Connecting over Bluetooth instead
|
||||
|
||||
Settings > Connection > ESP32-C5 > link: Bluetooth, then Connect. The board
|
||||
advertises as `micrOBU-XXXX` (last two bytes of its BT MAC; `micrOBU-4AFA` on
|
||||
COM3), but only while nothing uses its native USB port. Android asks to pair
|
||||
the first time: passkey **123456** (fixed in `simple_ble.cpp`). The bond is kept
|
||||
on both sides; the board keeps one bond, so pairing a second phone or a PC
|
||||
replaces the first. Log lines on the console start with `cits_ble:`.
|
||||
1. **Before touching the board:** read its app descriptor and back its flash up (see above). Check the
|
||||
cell polarity with a multimeter before it goes on the BAT pads; the slide switch can stay off while
|
||||
flashing, USB powers the board.
|
||||
2. Erase the NVS range, then a full `idf.py -p COMx flash` (or the `--no-stub` recipe if the stub
|
||||
fails). Unplug and replug the cable **without** BOOT afterwards.
|
||||
3. `py -3.11 tools/station_status_watch.py COMx 20 --configure --rx`: expect `BLE advertising started as
|
||||
'micrOBU-XXXX'`, a STATUS line every second, `configured=1` after the configure, and `battery=` close
|
||||
to the multimeter reading on the cell. The firmware has no calibration trim any more: if the two differ
|
||||
by more than about 50 mV, note both values (a `CONFIG_MICROBU_BATTERY_SCALE_PERMILLE` option of the
|
||||
earlier port can be added back).
|
||||
4. Switch the cell on, unplug USB, check the board keeps running (LED pulses on RX, the phone connects
|
||||
over BLE). Then work down `TODO.md` ("obu-firmware on Niklas Dathe's microbu-firmware").
|
||||
5. **Know the shutdown rule before leaving it unattended:** with the cell below 3.30 V, no phone on USB
|
||||
and more than 60 s after boot, the board deep-sleeps and only wakes every 5 minutes to check; it runs
|
||||
again from 3.60 V (charge it over USB). A board that "went dead" on a flat cell is this, not a crash.
|
||||
6. Install the app built from this commit on the phone: the app and firmware of 2026-11-10 only talk
|
||||
to each other (CONFIRM/STATUS_REQUEST, V2X_RX 0x90). The phone must forget an old `micrOBU-XXXX`
|
||||
bond and pair again (passkey 123456), because the NVS was erased.
|
||||
|
||||
## Battery and pins (XIAO ESP32-C5)
|
||||
|
||||
The prototype runs on the 3.7 V LiPo of an Intenso XS5000 power bank (5000 mAh), on the XIAO's BAT
|
||||
pads: cell `+` through a slide switch to **BAT+**, cell `−` to **BAT−**. The board's SGM40567 charger
|
||||
charges it from USB (the phone, or the PC). Check the polarity with a multimeter before connecting:
|
||||
reversed, the cell destroys the board. **The cell has no protection board** (the power bank's own
|
||||
circuit board did that job), so nothing but the firmware stops an over-discharge, and nothing at all
|
||||
stops a short.
|
||||
The prototype runs on a 3.7 V LiPo on the BAT pads (cell `+` through a slide switch to **BAT+**,
|
||||
`−` to **BAT−**); the board's charger charges it from USB. Check the polarity with a multimeter
|
||||
first: reversed, it destroys the board. **The cell has no protection board**, so only the firmware
|
||||
stops an over-discharge, and nothing stops a short.
|
||||
|
||||
| Pin | GPIO | Used for |
|
||||
|---|---|---|
|
||||
| (back pad) | GPIO6 | `BAT_VOLT_PIN`: the cell through two 100 kΩ resistors (ADC1) |
|
||||
| (back pad) | GPIO26 | `BAT_VOLT_PIN_EN`: load switch that powers that divider, high only while measuring |
|
||||
| D6 / D7 | GPIO11 / GPIO12 | UART0 (console) |
|
||||
| native USB | GPIO13 / GPIO14 | USB D− / D+ (the phone link) |
|
||||
| — | GPIO27 | the yellow user LED, active low; `CONFIG_MICROBU_TX_LED_GPIO=27` turns the activity LED on |
|
||||
| on-board | GPIO6 | `BAT_VOLT_PIN`: BAT+ through the board's own 100 kΩ / 100 kΩ divider (ADC1); nothing to wire |
|
||||
| on-board | GPIO26 | `BAT_VOLT_PIN_EN`: load switch for that divider, high only while measuring; nothing to wire |
|
||||
| native USB | GPIO13 / GPIO14 | USB D− / D+ |
|
||||
| (user LED) | GPIO27 | yellow LED, active low: pulses on TX/RX (`CONFIG_MICROBU_STATUS_LED`) |
|
||||
|
||||
(Pin names from Seeed's XIAO ESP32-C5 wiki; GPIO13/14 and the LED are the chip's defaults, not
|
||||
re-checked against the schematic.) The cell's two extra wires (temperature / ID) are not used.
|
||||
Only the cell's `+` and `−` go to the BAT pads; the cell's two extra wires (temperature / ID) stay unconnected, the firmware does not use them. The voltage measurement needs no further wiring. `BatteryMonitor` (`battery_monitor.cpp`) reports the calibrated cell voltage as `battery_mv` in
|
||||
STATUS (octets 129-130, 0 = no cell or no sensor). `BatteryPolicy` (`battery_policy.hpp`, host-tested
|
||||
in `test/host`) adds the protection, every 5 s: the smoothed voltage below 3.30 V for 30 s, more than
|
||||
60 s after boot and with **no frame from a phone on USB in the last 5 s**, puts the board into deep
|
||||
sleep; it wakes every 300 s, measures, and runs again from 3.60 V. A phone on USB powers the board,
|
||||
so no shutdown happens then. Thresholds: `menuconfig -> micrOBU firmware`. The app shows
|
||||
low/critical from the same voltage and its own thresholds.
|
||||
|
||||
What the firmware does with it (`battery.cpp`, `battery_monitor.hpp`):
|
||||
## If the build fails
|
||||
|
||||
- Every 5 s it enables the divider, takes the median of 16 samples, disables it, and smooths the
|
||||
result. The cell voltage (twice the pin voltage) goes into the STATUS message the board sends
|
||||
every second over USB and BLE: `battery_mv` u16 at octet 103 (0: no cell or no sensor) and
|
||||
`battery_flags` u8 at 105 (bit 0 low, bit 1 critical). STATUS grew from 103 to 106 octets; the
|
||||
app and the firmware both accept 103 (older board) or 106 and more. The colleague's Python
|
||||
`Status.decode` requires exactly 103, so their `phone_emulator` rejects this board's STATUS.
|
||||
- **Low** below 3.50 V (cleared at 3.60 V): the app shows an amber battery icon in the top bar and a
|
||||
warning on the ESP32-C5 card. **Critical** below 3.30 V: red.
|
||||
- **Shutdown:** when the smoothed voltage has stayed below 3.30 V for 30 s (6 samples), more than
|
||||
60 s after boot, and **no phone has sent a frame over USB in the last 10 s**, the board sends a
|
||||
last STATUS with the critical flag and goes into deep sleep. A phone on USB powers the board, so
|
||||
the cell is not the reason it would stop and no shutdown happens. In deep sleep the board wakes
|
||||
every 300 s, measures, and sleeps again until the cell reads 3.60 V (charged over USB); a reset
|
||||
or power-cycle starts it normally and the rule applies again.
|
||||
- The battery percentage in the app is a LiPo open-circuit-voltage table (`StationStatus.lipoPercent`):
|
||||
an indicator, not a fuel gauge. It sags under TX and rises while charging.
|
||||
`idf.py fullclean`, then build again. A "provided by component(s) ... not in the requirements list"
|
||||
error means a header moved to another IDF component: add it to `REQUIRES` in `main/CMakeLists.txt`.
|
||||
|
||||
All thresholds are `CONFIG_MICROBU_BATTERY_*` in `main/Kconfig.projbuild`. If the app's voltage
|
||||
differs from a multimeter on the cell, set `CONFIG_MICROBU_BATTERY_SCALE_PERMILLE` to
|
||||
1000 × multimeter ÷ reading. Check it with `py -3.11 tools/station_status_watch.py COM10`: it
|
||||
requests STATUS once a second and prints the battery fields.
|
||||
## Going back
|
||||
|
||||
Not measured yet: the charge current of the XIAO's charger (the wiki does not give it; a 5000 mAh
|
||||
cell on a trickle charge takes days), whether the ADC reading is disturbed while the radio is
|
||||
transmitting, and the board's own idle current from the cell. See TODO.md.
|
||||
|
||||
## Notes
|
||||
|
||||
- No `git submodule update` needed here — obu-firmware has no pinned
|
||||
submodule of its own, unlike its-g5-receiver-firmware.
|
||||
- Don't use the global "ESP-IDF 5.5 PowerShell" shortcut or the receiver
|
||||
firmware's 6.1 checkout — export from `esp-idf-v6.0.2`, the version the
|
||||
vanetza-idf radio's undocumented driver internals were verified against.
|
||||
- The console (ESP_LOG, boot messages, panics) stays on the UART-bridge port.
|
||||
Opening it resets the board; do that only while nothing else depends on the
|
||||
session.
|
||||
`firmware-backups/` (gitignored, on the lab laptop) holds full or 4 MB images of the boards as they
|
||||
were before they were reflashed. Restore with
|
||||
`python -m esptool --chip esp32c5 -p COM<N> write-flash 0 <image>`. The previous C firmware is in
|
||||
git history (last commit before the port: `7285fa1`; the vanetza-idf port: `1c3a66e`).
|
||||
|
||||
Reference in New Issue
Block a user