summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Howard <phil@gadgetoid.com>2024-07-04 10:19:26 +0100
committerDamien George <damien@micropython.org>2024-08-02 16:21:36 +1000
commite7ff0b8a31a7f36cc1b3dfb7e5fd7b8805ff85ce (patch)
treed35673c2bb7bf5a35e685fe0caad257cfbf315a5
parent1557014ea4e88a1dfbef028afa393e6d2c3e6a9e (diff)
rp2/memmap_mp.ld: Lower the minimum GC heap to 32K.
Reduce mimimum heap requirement. This value allows more room for large, static buffers in user C modules (such as graphics buffers or otherwise) which might be allocated outside of MicroPython's heap to guarantee alignment or avoid fragmentation. Signed-off-by: Phil Howard <phil@gadgetoid.com>
-rw-r--r--ports/rp2/memmap_mp.ld10
1 files changed, 7 insertions, 3 deletions
diff --git a/ports/rp2/memmap_mp.ld b/ports/rp2/memmap_mp.ld
index 0ed9509b8..a5799cd88 100644
--- a/ports/rp2/memmap_mp.ld
+++ b/ports/rp2/memmap_mp.ld
@@ -256,9 +256,13 @@ SECTIONS
__StackBottom = __StackTop - SIZEOF(.stack_dummy);
PROVIDE(__stack = __StackTop);
- /* Check GC heap is at least 128 KB */
- /* On a RP2040 using all SRAM this should always be the case. */
- ASSERT((__GcHeapEnd - __GcHeapStart) > 128*1024, "GcHeap is too small")
+ /* Check GC heap is at least 32 KB */
+ /* This is quarter the minimum RAM suggested for full-featured MicroPython.
+ * This value accounts for large static buffers included in user C or C++
+ * modules, which might significantly reduce the available heap but also
+ * lower demand for memory at runtime.
+ */
+ ASSERT((__GcHeapEnd - __GcHeapStart) > 32*1024, "GcHeap is too small")
ASSERT( __binary_info_header_end - __logical_binary_start <= 256, "Binary info must be in first 256 bytes of the binary")
/* todo assert on extra code */