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

Fstorage Address Range

Using SD S140 7.2.0 SDK 17 (nRF52840).

I cannot write to internal flash addresses above 0x78000.

I am calling nrf_fstorage_init setting start_addr=0x68000 and end_addr=0xF0FFF.

When using nrf_fstorage_write to for addresses above 0x78000 all seems to go well but no data is actually written (no hard fault or ASSERT or bad return value).

0x78000 seems to be the DFU start address on the x32 MCU. But we DO use x40 settings with S140 and setting proper address range on the ICF file (using IAR).

Any ideas?

BTW - when writing directly using the flash registers (NRF_NVMC->CONFIG) i DO manage to write to this memory space.

This is the ICF (linker) file:

define symbol __ICFEDIT_region_SD_start__ = 0x00000;
define symbol __ICFEDIT_region_SD_end__ = 0x26FFF;
define symbol __ICFEDIT_region_ROM_start__ = 0x27000;
define symbol __ICFEDIT_region_ROM_end__ = 0x67FFF;
define symbol __ICFEDIT_region_DROM_start__ = 0x68000;
define symbol __ICFEDIT_region_DROM_end__ = 0xF0FFF;
define symbol __ICFEDIT_region_DFU_start__ = 0xF1000;
define symbol __ICFEDIT_region_DFU_end__ = 0xFdfff;
define symbol __ICFEDIT_region_DDFU_start__ = 0xFF000;
define symbol __ICFEDIT_region_DDFU_end__ = 0xFFFFF;

Parents
  • Hi,

    If we use e.g. the ble_app_buttonless_dfu example in the SDK as an example, the pca10056/S140 linker file looks like this:

    /*###ICF### Section handled by ICF editor, don't touch! ****/
    /*-Editor annotation file-*/
    /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
    /*-Specials-*/
    define symbol __ICFEDIT_intvec_start__ = 0x27000;
    /*-Memory Regions-*/
    define symbol __ICFEDIT_region_ROM_start__   = 0x27000;
    define symbol __ICFEDIT_region_ROM_end__     = 0xeffff;
    define symbol __ICFEDIT_region_RAM_start__   = 0x20002270;
    define symbol __ICFEDIT_region_RAM_end__     = 0x2003ffff;
    export symbol __ICFEDIT_region_RAM_start__;
    export symbol __ICFEDIT_region_RAM_end__;
    /*-Sizes-*/
    define symbol __ICFEDIT_size_cstack__   = 8192;
    define symbol __ICFEDIT_size_heap__     = 8192;
    /**** End of ICF editor section. ###ICF###*/
    
    define memory mem with size = 4G;
    define region ROM_region   = mem:[from __ICFEDIT_region_ROM_start__   to __ICFEDIT_region_ROM_end__];
    define region RAM_region   = mem:[from __ICFEDIT_region_RAM_start__   to __ICFEDIT_region_RAM_end__];
    
    define symbol __region_uicr_bootloader_start_address_start = 0x10001014;
    define symbol __region_uicr_bootloader_start_address_length = 0x4;
    define symbol __start_uicr_bootloader_start_address = __region_uicr_bootloader_start_address_start;
    define symbol __stop_uicr_bootloader_start_address = __region_uicr_bootloader_start_address_start + __region_uicr_bootloader_start_address_length;
    export symbol __start_uicr_bootloader_start_address;
    export symbol __stop_uicr_bootloader_start_address;
    
    define block CSTACK    with alignment = 8, size = __ICFEDIT_size_cstack__   { };
    define block HEAP      with alignment = 8, size = __ICFEDIT_size_heap__     { };
    define block RO_END    with alignment = 8, size = 0     { };
    
    initialize by copy { readwrite };
    do not initialize  { section .noinit };
    
    keep { section .intvec };
    place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
    place in ROM_region   { readonly,
                            block RO_END };
    place in RAM_region   { readwrite,
                            block CSTACK,
                            block HEAP };
    
    

    If we then look at the bootloader examples, examples/secure_bootloader, we see that 0x78000 is the start address for the pca10040/S132 project. But the pca10056/s140 project the start address is 0xF8000. So I would recommend that you double check that you are using the correct bootloader project(pca10056/S140).

Reply
  • Hi,

    If we use e.g. the ble_app_buttonless_dfu example in the SDK as an example, the pca10056/S140 linker file looks like this:

    /*###ICF### Section handled by ICF editor, don't touch! ****/
    /*-Editor annotation file-*/
    /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
    /*-Specials-*/
    define symbol __ICFEDIT_intvec_start__ = 0x27000;
    /*-Memory Regions-*/
    define symbol __ICFEDIT_region_ROM_start__   = 0x27000;
    define symbol __ICFEDIT_region_ROM_end__     = 0xeffff;
    define symbol __ICFEDIT_region_RAM_start__   = 0x20002270;
    define symbol __ICFEDIT_region_RAM_end__     = 0x2003ffff;
    export symbol __ICFEDIT_region_RAM_start__;
    export symbol __ICFEDIT_region_RAM_end__;
    /*-Sizes-*/
    define symbol __ICFEDIT_size_cstack__   = 8192;
    define symbol __ICFEDIT_size_heap__     = 8192;
    /**** End of ICF editor section. ###ICF###*/
    
    define memory mem with size = 4G;
    define region ROM_region   = mem:[from __ICFEDIT_region_ROM_start__   to __ICFEDIT_region_ROM_end__];
    define region RAM_region   = mem:[from __ICFEDIT_region_RAM_start__   to __ICFEDIT_region_RAM_end__];
    
    define symbol __region_uicr_bootloader_start_address_start = 0x10001014;
    define symbol __region_uicr_bootloader_start_address_length = 0x4;
    define symbol __start_uicr_bootloader_start_address = __region_uicr_bootloader_start_address_start;
    define symbol __stop_uicr_bootloader_start_address = __region_uicr_bootloader_start_address_start + __region_uicr_bootloader_start_address_length;
    export symbol __start_uicr_bootloader_start_address;
    export symbol __stop_uicr_bootloader_start_address;
    
    define block CSTACK    with alignment = 8, size = __ICFEDIT_size_cstack__   { };
    define block HEAP      with alignment = 8, size = __ICFEDIT_size_heap__     { };
    define block RO_END    with alignment = 8, size = 0     { };
    
    initialize by copy { readwrite };
    do not initialize  { section .noinit };
    
    keep { section .intvec };
    place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
    place in ROM_region   { readonly,
                            block RO_END };
    place in RAM_region   { readwrite,
                            block CSTACK,
                            block HEAP };
    
    

    If we then look at the bootloader examples, examples/secure_bootloader, we see that 0x78000 is the start address for the pca10040/S132 project. But the pca10056/s140 project the start address is 0xF8000. So I would recommend that you double check that you are using the correct bootloader project(pca10056/S140).

Children
No Data
Related