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

is FDS overrides Application Location

hi, i am using FDS to store some Data in nRF51 Development kit using temporary application. it is around 2kb. after that i am flashing main Application. is my application overrides FDS data.

if not what is the Starting location(Address) of Flash using FDS. if the application is very large in size is it overrides.

my application ld script is this,

MEMORY

{

  FLASH (rx) : ORIGIN = 0x1b000, LENGTH = 0x20000

  RAM (rwx) :  ORIGIN = 0x20002000, LENGTH = 0x6000

}

SECTIONS

{

  .fs_data :

  {

    PROVIDE(__start_fs_data = .);

    KEEP(*(.fs_data))

    PROVIDE(__stop_fs_data = .);

  } > RAM

} INSERT AFTER .data;

INCLUDE "nrf51_common.ld"

And how to protect my FDS data without override.

  • Hi Saiteja,

    FDS wouldn't decide where the data should be stored on flash. It's fstorage does that. Fstorage store data starts from FS_PAGE_END_ADDR and going downward.

    FS_PAGE_END_ADDR is located at the top of the flash, if you don't have bootloader it will be at address 0x80000 if you have bootloader, it will start at just before the start address of the bootloader. Please see fstorage_internal_defs.h.

    How big would the FDS occupies on flash is defined by the FDS_VIRTUAL_PAGES that usually set to 3.

    When you flash your application it will start from the beginning of the flash (address 0x00) or where the softdevice ends.

    You need to make sure your application size is not too big that it overlapping the fstorage flash area occupies.

    The Section .fs_data is not related to the address fstorage store data, it's the section right after .data to store fstorage configuration. .data is located right after the code of the application.

Related