Gate every firmware build on runtime RAM and share nRF52 mOTA storage

This commit is contained in:
mikecarper committed 2026-09-08 02:09:26 -07:00
1 parent 1b6a9dcb6a
commit aa20e9278e
22 files changed
+1037 -36

No files matched your search

+1 -1
View File
@@ -673,7 +673,7 @@ bool handle_ota_command(const char* command, char* reply, mesh::MainBoard& board
const bool discarded = !was_folder && !was_sd_archive &&
c.fetch_store.discard();
// Fetch cancellation and serving are independent. In particular, a
// manual ESP32 serve view can point into serve_buf, so leave the manager
// manual serve view can point into serve_buf, so leave the manager
// view and its caller-owned buffer intact until `ota dev clear` (which
// detaches the view before releasing the buffer).
c.session_started_ms = 0;
+4 -4
View File
@@ -105,10 +105,10 @@ struct OtaContext {
OtaStoreRam<OTA_FETCH_BUF_SIZE> fetch_store;
#endif
SignerAllowlist allow;
#if defined(ESP32_PLATFORM)
// Manual `ota dev stage` is a diagnostic path. Reserving its full buffer in
// .bss prevents high-capacity classic ESP32 images from linking, even when
// the command is never used, so allocate it only while a manual stage exists.
#if defined(ESP32_PLATFORM) || (defined(NRF52_PLATFORM) && !defined(OTA_SEEDER_ONLY))
// Manual `ota dev stage` is a diagnostic path. Keep its buffer out of
// startup RAM on ESP32 and nRF52 receivers; normal mOTA uses the staging
// store. A failed allocation is reported by the CLI before any write.
uint8_t* serve_buf = nullptr;
bool ensureServeBuffer() {
if (!serve_buf) serve_buf = static_cast<uint8_t*>(malloc(OTA_SERVE_BUF_SIZE));
+1
View File
@@ -3,6 +3,7 @@
#include <stdint.h>
#include <stddef.h>
#include "OtaFormat.h"
#include "OtaMemoryPolicy.h"
#include "OtaProtocol.h"
#include "OtaByteIO.h"
#include "OtaStore.h"
+9
View File
@@ -0,0 +1,9 @@
#pragma once
// Full nRF52 Companions stream host-provided firmware and need no permanent
// mOTA workspace. Apply the same policy to build.sh and direct PlatformIO builds.
#if defined(NRF52_PLATFORM) && defined(OTA_SEEDER_ONLY) && defined(COMPANION_RADIO_FULL)
#ifndef OTA_SHARED_COMPANION_QUEUE
#define OTA_SHARED_COMPANION_QUEUE 1
#endif
#endif