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

Storing many small blocks of data in FDS?

Hi All, We have a data logging application, where our typical data packet is small -- roughly 20 bytes. I've been experimenting with FDS for storage, with one record for each packet, and I'm getting my fds write calls returning with an error (7) -- out of memory -- at 200 records. The record count went down and I could write blocks again once the garbage collector ran.

I would like to be able to store thousands of records -- ideally use most of free flash.

  1. Is every data packet stored in its own flash block (presumably 1k) or does FDS have the ability to pack the data into flash blocks?
  2. Is this a configuration problem, or a limitation of FDS?

I am currently porting from SDK11 to SDK12.3 (S132) on a 52832. I plan to roll the application to SDK14 in the near future.

Parents
  • Hi,

    The storage format of FDS is described in this infocenter page. It does not store each record in a separate physical flash page (which by the way is 4kB on nRF52832), but note that each record will have a 12 byte header.

    The flash space available for FDS is configured using the macros FDS_VIRTUAL_PAGE_SIZE and FDS_VIRTUAL_PAGES. What are these set to in your project? Are any other modules using FDS for storing data (Peer manager etc.)?

    Best regards,

    Jørgen

  • Hi, I've experimented with changing the FDS_VIRTUAL_PAGES up to 16 from the default, which I believe was 3. While there was a small change in the number of records I could store, it wasn't 5x. I left the FDS_VIRTUAL_PAGE_SIZE at the default value of 1024. The comment suggests that this value shouldn't be lower.

    Do I need to set either of these values to the size of the actual data I expect to store, or does FDS figure it out from the size argument of the write command?

    BTW: My test data is an eight character string. I did find one bug where I was sending the size in bytes instead of words, so now I am up to around 400 data packets.

Reply
  • Hi, I've experimented with changing the FDS_VIRTUAL_PAGES up to 16 from the default, which I believe was 3. While there was a small change in the number of records I could store, it wasn't 5x. I left the FDS_VIRTUAL_PAGE_SIZE at the default value of 1024. The comment suggests that this value shouldn't be lower.

    Do I need to set either of these values to the size of the actual data I expect to store, or does FDS figure it out from the size argument of the write command?

    BTW: My test data is an eight character string. I did find one bug where I was sending the size in bytes instead of words, so now I am up to around 400 data packets.

Children
No Data
Related