Skip to content

Commit 71f6eb5

Browse files
Gadgetoiddpgeorge
authored andcommitted
rp2: Mark gc_heap NOLOAD for faster boot.
Create a new linker section .unitialized_bss for bss that does not need zero-initialising. Move gc_heap to this section, which saves ~30ms from rising edge of RESET to setting a pin HIGH in MicroPython. Zero fill happens in Pico SDK crt0.S before ROSC is configured. It's very, very slow. Signed-off-by: Phil Howard <phil@gadgetoid.com>
1 parent 6e51dbd commit 71f6eb5

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

ports/rp2/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
#endif
6767

6868
extern uint8_t __StackTop, __StackBottom;
69-
static char gc_heap[MICROPY_GC_HEAP_SIZE];
69+
__attribute__((section(".uninitialized_bss"))) static char gc_heap[MICROPY_GC_HEAP_SIZE];
7070

7171
// Embed version info in the binary in machine readable form
7272
bi_decl(bi_program_version_string(MICROPY_GIT_TAG));

ports/rp2/memmap_mp.ld

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,12 @@ SECTIONS
180180
*(.uninitialized_data*)
181181
} > RAM
182182

183+
/* bss without zero init on startup */
184+
.uninitialized_bss (NOLOAD): {
185+
. = ALIGN(4);
186+
*(.uninitialized_bss*)
187+
} > RAM
188+
183189
/* Start and end symbols must be word-aligned */
184190
.scratch_x : {
185191
__scratch_x_start__ = .;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy