Files
MicrOBU/obu-firmware/main/CMakeLists.txt
T
Ashin Walpola 9f77f9f0e4 Monitor the XIAO's battery and make the XIAO the production board
The production OBU is now a Seeed XIAO ESP32-C5 (8 MB flash, one native
USB-C port) on a LiPo with no protection board. The firmware reads the
cell on GPIO6 (divider switched by GPIO26) every 5 s, sends it in STATUS
(battery_mv and battery_flags, octets 103-105; decoders accept 103 or
>= 106 octets), warns below 3.50 V and deep-sleeps below 3.30 V when no
phone is on USB, waking every 5 min to check the cell again. Thresholds
are in Kconfig; host test `make battery`.

The app shows voltage, a rough percentage and the low/critical state on
the ESP32-C5 card and in the top bar. With several bonded micrOBUs (a
replaced board stays bonded), the BLE link tries the one that last
connected first and moves on to the next after each failure.

tools/station_status_watch.py reads STATUS from the native port.
2026-10-28 16:48:18 +01:00

23 lines
1.7 KiB
CMake

# C++ station (from microbu-esp32c5/firmware/main) plus the C files of the previous firmware that
# still do a job here:
# gn_unwrap.c - raw receive path: 802.11/LLC-SNAP/GeoNetworking/BTP-B down to the ITS payload,
# for every frame on air, signed or not (station.cpp, forward_raw).
# geonet.c - unsigned transmit path: GN SHB + BTP-B exactly as the previous firmware built it
# (station.cpp, unsecured_request).
#
# Left on disk and NOT built, like cam.c before them:
# main.c, serial_link.c/.h - the previous firmware's entry point and phone link (frame types
# 0x01-0x05). Superseded by app_main.cpp and the station-link protocol.
# dot11p.c/.h - previous 802.11 framing; c5_radio.cpp frames through vanetza-idf now.
# Still compiled by the host tests in test/host.
# tx_custom.c/.h - previous copy of the OpenTrafficMap raw TX; otm_tx_custom.c replaces it.
# denm.c/.h, cam.c/.h, wifi_patches.c - reference only, as before.
idf_component_register(SRCS "app_main.cpp" "board_controls.cpp" "battery.cpp" "simple_ble.cpp" "c5_radio.cpp" "otm_tx_custom.c"
"link_protocol.cpp" "serial_link.cpp" "station.cpp" "station_test.cpp"
"link_service.cpp" "test_channel.cpp"
"gn_unwrap.c" "geonet.c"
INCLUDE_DIRS "."
LDFRAGMENTS "linker.lf"
REQUIRES vanetza-idf esp_wifi esp_phy esp_event bt esp_driver_gpio esp_adc esp_driver_usb_serial_jtag nvs_flash esp_timer)
target_compile_features(${COMPONENT_LIB} PRIVATE cxx_std_17)