Files
MicrOBU/obu-firmware/main/Kconfig.projbuild
T
Ashin Walpola fc3354a4ba Forward MAPEM and VAM from the ESP32-C5, and add a bench listener
gn_unwrap.c now passes BTP ports 2003 (MAPEM) and 2018 (VAM), signed or
not, besides CAM, DENM and SPATEM. A message over 494 bytes still does not
fit one 512-octet link message (also the largest GATT value) and is dropped
and counted, not fragmented. The bench RSU's MAPEM is 295 bytes.

CONFIG_MICROBU_BENCH_LISTEN (off in sdkconfig) is for a board whose only PC
connection is the UART0 console: it configures itself receive-only at boot
and logs every V2X_RX message; tools/bench_listen_watch.py tallies the log.
On air on 2026-10-28 it forwarded 104 MAPEM, 185 SPATEM and 472 CAM in
90 s, with nothing oversize. The RSU sent all of them unsigned.

Host tests: signed GeoBroadcast SPATEM/MAPEM frames of 58 to 1243 bytes
with every truncation length; the replay cuts frames at c5_radio.cpp's
2346 bytes (not the old C firmware's 800) and checks MAPEMs with asn1tools.
2026-10-28 16:48:37 +01:00

90 lines
4.0 KiB
Plaintext

menu "micrOBU firmware"
config MICROBU_TEST_CHANNEL
bool "Test channel on the serial link (software lower tester, ETSI campaign hooks)"
default y
help
Serves serial frame type 0x11: mirror or divert every AL_DATA.request the stack
makes to the tester, inject AL_DATA.indication, GN-DATA.request for the
Security ATS. Not part of the phone interface; disable for a production image.
config MICROBU_LOG_OVER_LINK
bool "Also carry ESP_LOG output as LOG frames (0x7F) on the native USB link"
default n
help
The colleague's single-port board has no other place for its log. This board keeps
the console on UART0 (the CH343 bridge port), so the phone's link carries no text.
config MICROBU_BLE_USB_IDLE_MS
int "USB link idle time before BLE advertising resumes (ms)"
range 1000 60000
default 3000
help
BLE and the 5.9 GHz radio share the C5's single RF front end. While the phone is
using the USB link (any frame received within this window), BLE advertising is
stopped so it cannot take airtime from ITS-G5. An existing BLE connection is left
alone. The phone sends a PoTi update with every GNSS fix, which keeps the window
open for as long as it is connected over USB.
config MICROBU_TX_LED_GPIO
int "Active-low activity LED GPIO (-1: none)"
range -1 28
default -1
help
The colleague's XIAO ESP32-C5 has its yellow user LED on GPIO27. On this project's
board GPIO27 is not a plain LED, so the indicator is off unless configured.
config MICROBU_TX_LED_BLINK_MS
int "LED indication pulse (ms)"
range 10 2000
default 100
config MICROBU_LED_INVERTED_RX
bool "Inverted LED mode for receiver/bridge (normally ON, blink OFF on packet)"
default n
config MICROBU_BENCH_LISTEN
bool "Bench listener: receive from boot and log every V2X_RX on the console"
default n
help
For a test board whose PC connection is only the UART0 console (no phone, no USB
Serial/JTAG link): the station configures itself at boot with the radio receive only and
security off, and logs one line per ITS message the raw path (gn_unwrap.c) unwraps: BTP
port, messageID, length, RSSI, signed, GeoBroadcast, and whether it fits a link message.
A phone that configures the station later replaces this configuration. Never enable it in
the production image.
config MICROBU_BATTERY_ADC_GPIO
int "Battery voltage ADC GPIO (-1: no battery monitoring)"
range -1 6
default 6
help
The XIAO ESP32-C5 reads its battery on GPIO6 (BAT_VOLT_PIN) through two 100 k resistors.
config MICROBU_BATTERY_EN_GPIO
int "Battery divider enable GPIO"
range 0 28
default 26
help
XIAO ESP32-C5: GPIO26 (BAT_VOLT_PIN_EN) switches the divider on for the reading.
config MICROBU_BATTERY_SCALE_PERMILLE
int "Battery reading trim (1000 = none)"
range 800 1200
default 1000
help
Multiplies the reading. Compare the STATUS battery voltage with a multimeter on the cell
and set this to 1000 * multimeter / reading if the divider or ADC is off.
config MICROBU_BATTERY_WARN_MV
int "Low-battery warning below this cell voltage (mV)"
range 3000 4200
default 3500
config MICROBU_BATTERY_SHUTDOWN_MV
int "Shutdown below this cell voltage (mV), see battery_monitor.hpp"
range 3000 4200
default 3300
help
There is no protection board on the prototype cell, so this is the only guard against
over-discharge. The board shuts down (deep sleep) once the smoothed voltage has stayed below
this for 30 s and no phone is talking over USB; it checks the cell again every
MICROBU_BATTERY_SLEEP_S and runs again from 3600 mV.
config MICROBU_BATTERY_RESUME_MV
int "After a shutdown, run again at or above this cell voltage (mV)"
range 3300 4200
default 3600
config MICROBU_BATTERY_SLEEP_S
int "Seconds between cell checks while shut down"
range 30 3600
default 300
endmenu