-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsdkconfig.defaults
More file actions
128 lines (117 loc) · 5.52 KB
/
Copy pathsdkconfig.defaults
File metadata and controls
128 lines (117 loc) · 5.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# Target
CONFIG_IDF_TARGET="esp32c3"
# Bluetooth + NimBLE host (no NimBLE-mesh — its FreeRTOS port is
# incomplete: per-buffer adv events are never ble_npl_event_init'd and
# the legacy adv worker is gated #ifdef MYNEWT, so the first publish
# crashes). We use Espressif's esp_ble_mesh stack instead — same
# Bluetooth Mesh on the wire, but a thoroughly-tested implementation
# that also runs on the NimBLE host.
CONFIG_BT_ENABLED=y
CONFIG_BT_NIMBLE_ENABLED=y
# CONFIG_BT_NIMBLE_MESH is not set
# esp_ble_mesh — node + provisioner, both enabled. We use the
# provisioner role to self-configure each device's local keys/bindings;
# we never on-board another device over the air.
CONFIG_BLE_MESH=y
CONFIG_BLE_MESH_NODE=y
CONFIG_BLE_MESH_PROVISIONER=y
CONFIG_BLE_MESH_PB_ADV=y
# cfg client used by gateway to push AppKey + Model App Bind + Model Pub Set
# to a freshly provisioned sensor. Linked on sensor too (unused there) so a
# single image config covers both roles.
CONFIG_BLE_MESH_CFG_CLI=y
# CONFIG_BLE_MESH_PB_GATT is not set
# CONFIG_BLE_MESH_GATT_PROXY_SERVER is not set
CONFIG_BLE_MESH_RELAY=y
CONFIG_BLE_MESH_USE_DUPLICATE_SCAN=y
# Default 1 saturates fast when publishes overlap. 10 matches the
# vendor_models example and gives plenty of headroom even at <1s
# publish cadence.
CONFIG_BLE_MESH_TX_SEG_MSG_COUNT=10
CONFIG_BLE_MESH_RX_SEG_MSG_COUNT=10
# Persist subnet, app keys, model bindings, and the per-source sequence
# counter to NVS. Without this the sensor restarts seq at 0 after every
# power cycle and the gateway's replay-protection list rejects the
# resulting low-seq packets as replays — silent data loss for any
# sensor that legitimately reboots (deep sleep, brown-out, hard
# repower).
CONFIG_BLE_MESH_SETTINGS=y
# Logging — keep app default at INFO (USB-Serial-JTAG drops bytes when
# no host attached, so verbose logs don't stall the publish loop).
# Bootloader to WARNING to shave ~80ms off cold boot and silence the
# header dump that's noise once a fleet is in the field.
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
CONFIG_LOG_COLORS=y
CONFIG_BOOTLOADER_LOG_LEVEL_WARN=y
# silence the ROM bootloader's UART chatter on every reset / wake
# CONFIG_BOOT_ROM_LOG_ALWAYS_ON is not set
CONFIG_BOOT_ROM_LOG_ALWAYS_OFF=y
# Route the console to USB-Serial-JTAG instead of UART0. UART0's TX
# FIFO blocks the writer task when no host is reading; the sensor's
# per-cycle ESP_LOGI calls (including the RADAR CSV trace) hang the
# publish loop until tools/monitor.sh opens the port. USB-Serial-JTAG
# drops bytes silently when no host is attached, so the application
# task keeps running.
# CONFIG_ESP_CONSOLE_UART_DEFAULT is not set
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
# NimBLE GAP logs every advertise stop/start at INFO. The mesh stack
# cycles these every ~100ms so they drown the application logs.
# Drop NimBLE itself to WARNING; our `dp_mesh:` lines stay at INFO.
# CONFIG_BT_NIMBLE_LOG_LEVEL_INFO is not set
CONFIG_BT_NIMBLE_LOG_LEVEL_WARNING=y
# NVS for persistent state (mesh provisioning, calibration)
CONFIG_NVS_ENCRYPTION=n
# Power: defaults; per-role overrides in main/Kconfig.projbuild
CONFIG_PM_ENABLE=y
CONFIG_FREERTOS_USE_TICKLESS_IDLE=y
# Flash + partitioning (assumes 4MB module — ESP32-C3 SuperMini etc.)
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
# Compiler
CONFIG_COMPILER_OPTIMIZATION_SIZE=y
CONFIG_COMPILER_WARN_WRITE_STRINGS=y
# Production hardening. Kept here (not in per-role sdkconfig) so every
# build that consumes sdkconfig.defaults inherits them.
#
# auto-reboot on panic — unattended devices in the field can't be
# manually power-cycled. paired with TASK/INT/BOOTLOADER WDTs and
# stack-canary checks already on by default
CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y
CONFIG_ESP_SYSTEM_PANIC_REBOOT_DELAY_SECONDS=0
# brownout detector at LVL 7 (~2.51V) — sensor on solar can dip below
# rail voltage during a cloud transient; reset is safer than corrupt NVS
CONFIG_ESP_BROWNOUT_DET=y
CONFIG_ESP_BROWNOUT_DET_LVL_SEL_7=y
CONFIG_ESP_BROWNOUT_DET_LVL=7
# stack canary catches FreeRTOS task overflows before they corrupt heap
CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y
# task watchdog 5s — long enough for slow MQTT TLS handshakes,
# short enough to recover from a wedged radar UART read
CONFIG_ESP_TASK_WDT_EN=y
CONFIG_ESP_TASK_WDT_INIT=y
CONFIG_ESP_TASK_WDT_TIMEOUT_S=5
CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y
CONFIG_ESP_INT_WDT=y
CONFIG_ESP_INT_WDT_TIMEOUT_MS=300
# disable debug surfaces in prod images. ESP_GDBSTUB_ENABLED is a
# hidden default-y option that only adds the panic-handler register
# dump — fine to keep. the user-visible runtime gdb stub
# (ESP_SYSTEM_GDBSTUB_RUNTIME) and OCDAWARE are what we don't want
# CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set
# CONFIG_ESP_DEBUG_OCDAWARE is not set
# skip image SHA validation when waking from deep sleep — the image
# can't change between sleep/wake, and validation costs ~80ms of solar
# budget per wake. matters once dp_sensor moves to deep sleep
CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP=y
# heap poisoning off — the runtime cost (~10% on alloc/free) doesn't
# pay off in a steady-state firmware that allocates almost nothing
# after init
CONFIG_HEAP_POISONING_DISABLED=y
# coredump to flash needs a coredump partition. partitions.csv doesn't
# have one yet — flip on once the layout adds it. for now, a panic
# triggers PANIC_PRINT_REBOOT and the trace lands in USB-Serial-JTAG
# tools/monitor.sh output
# CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH is not set
CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y