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

Flash Data Storage place in memory

Hi,

I'm using the FDS library to store some data (configuration data). For production, I'd like to flash an initial configuration to the nRF52832. I know the storage format because it is well documented in the FDS library documentation, but I don't know where I should write the initial data in flash. In what way does the FDS library figure out where to store the data?

Does anyone have experience with this case?

Parents
  • FormerMember
    0 FormerMember

    FDS/fstorage will place the data in the last available physical pages. Where the FDS/fstorage data ends depends on if there is a bootloader present or not. The end address is calculated by fs_flash_page_end_addr() in fstorage_internal_defs.h.

    If there is no bootloader present, the end address for nRF52832 is 0x80000.

    The amount of flashed used by (reserved for) FDS/fstorage depends on:

    • FDS_VIRTUAL_PAGES (sdk_config.h) (3)
    • FDS_VIRTUAL_PAGE_SIZE (sdk_config.h) (1024, number of 4-byte words)
    • FDS_PHY_PAGE_SIZE (fds_internal_defs.h) (1024, number of 4-byte words)

    The default values for nRF52832 are in parenthesis.

    Based on the above numbers, the start address for the three virtual pages will be the following:

    • 0x80000 - (1 * 0x1000) = 0x7F000)
    • 0x80000 - (2 * 0x1000) = 0x7E000)
    • 0x80000 - (3 * 0x1000) = 0x7D000)

    The stored data will be written up-wards.

    It means that the start address for the FDS/fstorage data in this case is 0x7D000.

    The start address can be doubled check by reading the address, and checking that the address contains the tag 0xDEAD0DE.

Reply
  • FormerMember
    0 FormerMember

    FDS/fstorage will place the data in the last available physical pages. Where the FDS/fstorage data ends depends on if there is a bootloader present or not. The end address is calculated by fs_flash_page_end_addr() in fstorage_internal_defs.h.

    If there is no bootloader present, the end address for nRF52832 is 0x80000.

    The amount of flashed used by (reserved for) FDS/fstorage depends on:

    • FDS_VIRTUAL_PAGES (sdk_config.h) (3)
    • FDS_VIRTUAL_PAGE_SIZE (sdk_config.h) (1024, number of 4-byte words)
    • FDS_PHY_PAGE_SIZE (fds_internal_defs.h) (1024, number of 4-byte words)

    The default values for nRF52832 are in parenthesis.

    Based on the above numbers, the start address for the three virtual pages will be the following:

    • 0x80000 - (1 * 0x1000) = 0x7F000)
    • 0x80000 - (2 * 0x1000) = 0x7E000)
    • 0x80000 - (3 * 0x1000) = 0x7D000)

    The stored data will be written up-wards.

    It means that the start address for the FDS/fstorage data in this case is 0x7D000.

    The start address can be doubled check by reading the address, and checking that the address contains the tag 0xDEAD0DE.

Children
No Data
Related