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

Using NRF9160 with Flash Circular Buffer (FCB)

Hey, everyone.

I am currently working with NRF9160, NCS V1.3.0, developing code for an application that requires periodically storing  important information in flash, and send the accumulated information whenever possible. I looked through the Zephyr libraries and came across with Flash Circular Buffer (FCB) and seems perfect for this use-case. 

I could not find an example code of its usage, though; I tried to put together a simple code following API instructions and fcb_init() returns negative error code (-EIO): I attempted to use "storage" partition. 

Could anyone, please, provide some guidance on how to use this library with the NRF9160 flash partitions?

Thanks in advance, 
Luis.

Parents Reply Children
  • Hey, Simon. 

    I already checked the FCB sample code, thanks for pointing it out. I have not dug into its deep-detailed implementations, but I see they disable MPU and set some other configurations that do not seem ideal for a non-secure application in the NRF9160. We've used NVS before and since it has worked well for us, we will move forward with it.

    Best regards,
    Luis.

  • Hi - the link no longer works and there is no longer any \fcb\ directory under \subsys\fs - any other pointers?

  • Hello A lot of time has passed but there is still no example how to use FCB. There is no sample for FCB. There are tests but they are not very clear. There is also a ridiculus statement in documentation:

    The following data structure describes the FCB itself. First part should be filled in by the user before calling fcb_init. The second part is used by FCB for its internal bookkeeping.

    But which part is first and which is second? It isn't described anywhere. How should I set f_sector_cnt, f_scratch_cnt, f_sectors? Fields in struct fcb have shorts description, but they also don't provide information about optimal settings.

Related