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

How to Design Flash Data storage Records in FDS module.

Hi Team,

My requirement is to Read and Write the data of the variables at specific Flash storage/ Flash data storage(FDS) address.

Eg;

__root const uint16_t FLA_kold_version @ (0x3e000) = 0x0000;

// Days date rollover started (Day only, not Ticks)
__root const uint16_t FLA_rollover_started @ (0x3e000 + 0x10) = 0x0000;

// Days date kold expires (Day only, not Ticks)
__root const uint16_t FLA_kold_day_expires @ (0x3e000+ 0x20) = 0x0000; 

etc..  like that we need to create the sequence of variables with fixed base address.

Is there any mechanism to create the variable in above manner in Flash storage section(FS) or Flash Data Storage(FDS) with out corrupting the other Record variables.

In FDS ,If we want to write the data as Records, what is the Min size of data we can write though one Record, we have various data sizes of variables like, 1 byte, 4bytes, array of bytes.How to handle different sizes of variables with FDS Records, we can write odd address( 0x3e001) variables as well, like in Flash storage it is not accepted to write odd address(address & 0x03).

How to split the Records in one page, we can create 'n' of records but sum of all record variable sizes must be with in the page size(4096) as per my knowledge.

Just we need the Records creation mechanism for above scenario. Suppose we have 120 different variables we need to create 120 unique records ?

Could any one suggest me the solution for above requirement. We Need to deliver this things to customer on high priority.

Regards,

Srinivas.V

  • Hi Bjorn,

    Thanks for your reply.

    We need to read the fds data once we got fds event write success (p_evt->result == NRF_SUCCESS), but for read operation there is no specific event in handler, means read always success.

    Data also we aligned with 4 byte boundary always, any we have check for this one, this case we not failing.

    We are suspecting SD or any delays required before read after write operation.

    Can we know exactly how much it will take to write 4 bytes to Fds or fs. or for one page write(256 bytes)

    Regards,

    Srinivas.V

  • Srinivas V said:
    We need to read the fds data once we got fds event write success (p_evt->result == NRF_SUCCESS), but for read operation there is no specific event in handler, means read always success.

    Can you list the order of FDS API calls you are doing when you read the wrong records value? 

    I would assume that its something like this: 

    1. Call fds_record_write
    2. Wait for the FDS_EVT_WRITE event where the result is NRF_SUCCESS 
    3. Call fds_record_open with the  same descriptor that was returned by fds_record_write in step one
    4. Call fds_record_close

    Are you frequently updating the record? Or do you write the record once and then you only read the record afterwards?

    Srinivas V said:
    Can we know exactly how much it will take to write 4 bytes to Fds or fs. or for one page write(256 bytes)

     The flash timing can be seen in the Flash programming section of the NVMC peripherals electrical specification. 

     

Related