What is the best way to store > 40K of data on nRF52832 before it can be processed?

We have sensor data coming at regular interval of 40B at 10msec interval. We need to collect it for a minimum of 10 sec before we can process it and then reuse the same buffer/memory location to write new set of data.

50% of flash and ram is already being used by code itself.

What's the best way to store this?

Parents
  • Hi

    RAM would be best to use for this purpose, as Flash would likely be a bit slow, however, 40kB of data would not fit in the RAM of nRF52832 if you use 50% already I'm afraid. The easiest way of doing this, would be to move the application to a larger SoC (nRF52833 or nRF52840 that has 128 and 256kB of RAM , then stating a static buffer in RAM for the amount you need that you can write the data to before processing it and then reusing it when emptied. To guide you, please let me know what SDK you're using for development, the nRF5 SDK or nRF Connect SDK?

    If you're restricted to the nRF52832 it might be possible to do a hybrid solution, storing as much as possible in RAM, and some of it in Flash, but I personally doubt the data will write to flash quickly enough. This will also be quite a bit harder to implement I think.

    Best regards,

    Simon

Reply
  • Hi

    RAM would be best to use for this purpose, as Flash would likely be a bit slow, however, 40kB of data would not fit in the RAM of nRF52832 if you use 50% already I'm afraid. The easiest way of doing this, would be to move the application to a larger SoC (nRF52833 or nRF52840 that has 128 and 256kB of RAM , then stating a static buffer in RAM for the amount you need that you can write the data to before processing it and then reusing it when emptied. To guide you, please let me know what SDK you're using for development, the nRF5 SDK or nRF Connect SDK?

    If you're restricted to the nRF52832 it might be possible to do a hybrid solution, storing as much as possible in RAM, and some of it in Flash, but I personally doubt the data will write to flash quickly enough. This will also be quite a bit harder to implement I think.

    Best regards,

    Simon

Children
  • Thankyou for the reply. I am using SDK 17.1.0 right now. Right now I am restricted to nRF52832 and need to collect data lets say @10ms interval for around 10-15 sec to be able to process it and then transmit it/advertise it. Also can we run multiple threads to gather data, process previously gathered data and generated another 40Bytes of data and advertise that data? I am still exploring that option. Will the buffer requirement increase?

    Also what's the rate at which processor writes data to flash and is there a cap on how many cycles of erase and over-writing the same location are permitted?

Related