mirror of
https://github.com/ruvnet/RuView
synced 2026-07-28 18:21:42 +00:00
f23e34ee5c
`firmware/esp32-csi-node` now builds for both `esp32s3` (existing
production) and `esp32c6` (new research / battery-seed target) from
the same source tree. ESP-IDF auto-applies `sdkconfig.defaults.esp32c6`
when the target is set to esp32c6; every C6 module is gated on
CONFIG_IDF_TARGET_ESP32C6 (or the SOC_WIFI_HE_SUPPORT capability) so
the S3 build path is byte-identical to today.
New modules (all #ifdef-gated, no-op stubs on S3):
- c6_twt.{h,c} — iTWT wrapper, graceful AP-NACK fallback
- c6_timesync.{h,c} — 802.15.4 beacon-based mesh time-sync, EUI-64
leader election, c6_timesync_get_epoch_us()
- c6_lp_core.{h,c} — wake-on-motion deep-sleep helper (ext1 path
this cut; real LP-core polling deferred)
ADR-018 frame extension:
- byte 18: PPDU type (0=HT/legacy, 1=HE-SU, 2=HE-MU, 3=HE-TB)
- byte 19: bandwidth + STBC + 802.15.4-sync-valid flags
- Magic 0xC5110001 unchanged — backwards compatible
- Dual-branch encoding handles both struct variants of
wifi_pkt_rx_ctrl_t (legacy S3 / HE C6) per CONFIG_SOC_WIFI_HE_SUPPORT
Critical bug fixed during live witness collection (verified across 3
boards on COM6/COM9/COM12):
- c6_timesync.c read MAC into a 6-byte buffer and ran MAC-48->EUI-64
conversion. But esp_read_mac(ESP_MAC_IEEE802154) returns 8 bytes
already in EUI-64 form on C6 — code was double-inserting FFFE.
Boot log was 206ef1fffefffe17, fix yields 206ef1fffe17278c which
matches esptool's eFuse reading exactly.
Tooling:
- CI workflow (firmware-ci.yml) extended with c6-4mb matrix row +
ADR-110 host-unit-test step
- Host unit tests for pure functions (mac48_to_eui64,
eui64_bytes_to_u64, PPDU encoding both branches) — runs on Ubuntu CI
- Multi-board live-capture harness (test/capture-3board-experiment.py)
- Witness bundle script records SHA-256s for s3-adr110, c6-adr110, and
s3-fair-adr110 (apples-to-apples) binary archives
Honest empirical findings (full report in docs/WITNESS-LOG-110.md):
- Verified live on 3 C6 boards: boot, 802.15.4 init w/ correct EUIs,
WiFi STA reaching assoc->run on ruv.net, TWT setup attempted +
gracefully NACKed (AP is 11n-only, TWT Responder:0), HE-MAC firmware
loaded
- NOT verified (need 11ax AP / second-channel exp / INA meter):
HE-LTF subcarrier expansion, TWT cadence determinism, ±100 µs sync
alignment, 5 µA hibernation
- Bug found: leader election doesn't step down under live WiFi load —
likely 2.4 GHz radio coex preemption (WiFi ch 5 vs 15.4 ch 15);
follow-up task #30
- Apples-to-apples size: S3-no-display = 886 KB, C6 = 1003 KB
(C6 is 13% LARGER for equivalent CSI features; the extra is the
802.15.4 + OpenThread stack that S3 lacks)
Tracking: ruvnet/RuView#762
Co-Authored-By: claude-flow <ruv@ruv.net>
66 lines
1.7 KiB
CMake
66 lines
1.7 KiB
CMake
set(SRCS
|
|
"main.c" "csi_collector.c" "stream_sender.c" "nvs_config.c"
|
|
"edge_processing.c" "ota_update.c" "power_mgmt.c"
|
|
"wasm_runtime.c" "wasm_upload.c" "rvf_parser.c"
|
|
"mmwave_sensor.c"
|
|
"swarm_bridge.c"
|
|
# ADR-081 — adaptive CSI mesh firmware kernel
|
|
"rv_radio_ops_esp32.c"
|
|
"rv_feature_state.c"
|
|
"rv_mesh.c"
|
|
"adaptive_controller.c"
|
|
# ADR-110 — ESP32-C6 capability modules (no-op stubs on other targets via #ifdef)
|
|
"c6_twt.c"
|
|
"c6_timesync.c"
|
|
"c6_lp_core.c"
|
|
)
|
|
|
|
# ESP-IDF v6+: headers must resolve via explicit REQUIRES (no implicit deps).
|
|
set(REQUIRES
|
|
esp_wifi
|
|
esp_netif
|
|
esp_event
|
|
nvs_flash
|
|
app_update
|
|
esp_http_server
|
|
esp_http_client
|
|
esp_app_format
|
|
esp_timer
|
|
esp_pm
|
|
esp_driver_uart
|
|
esp_driver_gpio
|
|
esp_driver_spi
|
|
esp_driver_i2c
|
|
driver
|
|
lwip
|
|
mbedtls
|
|
)
|
|
|
|
# ADR-110: C6-only components — pulled in when building for esp32c6.
|
|
# Note: CONFIG_* symbols are not available in main CMakeLists.txt evaluation —
|
|
# we use the IDF_TARGET variable that idf.py sets from sdkconfig.defaults / set-target.
|
|
if(IDF_TARGET STREQUAL "esp32c6")
|
|
list(APPEND REQUIRES ieee802154 ulp esp_hw_support)
|
|
endif()
|
|
|
|
# ADR-061: Mock CSI generator for QEMU testing + ADR-081 mock radio binding
|
|
if(CONFIG_CSI_MOCK_ENABLED)
|
|
list(APPEND SRCS "mock_csi.c" "rv_radio_ops_mock.c")
|
|
endif()
|
|
|
|
# ADR-045: AMOLED display support (compile-time optional)
|
|
if(CONFIG_DISPLAY_ENABLE)
|
|
list(APPEND SRCS "display_hal.c" "display_ui.c" "display_task.c")
|
|
list(APPEND REQUIRES esp_lcd esp_lcd_touch lvgl)
|
|
endif()
|
|
|
|
if(CONFIG_WASM_ENABLE)
|
|
list(APPEND REQUIRES wasm3)
|
|
endif()
|
|
|
|
idf_component_register(
|
|
SRCS ${SRCS}
|
|
INCLUDE_DIRS "."
|
|
REQUIRES ${REQUIRES}
|
|
)
|