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

What size is one page in fstorage project? How can you write into one address without effecting other addresses in the same page?

Hi Devzone:

After searching through the forum I found out that nrf_fstorage_write can only make 1 to 0. So each write needs an erase operation preceding it.

But erase operation erases an entire page to one. How do you expect us to repeatedly write into one address without effecting other addresses in the same page?

And a few more questions:

1. How big is one page?

2. in NRF_FSTORAGE_DEF, is there any rule defining start_addr and end_addr? Does it need to be on a 32 bytes boundary? what's the range we can use for NVM?

3. Could you confirm that each address contain one byte? Like in the fstorage example, if I write One byte into address 3e000, That means 3e001 is unaffected right?

4. Could you confirm read/write operation address needs to be on 32bytes boundary? Because that's what I infered through error message CLI gave me.  Does that mean if starting address is 3e000, the next address to read and write is 3e020, 3e040, 3e060, 3e080 ...etc?

I wish these basic info are provided in the infocenter. I have been searching the forum and could not find a clear and concise answer.

Thanks.

  • Hello,

    If you want to store and read application data to flash, then I suggest to check out the FDS module, then you don't need to consider the low level hardware limitations (you only need to set the number of flash pages that the FDS module will use to store data, the FDS will take care of the rest): 
    https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_fds.html

    But to answer your questions if you use want to use fstorage module directly:

    1. One flash page (on the nRF52-series) is 1024 words = 4096bytes.

    2. The boundary must be flash pages, so the start address and end address must be a boundary of 1024words.

    3. Each address refer to 1byte, however you always write or read 1word (32-bit). So indirectly you are also writing to 3e001-3e003 when you write to 3e000. 

    4. You can write to 3e000, then next is 3e004, 3e008...

    Best regards,
    Kenneth

Related