I'm having a problem with using all the memory in the nRF52 Thead SDK 0.10.0. Namely, even if I run one of the smallest examples (e.g. aes one from crypto examples) the flash size usage is very low (about 0x9000), BSS ram is also low (according to the linker map output about 2 kilobytes).
But when I want to allocate some static memory (e.g. static uint8_t buf[ 1024 * 100 ]
, the code links properly, but after execution I see no logs. I'm not sure if the cpu is dead, or just logging stops to work. If I use smaller array (e.g. 50k), it works.
If I understand correctly, BSS are located at the beginning of ram (0x20000000), stack is going down from RAM end (0x20040000), and anything in between should be unused. So, I should be able to extend BSS by 100kb, provided that I don't use stack so much to override that. My stack is virtually empty - just main() and logging.
Interestingly the FreeRTOS examples seem to be tuned to the stable value. Like, FreeRTOS has its own heap in bss section, and it is set to 14kb in the SDK. Setting it to larger value like, 18kb, crashes CPU - even if there should be ~190kb of free memory (running FreeRTOS+OpenThread).
Any ideas why that happens?