rp2: Increase micropython stack allocation

We were running out of stack for micropython, and the core1 code doesn't
need 4k. So shift the allocation so that micropython has 6k and core1
has 2k. Adjust the linker script since it didn't support splitting
SCRATCH_X between the two stacks.

Signed-off-by: Matthias Blankertz <matthias@blankertz.org>
This commit was merged in pull request #2.
This commit is contained in:
2025-08-20 19:56:13 +02:00
parent ccdecf255d
commit 7facf4286c
2 changed files with 3 additions and 3 deletions

View File

@@ -569,8 +569,8 @@ target_compile_definitions(${MICROPY_TARGET} PRIVATE
LFS1_NO_MALLOC LFS1_NO_DEBUG LFS1_NO_WARN LFS1_NO_ERROR LFS1_NO_ASSERT LFS1_NO_MALLOC LFS1_NO_DEBUG LFS1_NO_WARN LFS1_NO_ERROR LFS1_NO_ASSERT
LFS2_NO_MALLOC LFS2_NO_DEBUG LFS2_NO_WARN LFS2_NO_ERROR LFS2_NO_ASSERT LFS2_NO_MALLOC LFS2_NO_DEBUG LFS2_NO_WARN LFS2_NO_ERROR LFS2_NO_ASSERT
PICO_FLOAT_PROPAGATE_NANS=1 PICO_FLOAT_PROPAGATE_NANS=1
PICO_STACK_SIZE=0x1000 PICO_STACK_SIZE=0x1800
PICO_CORE1_STACK_SIZE=0x1000 PICO_CORE1_STACK_SIZE=0x800
PICO_MAX_SHARED_IRQ_HANDLERS=8 # we need more than the default PICO_MAX_SHARED_IRQ_HANDLERS=8 # we need more than the default
PICO_PROGRAM_NAME="MicroPython" PICO_PROGRAM_NAME="MicroPython"
PICO_NO_PROGRAM_VERSION_STRING=1 # do it ourselves in main.c PICO_NO_PROGRAM_VERSION_STRING=1 # do it ourselves in main.c

View File

@@ -250,7 +250,7 @@ SECTIONS
__GcHeapEnd = ORIGIN(RAM) + LENGTH(RAM); __GcHeapEnd = ORIGIN(RAM) + LENGTH(RAM);
/* Define memory for the C stack */ /* Define memory for the C stack */
__StackOneTop = ORIGIN(SCRATCH_X) + LENGTH(SCRATCH_X); __StackOneTop = ORIGIN(SCRATCH_X) + SIZEOF(.stack1_dummy);
__StackTop = ORIGIN(SCRATCH_Y) + LENGTH(SCRATCH_Y); __StackTop = ORIGIN(SCRATCH_Y) + LENGTH(SCRATCH_Y);
__StackOneBottom = __StackOneTop - SIZEOF(.stack1_dummy); __StackOneBottom = __StackOneTop - SIZEOF(.stack1_dummy);
__StackBottom = __StackTop - SIZEOF(.stack_dummy); __StackBottom = __StackTop - SIZEOF(.stack_dummy);