Files
2026-06-21 20:38:57 +02:00

56 lines
2.6 KiB
Plaintext

# STM32WL Platform Configuration (Seeed LoRa-E5 / STM32WLE5JC)
#
# Included by all STM32WL boards. STM32WL has NO Bluetooth radio and NO USB
# peripheral, so these boards are UART-only: the repeater CLI (and the serial
# companion) run over USART1 (chosen zephyr,console) through the board's
# onboard USB-UART bridge. Flashing is over SWD/ST-Link (west flash / OpenOCD).
#
# Include order: prj.conf -> zephcore_common.conf -> stm32wl_common.conf -> board.conf
# Only contains STM32WL-specific settings; common app/crypto/storage is in
# zephcore_common.conf.
# ========== Boot / Flash layout ==========
# No MCUboot: the application links at the flash origin via the single
# slot0_partition defined in board.overlay (zephyr,code-partition).
CONFIG_USE_DT_CODE_PARTITION=y
# ========== No Bluetooth ==========
# STM32WL has no BLE radio. Disabling here makes every build on this platform
# BT-free (the companion transport is serial, not NUS). Mirrors repeater.conf.
CONFIG_BT=n
# ========== No USB device stack ==========
# STM32WLE5JC has no USB peripheral. Console/CLI is plain UART
# (UART_INTERRUPT_DRIVEN already set in prj.conf). No UF2 output.
# ========== Entropy / CSPRNG ==========
# STM32WL provides only a raw TRNG (st,stm32-rng), not a hardware CSPRNG.
# Enable the TRNG as the entropy source; with an entropy driver present,
# CONFIG_CSPRNG_ENABLED defaults y and sys_csrand_get() is backed by the
# hardware CS generator. ZephyrRNG additionally conditions identity seeds with
# CPU-jitter + AES-256-CTR (see adapters/rng/ZephyrRNG.cpp), so a weak/slow
# TRNG cannot silently produce correlated keys. CONFIG_CSPRNG_ENABLED (which
# ZephyrRNG BUILD_ASSERTs on) is not directly assignable -- it defaults y once
# an entropy driver is present (subsys/random/Kconfig), so enabling the TRNG
# below is sufficient.
CONFIG_ENTROPY_GENERATOR=y
CONFIG_ENTROPY_STM32_RNG=y
# ========== Memory (64KB SRAM / 256KB flash) ==========
# RAM is the binding constraint on STM32WL (flash sits at ~63%), so spend the
# abundant flash to reclaim SRAM.
#
# AES lookup tables in ROM: the tf-psa-crypto builtin AES otherwise computes
# ~8KB of forward/reverse tables (RT0..RT3, RSb, ...) into .bss at runtime.
# ROM_TABLES makes them const (flash) instead. Single biggest SRAM win here.
CONFIG_MBEDTLS_AES_ROM_TABLES=y
# PSA key slots: default 16 each cost ~40B+ of static slot state. The mesh only
# juggles a couple of ephemeral AES keys at once; 8 is ample.
CONFIG_MBEDTLS_PSA_KEY_SLOT_COUNT=8
# Trim the common 8KB stacks to fit 64KB SRAM. Crypto (Ed25519/PSA) and the
# RNG jitter sampler run on the main thread, so keep main comfortable.
CONFIG_MAIN_STACK_SIZE=6144
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096