diff --git a/ports/rp2/main.c b/ports/rp2/main.c index d976464de1..1062236a39 100644 --- a/ports/rp2/main.c +++ b/ports/rp2/main.c @@ -66,7 +66,7 @@ #endif extern uint8_t __StackTop, __StackBottom; -static char gc_heap[MICROPY_GC_HEAP_SIZE]; +__attribute__((section(".uninitialized_bss"))) static char gc_heap[MICROPY_GC_HEAP_SIZE]; // Embed version info in the binary in machine readable form bi_decl(bi_program_version_string(MICROPY_GIT_TAG)); diff --git a/ports/rp2/memmap_mp.ld b/ports/rp2/memmap_mp.ld index 0dc96743ea..82f9cb01c3 100644 --- a/ports/rp2/memmap_mp.ld +++ b/ports/rp2/memmap_mp.ld @@ -180,6 +180,12 @@ SECTIONS *(.uninitialized_data*) } > RAM + /* bss without zero init on startup */ + .uninitialized_bss (NOLOAD): { + . = ALIGN(4); + *(.uninitialized_bss*) + } > RAM + /* Start and end symbols must be word-aligned */ .scratch_x : { __scratch_x_start__ = .;