Files
ruvnet--RuView/firmware/esp32-csi-node/sdkconfig.defaults.4mb
ruv 56a6562e12 fix(firmware): v0.6.4-esp32 — Tmr Svc 16 KiB stack + version drift fix (#505)
Two bugs in the v0.6.3-esp32 release, both reported in #505:

1. **4 MB binary boot-loops with Tmr Svc stack overflow.** The
   adaptive_controller fast loop runs emit_feature_state() (lwIP
   sendto via stream_sender) AND apply_decision() (which can call
   rv_mesh_send_anomaly — another sendto) inside the FreeRTOS Timer
   Svc callback. The previous fix (a426ae386) bumped from the 2 KiB
   IDF default to 8 KiB; that absorbs the steady-state fast tick but
   not the worst case where a state transition fires the anomaly
   emit on top of an already-stacked feature_state emit. Bump to
   16 KiB across both sdkconfig.defaults.template (8 MB build) and
   sdkconfig.defaults.4mb so the two release variants stay in sync.

2. **All v0.6.3 binaries reported `App version: 0.6.2`.** version.txt
   was never bumped at the v0.6.3-esp32 tag. CMake reads version.txt
   into project(VERSION ...) which feeds esp_app_get_description()->
   version. Bump to 0.6.4 to match the new release tag.

Verified on ESP32-S3 (COM8, MAC d0:cf:13:44:01:84):
- 4 MB build flashed clean, 853 KiB binary, 54 % flash free
- Boot banner now reports `App version: 0.6.4`
- 70 s soak, 71 medium ticks, 0 stack overflow, 0 reboots
- 5 Hz feature_state emit confirmed (seq=299 at ~60 s)
- CSI capture active throughout (motion=1.00, presence=4-20)

Closes #505.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-05-07 13:14:15 -04:00

36 lines
1.2 KiB
Plaintext

# ESP32-S3 CSI Node — 4MB Flash SDK Configuration (issue #265)
# For boards with 4MB flash (e.g. ESP32-S3 SuperMini 4MB).
#
# Build: cp sdkconfig.defaults.4mb sdkconfig.defaults && idf.py set-target esp32s3 && idf.py build
# Or: idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults.4mb" set-target esp32s3 && idf.py build
CONFIG_IDF_TARGET="esp32s3"
# 4MB flash partition table
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_4mb.csv"
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
# Compiler: optimize for size (critical for 4MB)
CONFIG_COMPILER_OPTIMIZATION_SIZE=y
# CSI support
CONFIG_ESP_WIFI_CSI_ENABLED=y
# Disable display support to save flash (ADR-045 display requires 8MB)
# CONFIG_DISPLAY_ENABLE is not set
# Reduce logging to save flash
CONFIG_BOOTLOADER_LOG_LEVEL_WARN=y
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
CONFIG_LWIP_SO_RCVBUF=y
CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192
# ADR-081: adaptive_controller runs emit_feature_state + stream_sender
# network I/O inside Timer Svc callbacks. 8 KiB was insufficient under
# lwIP sendto + state-transition rv_mesh anomaly emit (issue #505 4MB
# reset loop on Tmr Svc); 16 KiB absorbs the worst-case path.
CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=16384