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

How to allocate 4k buffer in RAM

Hi ,

I am using PCA10001 board.

Now i want create 4k buffer in RAM. Which is good way allocate memory to 4k buffer.

Can i use dynamic(malloc function) or static memory allocation.

in my case code is also larger.

Regards Balaji

Parents
  • Now i want create 4k buffer in RAM. Which is good way allocate memory to 4k buffer.

    Can i use dynamic(malloc function) or static memory allocation.

    The SDK does not uses dynamic memory allocation, so if you wanted to use that you'd have to implement your own memory management scheme.

    If you have enough room, you can simply statically define your buffer, but 4KB sounds a bit excessive.

  • If you need to keep data when the device is powered off, you have to write the data to flash. This has been covered quite extensively here on Developer Zone previously, so I'd recommend you to search around a little and have a look. Basically, you have to use the radio notification feature to avoid writing to flash when the softdevice needs to run the CPU.

Reply Children
No Data
Related