From 3b7434be4c2b510d61bef52590d41d5ff2711201 Mon Sep 17 00:00:00 2001 From: liquidraver <504870+liquidraver@users.noreply.github.com> Date: Tue, 24 Feb 2026 16:27:07 +0100 Subject: [PATCH] unify conf + clean up prod builds --- zephcore/adapters/gps/ZephyrGPSManager.cpp | 2 ++ zephcore/boards/common/esp32_common.conf | 5 +++ zephcore/boards/common/nrf52_common.conf | 4 +++ zephcore/boards/common/prod.conf | 6 ++++ .../boards/esp32/lilygo_tlora_c6/board.conf | 5 --- zephcore/boards/esp32/station_g2/board.conf | 3 -- .../boards/esp32/station_g2/board.overlay | 6 +--- zephcore/boards/esp32/xiao_esp32c3/board.conf | 6 ---- zephcore/boards/esp32/xiao_esp32c6/board.conf | 5 --- zephcore/boards/example_board/board.conf | 34 +++++++------------ zephcore/boards/mg24/xiao_mg24/board.conf | 3 -- .../nrf52840/ikoka_nano_30dbm/board.conf | 2 -- zephcore/boards/nrf52840/rak4631/board.conf | 6 ---- .../boards/nrf52840/rak4631/board.overlay | 1 + .../boards/nrf52840/wio_tracker_l1/board.conf | 5 +-- .../wio_tracker_l1_nrf52840.dts | 1 + .../boards/nrf54l/xiao_nrf54l15/board.conf | 3 -- 17 files changed, 34 insertions(+), 63 deletions(-) diff --git a/zephcore/adapters/gps/ZephyrGPSManager.cpp b/zephcore/adapters/gps/ZephyrGPSManager.cpp index 686cac9..835be9f 100644 --- a/zephcore/adapters/gps/ZephyrGPSManager.cpp +++ b/zephcore/adapters/gps/ZephyrGPSManager.cpp @@ -22,7 +22,9 @@ #include #include #include +#if defined(CONFIG_SOC_NRF52840) #include +#endif LOG_MODULE_REGISTER(zephcore_gps, CONFIG_ZEPHCORE_GPS_LOG_LEVEL); diff --git a/zephcore/boards/common/esp32_common.conf b/zephcore/boards/common/esp32_common.conf index c2fdf2c..c015335 100644 --- a/zephcore/boards/common/esp32_common.conf +++ b/zephcore/boards/common/esp32_common.conf @@ -15,6 +15,11 @@ CONFIG_BT_TX_PROCESSOR_STACK_SIZE=2048 # ESP32 BLE stack requires larger heap (override zephcore_common 2KB default) CONFIG_HEAP_MEM_POOL_SIZE=32768 +# ========== Flash ========== +# 4MB is standard for XIAO/LilyGo RISC-V boards. +# Station G2 (16MB) overrides in board.conf. +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y + # ========== Debug ========== # CONFIG_ASSERT disabled for ESP32: Espressif's closed-source BLE controller # blob leaves IRQs in a state that triggers false "Context switching while diff --git a/zephcore/boards/common/nrf52_common.conf b/zephcore/boards/common/nrf52_common.conf index 1effc7c..e26dd97 100644 --- a/zephcore/boards/common/nrf52_common.conf +++ b/zephcore/boards/common/nrf52_common.conf @@ -22,6 +22,10 @@ CONFIG_BT_CTLR_TX_PWR_PLUS_4=y CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 # ========== Flash: nRF52-specific ========== +# QSPI flash — disabled by default (safer — avoids hang if chip missing). +# Boards with QSPI (Wio Tracker L1) override in board.conf. +CONFIG_NORDIC_QSPI_NOR=n + # Recover from corrupted NVS sectors (nRF52 flash can develop bad regions) CONFIG_NVS_INIT_BAD_MEMORY_REGION=y diff --git a/zephcore/boards/common/prod.conf b/zephcore/boards/common/prod.conf index 04d15b7..a235a47 100644 --- a/zephcore/boards/common/prod.conf +++ b/zephcore/boards/common/prod.conf @@ -11,6 +11,12 @@ CONFIG_LOG=n # Disable asserts (saves flash, removes CMake warning) CONFIG_ASSERT=n +# Disable SEGGER RTT (saves ~4KB RAM ring buffer + init code) +CONFIG_USE_SEGGER_RTT=n + +# Disable thread name strings (saves flash — only useful for debug) +CONFIG_THREAD_NAME=n + # Max contacts for production (App protocol limit: 510, encoded as uint8 * 2, so you can set it higher, but the current app can't display it or work with it) # Check board configs for overrides — too low RAM can freeze the device. CONFIG_ZEPHCORE_MAX_CONTACTS=510 diff --git a/zephcore/boards/esp32/lilygo_tlora_c6/board.conf b/zephcore/boards/esp32/lilygo_tlora_c6/board.conf index 0a0c985..b6b1d19 100644 --- a/zephcore/boards/esp32/lilygo_tlora_c6/board.conf +++ b/zephcore/boards/esp32/lilygo_tlora_c6/board.conf @@ -15,8 +15,3 @@ CONFIG_ZEPHCORE_BOARD_NAME="LilyGo TLoRa C6" # Device Information Service model name CONFIG_BT_DIS_MODEL_NUMBER_STR="LilyGo TLoRa C6" -# Radio type -CONFIG_ZEPHCORE_RADIO_NATIVE=y - -# Flash size (T3-C6 has 4MB, override Zephyr default) -CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y diff --git a/zephcore/boards/esp32/station_g2/board.conf b/zephcore/boards/esp32/station_g2/board.conf index 3c1731d..17c593d 100644 --- a/zephcore/boards/esp32/station_g2/board.conf +++ b/zephcore/boards/esp32/station_g2/board.conf @@ -14,9 +14,6 @@ CONFIG_ZEPHCORE_BOARD_NAME="Station G2" CONFIG_BT_DIS_MODEL_NUMBER_STR="BQ Station G2" -# Radio type — SX1262 via Zephyr native LoRa driver -CONFIG_ZEPHCORE_RADIO_NATIVE=y - # TX power limits — Station G2 has ~20dB external PA. # Default 15 dBm → ~35 dBm output (P1dB point). # Cap at 19 dBm → ~39 dBm absolute max (matches Arduino MAX_LORA_TX_POWER). diff --git a/zephcore/boards/esp32/station_g2/board.overlay b/zephcore/boards/esp32/station_g2/board.overlay index d248836..c9437d6 100644 --- a/zephcore/boards/esp32/station_g2/board.overlay +++ b/zephcore/boards/esp32/station_g2/board.overlay @@ -53,11 +53,7 @@ dio3-tcxo-voltage = <2>; tcxo-power-startup-delay-ms = <10>; - /* - * RX boosted mode DISABLED — Station G2 wiki warns against it: - * "Impact of LoRa node dense areas/high noise environments on RF performance" - * https://wiki.uniteng.com/en/meshtastic/station-g2 - */ + rx-boosted; }; }; diff --git a/zephcore/boards/esp32/xiao_esp32c3/board.conf b/zephcore/boards/esp32/xiao_esp32c3/board.conf index 392910b..43ecb9d 100644 --- a/zephcore/boards/esp32/xiao_esp32c3/board.conf +++ b/zephcore/boards/esp32/xiao_esp32c3/board.conf @@ -15,11 +15,5 @@ CONFIG_ZEPHCORE_BOARD_NAME="XIAO ESP32-C3" # Device Information Service model name CONFIG_BT_DIS_MODEL_NUMBER_STR="XIAO ESP32-C3" -# Radio type -CONFIG_ZEPHCORE_RADIO_NATIVE=y - -# Flash size (XIAO ESP32-C3 has 4MB, override Zephyr default 2MB) -CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y - # RAM-limited: override prod.conf MAX_CONTACTS (800 overflows DRAM) CONFIG_ZEPHCORE_MAX_CONTACTS=300 diff --git a/zephcore/boards/esp32/xiao_esp32c6/board.conf b/zephcore/boards/esp32/xiao_esp32c6/board.conf index 30473e8..3fff5ca 100644 --- a/zephcore/boards/esp32/xiao_esp32c6/board.conf +++ b/zephcore/boards/esp32/xiao_esp32c6/board.conf @@ -15,8 +15,3 @@ CONFIG_ZEPHCORE_BOARD_NAME="XIAO ESP32-C6" # Device Information Service model name CONFIG_BT_DIS_MODEL_NUMBER_STR="XIAO ESP32-C6" -# Radio type -CONFIG_ZEPHCORE_RADIO_NATIVE=y - -# Flash size (XIAO ESP32-C6 has 4MB, override Zephyr default 2MB) -CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y diff --git a/zephcore/boards/example_board/board.conf b/zephcore/boards/example_board/board.conf index 45fd8b9..abb4357 100644 --- a/zephcore/boards/example_board/board.conf +++ b/zephcore/boards/example_board/board.conf @@ -30,30 +30,21 @@ CONFIG_ZEPHCORE_BOARD_NAME="My Board" # BLE Device Information Service model name (shown in phone settings) CONFIG_BT_DIS_MODEL_NUMBER_STR="My Board v1" -# ========== REQUIRED: Radio Type ========== -# Pick ONE based on your LoRa chip. -CONFIG_ZEPHCORE_RADIO_NATIVE=y # Zephyr native LoRa driver (SX126x, SX127x, LLCC68, STM32WL) -# CONFIG_ZEPHCORE_RADIO_LR1110=y # Semtech LR11xx custom driver (LR1110, LR1120, LR1121) - -# ========== OPTIONAL: SPI for LoRa ========== -# Only needed if LoRa chip is NOT on the Zephyr lora driver (i.e. LR11xx). -# Native driver radios use Zephyr's built-in lora driver and do NOT need this. -# CONFIG_SPI=y +# ========== Radio Type (auto-selected) ========== +# Default: RADIO_NATIVE (SX126x, SX127x, LLCC68, STM32WL) — no setting needed. +# Override ONLY for LR11xx boards: +# CONFIG_ZEPHCORE_RADIO_LR1110=y # Semtech LR11xx custom driver +# CONFIG_SPI=y # LR11xx needs SPI (native driver doesn't) # ========== OPTIONAL: QSPI External Flash (nRF52840 only) ========== +# nrf52_common.conf defaults QSPI to =n (safer — avoids hang if chip missing). # Uncomment if your board has QSPI flash for expanded storage. -# This gives 100 advert blob slots instead of 20. -# Only available on nRF52840 — other MCUs don't have QSPI peripheral. # -# WARNING: If your board does NOT have a QSPI flash chip, you MUST leave -# this disabled (=n) AND disable &qspi in your overlay. The Nordic QSPI -# driver hangs forever at boot (k_sem_take K_FOREVER) if no chip responds, -# bricking the device with no USB/BLE/logs. The DataStore code handles -# missing QSPI gracefully — the driver does not. -# -# Also add &qspi { status = "disabled"; }; in your overlay and do NOT -# include qspi-ext.dtsi. See boards/nrf52840/rak4631/ for an example. -CONFIG_NORDIC_QSPI_NOR=n +# WARNING: If your board does NOT have a QSPI flash chip, the Nordic QSPI +# driver hangs forever at boot (k_sem_take K_FOREVER). Disable &qspi in +# your overlay. See boards/nrf52840/rak4631/ for an example. +# CONFIG_NORDIC_QSPI_NOR=y +# CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 # ========== OPTIONAL: Display ========== # Display subsystem is enabled universally in zephcore_common.conf. @@ -120,7 +111,8 @@ CONFIG_NORDIC_QSPI_NOR=n # Build with: west build -b /nrf54l15/cpuapp zephcore --no-sysbuild # # --- ESP32 --- -# CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y # If your board has 4MB flash (default 2MB) +# esp32_common.conf defaults to 4MB flash. Override only for boards with more: +# CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y # Station G2 (16MB flash) # ========== OPTIONAL: Max Contacts Override ========== # prod.conf sets MAX_CONTACTS=800 (sized for nRF52840's 256KB SRAM). diff --git a/zephcore/boards/mg24/xiao_mg24/board.conf b/zephcore/boards/mg24/xiao_mg24/board.conf index 0222f61..3af1c83 100644 --- a/zephcore/boards/mg24/xiao_mg24/board.conf +++ b/zephcore/boards/mg24/xiao_mg24/board.conf @@ -8,8 +8,5 @@ CONFIG_ZEPHCORE_BOARD_NAME="XIAO MG24" # Device Information Service model name CONFIG_BT_DIS_MODEL_NUMBER_STR="XIAO MG24" -# Radio type -CONFIG_ZEPHCORE_RADIO_NATIVE=y - # RAM-limited: Silabs BLE blob needs 32KB heap, override prod.conf MAX_CONTACTS CONFIG_ZEPHCORE_MAX_CONTACTS=650 diff --git a/zephcore/boards/nrf52840/ikoka_nano_30dbm/board.conf b/zephcore/boards/nrf52840/ikoka_nano_30dbm/board.conf index f80083b..5cfffe9 100644 --- a/zephcore/boards/nrf52840/ikoka_nano_30dbm/board.conf +++ b/zephcore/boards/nrf52840/ikoka_nano_30dbm/board.conf @@ -21,5 +21,3 @@ CONFIG_BT_DIS_MODEL_NUMBER_STR="Ikoka Nano 30dBm" # SoftDevice firmware ID (XIAO nRF52840 uses S140 v7.3.0) CONFIG_ZEPHCORE_SD_FWID=0x0123 -# Radio type -CONFIG_ZEPHCORE_RADIO_NATIVE=y diff --git a/zephcore/boards/nrf52840/rak4631/board.conf b/zephcore/boards/nrf52840/rak4631/board.conf index 41cb455..79e58d9 100644 --- a/zephcore/boards/nrf52840/rak4631/board.conf +++ b/zephcore/boards/nrf52840/rak4631/board.conf @@ -19,9 +19,3 @@ CONFIG_ZEPHCORE_BOARD_NAME="RAK 4631" # Device Information Service model name CONFIG_BT_DIS_MODEL_NUMBER_STR="RAK4631" -# Radio type -CONFIG_ZEPHCORE_RADIO_NATIVE=y - -# QSPI flash — disabled (RAK19003 Mini Base has no QSPI flash) -# For base boards with QSPI (RAK19007, RAK5005-O), create a separate variant. -CONFIG_NORDIC_QSPI_NOR=n diff --git a/zephcore/boards/nrf52840/rak4631/board.overlay b/zephcore/boards/nrf52840/rak4631/board.overlay index 25a1f5f..4bd797a 100644 --- a/zephcore/boards/nrf52840/rak4631/board.overlay +++ b/zephcore/boards/nrf52840/rak4631/board.overlay @@ -64,6 +64,7 @@ &lora { dio1-gpios = <&gpio1 15 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>; + rx-boosted; }; /* diff --git a/zephcore/boards/nrf52840/wio_tracker_l1/board.conf b/zephcore/boards/nrf52840/wio_tracker_l1/board.conf index c4ef4fd..135392d 100644 --- a/zephcore/boards/nrf52840/wio_tracker_l1/board.conf +++ b/zephcore/boards/nrf52840/wio_tracker_l1/board.conf @@ -15,10 +15,7 @@ CONFIG_ZEPHCORE_BOARD_NAME="Wio Tracker L1" # Device Information Service model name CONFIG_BT_DIS_MODEL_NUMBER_STR="Wio Tracker 1110" -# Radio type -CONFIG_ZEPHCORE_RADIO_NATIVE=y - -# QSPI flash present +# QSPI flash present (overrides nrf52_common.conf default of =n) CONFIG_NORDIC_QSPI_NOR=y CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 diff --git a/zephcore/boards/nrf52840/wio_tracker_l1/wio_tracker_l1_nrf52840.dts b/zephcore/boards/nrf52840/wio_tracker_l1/wio_tracker_l1_nrf52840.dts index 8702307..e6c7137 100644 --- a/zephcore/boards/nrf52840/wio_tracker_l1/wio_tracker_l1_nrf52840.dts +++ b/zephcore/boards/nrf52840/wio_tracker_l1/wio_tracker_l1_nrf52840.dts @@ -284,6 +284,7 @@ dio3-tcxo-voltage = ; tcxo-power-startup-delay-ms = <5>; spi-max-frequency = <8000000>; + rx-boosted; }; }; diff --git a/zephcore/boards/nrf54l/xiao_nrf54l15/board.conf b/zephcore/boards/nrf54l/xiao_nrf54l15/board.conf index 1bbb645..28c4f59 100644 --- a/zephcore/boards/nrf54l/xiao_nrf54l15/board.conf +++ b/zephcore/boards/nrf54l/xiao_nrf54l15/board.conf @@ -7,8 +7,5 @@ CONFIG_ZEPHCORE_BOARD_NAME="XIAO nRF54L15" # Device Information Service model name CONFIG_BT_DIS_MODEL_NUMBER_STR="XIAO nRF54L15" -# Radio type -CONFIG_ZEPHCORE_RADIO_NATIVE=y - # RAM-limited: FLPR core reserves 68KB, override prod.conf MAX_CONTACTS CONFIG_ZEPHCORE_MAX_CONTACTS=450