Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 6980

SDK • Increasing core0 stack size: region `SCRATCH_Y' overflowed

$
0
0
I've got a project where I'm setting the stack size for core0 to 8192, core1 to 0 then using `multicore_launch_core1_with_stack` to pass it some malloc'd memory, i.e. this in CMakeLists.txt:

Code:

  PICO_STACK_SIZE=8192  PICO_CORE1_STACK_SIZE=0  
This worked in 2.1.1, but since upgrading to SDK 2.2.0, I get this build error:

Code:

/usr/lib/gcc/arm-none-eabi/13.2.1/../../../arm-none-eabi/bin/ld: StackTest.elf section `.stack_dummy' will not fit in region `SCRATCH_Y'/usr/lib/gcc/arm-none-eabi/13.2.1/../../../arm-none-eabi/bin/ld: region `SCRATCH_Y' overflowed by 4096 bytes
I'm pretty sure it's got something to do with this:
http://github.com/raspberrypi/pico-sdk/pull/2515/

It builds ok if I update CMakeLists.txt to include PICO_CRT0_ALLOCATE_SPACERS:

Code:

target_compile_definitions(StackTest PRIVATE  PICO_STACK_SIZE=8192  PICO_CORE1_STACK_SIZE=0     PICO_CRT0_ALLOCATE_SPACERS=0)
But I'm struggling to understand what PICO_CRT0_ALLOCATE_SPACERS is for, and if using it like this is a mistake? Or is this approach just the wrong way entirely to increase the stack space for core0?

Statistics: Posted by co85 — Sat Nov 22, 2025 6:15 pm — Replies 1 — Views 100



Viewing all articles
Browse latest Browse all 6980

Trending Articles