tools: esp32 move OS functions to flash from IRAM when wifi logging on
What changed, and why it matters
This commit changes a build configuration script for the ESP32 version of Blockstream Jade. When Wi-Fi logging is enabled, the script now places some FreeRTOS operating system functions into flash memory instead of fast internal RAM (IRAM). The stated reason is to free up IRAM space so the firmware can compile. This is a build tooling change to avoid a linker memory overflow, not a fix for an exploitable security vulnerability.
No security action required. Treat as a normal build/maintenance change. If reviewing, verify that placing FreeRTOS functions in flash does not meaningfully affect timing or reliability requirements for the Jade hardware wallet on ESP32, but this is a product quality rather than security concern.
Security signals we found
No security-relevant code change identified
Build configuration adjustment to resolve memory layout issue
No input validation, privilege, cryptographic, or network changes
Evidence from the diff
The patch modifies tools/switch_to.sh so that when LOG=wifi and ARCH=esp32, it sets CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y. This is an ESP-IDF Kconfig option that moves certain FreeRTOS functions from IRAM to flash. The commit message and inline comment explicitly state the purpose: avoid running out of IRAM when Wi-Fi logging is enabled. There is no code change to runtime behavior beyond a different memory placement selected at build time, and no security boundary is crossed.
Changed components
tools/switch_to.shESP32 build configuration when Wi-Fi logging is enabledInspect captured patch +4 / −0
diff --git a/tools/switch_to.sh b/tools/switch_to.sh
index cdeba65..4fe03df 100755
--- a/tools/switch_to.sh
+++ b/tools/switch_to.sh
@@ -223,6 +223,10 @@ elif [ "$LOG" = "wifi" ]; then
read -r -p "Enter socket server PORT [8888]: " PORT
set_config CONFIG_WIFI_LOGGER_PORT ${PORT:-8888}
LOG="uart" # Enable UART logging below
+ if [ $ARCH = "esp32" ]; then
+ # On ESP32 we run out of IRAM with WIFI logging enabled
+ set_config CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH y
+ fi
fi
if [ "$LOG" = "uart" ]; then
echo "updating config file for UART logging ..."
Why this scored 18/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.