Hello everybody. I'm a absolute newbie on Keil Microvision and the Cortex Mx platform. I'm currently facing an issue that I believe is linked to a memory shortage on my test 8KB RAM Cortex M0 chip.
I do not quite understand how one should interpret the log displayed at compile time...
Actually, my test app compiles & runs fine when assigning a small buffer variable (let's say 10 bytes) >> Program Size: Code=33084 RO-data=3380 RW-data=212 ZI-data=6520
But, as soon as I assign a heavier buffer (let's say 1'000 bytes), the app still compiles neatly, but crashes or does not execute on the host 8K RAM chip.>> Program Size: Code=33084 RO-data=3380 RW-data=212 ZI-data=7504
Does anyone could take some time to explain me what's happening and how I should deal with this problem (maybe upgrading to a 32K RAM chip... at heavier expense)
Many thanks for your help.
What, exactly, do you mean by that?
If you're creating a 1000-byte automatic variable, that comes out of the stack - so won't be reported in the memory statistics...
www.avrfreaks.net/.../memory-sram-compiler
Thanks for your reply Andrew. My variable is declared as an 1'000 bytes array. It is show in the statistics.
Where did automatic come into it? In the original post, the OP clearly stated he had a heavier buffer and even showed the different map statistics with original ZI-data=6520 then after adding the 1000, ZI-data=7504. Allowing for possible alignment, that's probably close enough.
It's clear that the OP is simply running close to the limit on available RAM.
Stack overflow is a "great" way to have a program crash.
And the linker can't (normally) detect any stack overflow, unless the code is 100% free of any case of recursion (and the linker has access to a full call tree from inside the libraries).