Size-optimize nRF52 LoRa OTA builds

This commit is contained in:
mikecarper committed 2026-08-11 16:54:49 -07:00
1 parent b80971b85f
commit c96bdd6eeb
3 files changed
+29

No files matched your search

+19
View File
@@ -2184,6 +2184,24 @@ apply_repeater_neighbor_capacity() {
export PLATFORMIO_BUILD_FLAGS="${PLATFORMIO_BUILD_FLAGS} -DMAX_NEIGHBOURS=${max_neighbours}"
}
apply_nrf52_lora_ota_size_profile() {
local env_name=$1
if [ "${PIO_ENV_PLATFORM_BY_NAME[$env_name]:-}" != "NRF52_PLATFORM" ] \
|| ! is_lora_ota_build "$env_name" \
|| ! is_lora_ota_only_target "$env_name"; then
return 0
fi
# The Adafruit nRF52 platform defaults release builds to -Ofast. Once the
# runtime software Ed25519 fallback is linked alongside CC310, that setting
# fully expands repeated Curve25519 arithmetic and wastes tens of kilobytes.
# Keep hardware crypto, RNG mixing, the software fallback, and board features;
# only select the size optimizer for the constrained self-updatable image.
append_platformio_build_unflags "-Ofast"
export PLATFORMIO_BUILD_FLAGS="${PLATFORMIO_BUILD_FLAGS} -Os"
}
apply_lora_ota_no_external_sensors_profile() {
local env_name=$1
@@ -2712,6 +2730,7 @@ build_firmware() {
apply_esp32_lora_ota_size_profile "$env_name"
apply_esp32_full_size_profile "$env_name"
apply_repeater_neighbor_capacity "$env_name"
apply_nrf52_lora_ota_size_profile "$env_name"
apply_lora_ota_no_external_sensors_profile "$env_name"
apply_radio_overrides
apply_firmware_profile_overrides
+5
View File
@@ -65,6 +65,11 @@ browser WiFi uploader (`start ota`) and use a 254-entry neighbor table. RP2040 a
currently have a safe self-apply path, but current repeater firmware can still relay OTA packets opaquely
during TempRadio.
nRF52 `-ota-` siblings are compiled with size optimization instead of the Adafruit platform's default
speed optimization. This prevents the retained software Ed25519 fallback from expanding beyond the fixed
in-place workspace; CC310 hardware crypto, hardware RNG mixing, telemetry history, and board-native features
remain enabled.
ESP32 `*-full-ota-*` artifacts retain all compiled features and enable LoRa OTA for every FULL role,
including room servers, sensors, observers, and bridges. A FULL image requires its expanded partition table:
install the matching merged image over USB once before installing later non-merged FULL updates over LoRa.
+5
View File
@@ -126,6 +126,11 @@ board-native telemetry remain enabled. ESP32 siblings retain the compact browser
full 254-entry neighbor table. RP2040 and STM32 targets are not offered because those platforms do not yet
have a safe bootloader/apply path.
nRF52 LoRa-OTA siblings use size optimization rather than the Adafruit platform's default `-Ofast`. This
keeps the runtime software Ed25519 fallback from being expanded into tens of kilobytes of repeated curve
arithmetic while retaining CC310 hardware crypto, hardware RNG mixing, telemetry history, and board-native
features.
Two WiFi-heavy non-companion profiles need additional reductions to remain portable. MQTT observer builds
keep MQTT/TLS, onboard GPS, and their WiFi pull-updater, but omit WebConfig, SNMP, debug logging, display
support, and optional external sensor drivers. Their compact CLI keeps observer controls plus the radio,