This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Maximum size of array in memory

I am using NRF52840 and SDK1600. Currently, my program uses 50kB RAM memory according to Segger Embedded Studio. NRF52840 has 250kB  RAM memory, so there is plenty of space left. 

Right now, I have a task to allocate 64 kB memory for temporary data storage during data acquisition. Since I have plenty of RAM available, I want to use RAM instead of flash for the temporary data storage. 

I am wondering what is the largest size of array that I can allocate without any potential problems? I understand that we want to avoid dynamic memory allocation such as calloc/free.

For example, can I use the following size of array in application without any problem?

uint16_t data_array[32000]; 

Segger studio compiles the above line of code without issues. 

I did a quick search and did not find the answer. Thanks in advance!

Related