mirror of
https://github.com/torlando-tech/pyxis.git
synced 2026-03-30 13:45:38 +00:00
Carve 64KB from SPIFFS for a coredump partition at 0x7F0000. On any crash (panic, WDT, assert), the ESP32 writes CPU state and backtrace to flash, readable on next boot with espcoredump. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
96 lines
3.6 KiB
Plaintext
96 lines
3.6 KiB
Plaintext
# Required for Arduino framework
|
|
CONFIG_FREERTOS_HZ=1000
|
|
|
|
# Flash configuration for 8MB
|
|
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y
|
|
CONFIG_PARTITION_TABLE_CUSTOM=y
|
|
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|
|
|
# Enable Bluetooth with NimBLE (uses ~100KB less RAM than Bluedroid)
|
|
CONFIG_BT_ENABLED=y
|
|
CONFIG_BT_NIMBLE_ENABLED=y
|
|
CONFIG_BT_BLUEDROID_ENABLED=n
|
|
|
|
# NimBLE role configuration - enable both central and peripheral for mesh
|
|
CONFIG_BT_NIMBLE_ROLE_CENTRAL=y
|
|
CONFIG_BT_NIMBLE_ROLE_PERIPHERAL=y
|
|
CONFIG_BT_NIMBLE_ROLE_BROADCASTER=y
|
|
CONFIG_BT_NIMBLE_ROLE_OBSERVER=y
|
|
|
|
# NimBLE connection settings
|
|
CONFIG_BT_NIMBLE_MAX_CONNECTIONS=3
|
|
CONFIG_BT_NIMBLE_MAX_BONDS=10
|
|
|
|
# NimBLE GATT settings
|
|
CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU=517
|
|
CONFIG_BT_NIMBLE_GAP_DEVICE_NAME_MAX_LEN=31
|
|
|
|
# Increase task stack size for stability
|
|
CONFIG_BT_NIMBLE_TASK_STACK_SIZE=8192
|
|
|
|
# Coexistence with WiFi
|
|
CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE=y
|
|
|
|
# Enable C++ exceptions (required for microReticulum)
|
|
CONFIG_COMPILER_CXX_EXCEPTIONS=y
|
|
CONFIG_COMPILER_CXX_EXCEPTIONS_EMG_POOL_SIZE=0
|
|
|
|
# Enable PSRAM (8MB external RAM) for zero heap fragmentation
|
|
CONFIG_ESP32S3_SPIRAM_SUPPORT=y
|
|
CONFIG_SPIRAM=y
|
|
CONFIG_SPIRAM_MODE_OCT=y
|
|
CONFIG_SPIRAM_SPEED_80M=y
|
|
|
|
# Configure malloc to use PSRAM
|
|
CONFIG_SPIRAM_USE_MALLOC=y
|
|
# Allocations smaller than this go to internal RAM (bytes)
|
|
# Lowered from 4096 to 64 to move Bytes allocations (16-200 bytes) to PSRAM
|
|
# This reduces internal heap fragmentation at cost of slightly slower access
|
|
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=64
|
|
# Reserve this much internal RAM for DMA/ISR (bytes)
|
|
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768
|
|
|
|
# ============================================================================
|
|
# Boot Time Optimizations
|
|
# These settings reduce boot time. See BOOT_OPTIMIZATIONS.md for details.
|
|
# ============================================================================
|
|
|
|
# Disable PSRAM memory test at boot (~2 seconds saved for 8MB PSRAM)
|
|
# The memory test verifies PSRAM integrity but is redundant for stable hardware.
|
|
# To re-enable for debugging: comment out this line or set to y
|
|
CONFIG_SPIRAM_MEMTEST=n
|
|
|
|
# Reduce bootloader log verbosity (saves serial output time)
|
|
# Bootloader messages are rarely needed in production
|
|
CONFIG_BOOTLOADER_LOG_LEVEL_WARN=y
|
|
CONFIG_BOOTLOADER_LOG_LEVEL=2
|
|
|
|
# Skip ROM bootloader output (saves serial time)
|
|
CONFIG_BOOT_ROM_LOG_ALWAYS_OFF=y
|
|
|
|
# ============================================================================
|
|
# FreeRTOS Timer Service Task
|
|
# Default 2048 is too small when NimBLE/WiFi timer callbacks run
|
|
# ============================================================================
|
|
CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=4096
|
|
|
|
# ============================================================================
|
|
# Task Watchdog Timer (TWDT)
|
|
# Detects task starvation and deadlock conditions
|
|
# 30s timeout accommodates SPIFFS flash I/O during identity persistence
|
|
# (writing 40-50 destinations to flash takes 5-15s with GC/erase)
|
|
# ============================================================================
|
|
CONFIG_ESP_TASK_WDT_EN=y
|
|
CONFIG_ESP_TASK_WDT_TIMEOUT_S=30
|
|
CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y
|
|
CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y
|
|
|
|
# ============================================================================
|
|
# Core Dump — writes CPU state + backtrace to flash on crash
|
|
# Read with: espcoredump.py info_corefile -t raw -c 0x7F0000 -s 0x10000 <port>
|
|
# ============================================================================
|
|
CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH=y
|
|
CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF=y
|
|
CONFIG_ESP_COREDUMP_CHECKSUM_SHA256=y
|
|
CONFIG_ESP_COREDUMP_MAX_TASKS_NUM=64
|