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
    1. When you write a record of N bytes to flash using fds, that record occupies N+12 bytes in flash.

    2. It is a configuration problem, increase FDS_VIRTUAL_PAGES to increase the number of pages used by fds.

    Roughly, to store 2 thousand records containing 20 bytes of data you will need:

    20 (data) + 12 (fds header) * 2000 (n. of records) = 64000 bytes

    Given that a physical flash page is 4096 bytes large, you'd need 15 pages + 1 to be used for garbage collection.

Reply
    1. When you write a record of N bytes to flash using fds, that record occupies N+12 bytes in flash.

    2. It is a configuration problem, increase FDS_VIRTUAL_PAGES to increase the number of pages used by fds.

    Roughly, to store 2 thousand records containing 20 bytes of data you will need:

    20 (data) + 12 (fds header) * 2000 (n. of records) = 64000 bytes

    Given that a physical flash page is 4096 bytes large, you'd need 15 pages + 1 to be used for garbage collection.

Children
No Data
Related