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

Memory allocation limitations on the nRF52840?

Hi,

I am using the nRF52840, which has 256KB of RAM, (i.e. loads and load of RAM.)

I would like to allocate a buffer of 45KB.

I have tried using malloc (from the stdlib.h, in SEGGER Embedded Studio for ARM 3.40) to allocate some memory buffers, but the function returns NULL if I try and allocate anything bigger than 8188 bytes ~=8KB  (which is tiny compared to the 262144 available in the chip)

Is there an in-built limitation of the malloc function, and if so, how do I override it?

I have also tried experimenting with the mem_manager library and the nrf_malloc function, but this seems to be limited to blocks of 3444 bytes. I'm not sure why this weird block-size is the default, but it is far too small to be called an "xxlarge" block, on a chip with 256KB of RAM.

How do I work around these issues and allocate a single large contiguous RAM buffer, given that my chip has lots of memory?

Parents Reply Children
No Data
Related