Stack isues #3052
k-madsenDK
started this conversation in
Ideas
Stack isues
#3052
Replies: 1 comment 1 reply
-
That's the way the SDK is set up to best price single cycle access to stack RAM units. The stack moves down and the majority of apps only use the 1st core. So those apps get 8k of stack effectively. See https://arduino-pico.readthedocs.io/en/latest/multicore.html#stack-sizes for a way to move the 2nd core stack to the top of heap without any special build flags. You're not getting single cycle access if both cores are working in the same 4k stack unit anyway. If you overflow the stack down into heap, which is what I think your swapping is doing, you will most likely corrupt the heap memory manager. That's not a fun thing to debug. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I got a program with heave use of core0 as web interface and core1 running the main sensor interface.
I got trouble the stack from core0 overwrite core1 stack.
To exchange the 2 stacks i use compiler.cpp.extra_flags=-DPICO_CORE0_STACK_ADDR=0x20041000 -DPICO_CORE1_STACK_ADDR=0x20042000
In platform.txt but I have to do that for every new platform update.
Why just be default have stack1 first and then stack0
For most of the programs running on a pico series is there a big gab between heap in the bottom and the stack in the top.
Beta Was this translation helpful? Give feedback.
All reactions