Hi Devzone:
I have been testing flash storage project.
in my code I have declared a one page flash at 0x40000 for my own use:
#define FLASH_START_ADDR 0x40000 NRF_FSTORAGE_DEF(nrf_fstorage_t cd_settings_fstorage) = { .evt_handler = cd_setting_fstorage_evt_handler, .start_addr = FLASH_START_ADDR, .end_addr = FLASH_START_ADDR + 0x1000, //0x41000 };
And in flash_placement.xml I have inserted the following two lines:
<ProgramSection alignment="4" keep="Yes" load="Yes" name=".fs_data" inputsections="*(.fs_data*)" runin=".fs_data_run"/> <ProgramSection alignment="4" keep="Yes" load="No" name=".fs_data_run" address_symbol="__start_fs_data" end_symbol="__stop_fs_data" />
I am a little uncertain whether the "__start_fs_data" here in flash_placement.xml knows about the "FLASH_START_ADDR 0x40000" I wrote in my code above (first code block in my post).
1. How does segger make that connection between these two? Or do I have to explicitly make that connection myself? If so how?
2. What happens if you declare two or more flash storage sections in your code? Do you need to add more lines in flash_placement.xml? How do the code and the lines in flash_placement.xml connect respectively?
This is a question I have after reading this post:
Thanks.