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

SDK • Re: Why is the default stack size 2 KiB?

$
0
0
I believe only 2KB is available from each 4KB because the other 2KB is reserved for Stack Guard use. Or something like that. Stack Guards can be disabled.
Aren't they disabled by default?
Apparently so. I would have sworn they were enabled by default in earlier versions of the SDK but it appears I may have been wrong.

If they aren't enabled then why you only have 2KB stacks is as much a mystery to me as it is to you.

How do you know you only have 2KB ? - That's not flippancy as I really don't know how one would tell, don't know how to check what my builds are given.

Added : I found this -
The RP2040 has built-in SRAM, made up of four 64KB banks, followed by two 4KB banks.

One oddity is that each stack is 2KB, but the scratch banks are 4kb each, and so they each only use half of the bank.
Weird. I don't know why that is, and I don't how that is imposed in any practical sense.

Statistics: Posted by hippy — Tue Dec 03, 2024 2:48 pm



Viewing all articles
Browse latest Browse all 8621

Trending Articles