From d2403437fff723f2bb6625fe3b5bfbb689e7e358 Mon Sep 17 00:00:00 2001 From: Chloe Bethel Date: Sun, 19 Oct 2025 10:35:30 +0100 Subject: [PATCH] Make packet pool dynamic again on STM32 as a workaround --- src/mesh/Router.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 60637cbd1..5cf8bfa7d 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -35,6 +35,15 @@ (MAX_RX_TOPHONE + MAX_RX_FROMRADIO + 2 * MAX_TX_QUEUE + \ 2) // max number of packets which can be in flight (either queued from reception or queued for sending) +static MemoryDynamic dynamicPool; +Allocator &packetPool = dynamicPool; +#elif defined(ARCH_STM32WL) +// On STM32 there isn't enough heap left over for the rest of the firmware if we allocate this statically. +// For now, make it dynamic again. +#define MAX_PACKETS \ + (MAX_RX_TOPHONE + MAX_RX_FROMRADIO + 2 * MAX_TX_QUEUE + \ + 2) // max number of packets which can be in flight (either queued from reception or queued for sending) + static MemoryDynamic dynamicPool; Allocator &packetPool = dynamicPool; #else