Skip to content

Commit b5e924c

Browse files
committed
fix: embed firmware version from version.txt, log at boot (#354)
- Add version.txt (0.6.0) read by CMakeLists.txt so esp_app_get_description()->version matches the release tag - Log firmware version on boot: "v0.6.0 — Node ID: X" - Remove stale Kconfig help text (said default 2.0, actual is 15.0) Fixes the version mismatch reported in #354 where flashing v0.5.3 binaries showed v0.4.3 because PROJECT_VER was never set. Co-Authored-By: claude-flow <ruv@ruv.net>
1 parent 8543422 commit b5e924c

4 files changed

Lines changed: 11 additions & 3 deletions

File tree

firmware/esp32-csi-node/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,10 @@ cmake_minimum_required(VERSION 3.16)
44

55
set(EXTRA_COMPONENT_DIRS "")
66

7+
# Read firmware version from version.txt so esp_app_get_description()->version
8+
# matches the release tag. Fixes issue #354 (version mismatch after flashing).
9+
file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/version.txt" PROJECT_VER LIMIT_COUNT 1)
10+
string(STRIP "${PROJECT_VER}" PROJECT_VER)
11+
712
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
8-
project(esp32-csi-node)
13+
project(esp32-csi-node VERSION ${PROJECT_VER})

firmware/esp32-csi-node/main/Kconfig.projbuild

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ menu "Edge Intelligence (ADR-039)"
7676
Raise to reduce false positives in high-traffic environments.
7777
Normal walking produces accelerations of 2-5 rad/s².
7878
Stored as integer; divided by 1000 at runtime.
79-
Default 2000 = 2.0 rad/s^2.
8079

8180
config EDGE_POWER_DUTY
8281
int "Power duty cycle percentage"

firmware/esp32-csi-node/main/main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "esp_event.h"
1717
#include "esp_log.h"
1818
#include "nvs_flash.h"
19+
#include "esp_app_desc.h"
1920
#include "sdkconfig.h"
2021

2122
#include "csi_collector.h"
@@ -137,7 +138,9 @@ void app_main(void)
137138
/* Load runtime config (NVS overrides Kconfig defaults) */
138139
nvs_config_load(&g_nvs_config);
139140

140-
ESP_LOGI(TAG, "ESP32-S3 CSI Node (ADR-018) — Node ID: %d", g_nvs_config.node_id);
141+
const esp_app_desc_t *app_desc = esp_app_get_description();
142+
ESP_LOGI(TAG, "ESP32-S3 CSI Node (ADR-018) — v%s — Node ID: %d",
143+
app_desc->version, g_nvs_config.node_id);
141144

142145
/* Initialize WiFi STA (skip entirely under QEMU mock — no RF hardware) */
143146
#ifndef CONFIG_CSI_MOCK_SKIP_WIFI_CONNECT
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.6.0

0 commit comments

Comments
 (0)