I'm trying to display an image on a screen and am storing the pixel data as chars in a large array. My problem is that the program will compile but not work when the array is bigger than 10520 elements!
Seem a little odd, does anyone have any idea what could be happening?
It could well be you are running out of RAM; you only have a finite amount of RAM, which will get split up between the static/global data, heap and stack. They can all vary independently, but the total amount must stay under 32KB.
Also, if you want to learn more about the C memory model, you might find some useful insights on:
Another thing if this doesn't uncover anything is perhaps you could publish a program that demonstrates the problem, and someone might be able to spot something.
Pretty sure it was the stack limit. I had another array that was bigger that I was using to index the first. The combined size of both would be around the 32k mark.
Think it may be time to start looking at an SD card to store the images on?
You can probably still use the flash. Just make sure you tag your image data as "const", then it will stay in flash instead of being copied to RAM.
Important Information for this Arm website
This site uses cookies to store information on your computer.
By continuing to use our site, you consent to our cookies.
If you are not happy with the use of these cookies, please review our
Cookie Policy
to learn how they can be disabled.
By disabling cookies, some features of the site will not work.
Access Warning
You do not have the correct permissions to perform this operation.
Hi,
I'm trying to display an image on a screen and am storing the pixel data as chars in a large array. My problem is that the program will compile but not work when the array is bigger than 10520 elements!
Seem a little odd, does anyone have any idea what could be happening?
Cheers
Martin