This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Porting project from SDK12.3 to SDK17 and SD132 to SD140: Unable to start custom Application from custom Bootloader (no DFU) starting after SD in flash storage

Hi,

We have a product based on nrf52840 which is already in production for several years.
It was built over SoftDevice132 and SDK 12.3. 

The project has 2 components:

  • custom bootloader (no DFU) which has only one meaning: updates the app if it finds an upgrade on the flash storage
  • application: uses BLE, UART, etc. It receives app updates via BLE, stores them on flash and resets. The bootloader runs, performs the upgrade and starts the [new] app.

The bootloader is located right after the softdevice and the app is located just after the bootloader. 

Flash structure: MBR | SD132 | BOOTLOADER | APP | … free … | 

I am currently porting the project to SD140 and SDK17. 

I started porting the custom bootloader and the main problem I have now is starting the app . 

From what I read in the bootloader library, the expected flash structure is as follows:

MBR | SD140 | APP | … | Bootloader | MBR Storage Parameters | Bootloader Settings| 

From what I see in the bootloader samples in SDK17, the bootloader starts the application by calling ‘nrf_bootloader_app_start’, which seems to run the SoftDevice (flash addr 0x1000) which I am guessing will default to jumping the execution at 0x26000 (which it assumes is the starting adress of app).

In this post it is mentioned that Application MUST follow the SD on the flash storage: https://devzone.nordicsemi.com/f/nordic-q-a/39033/how-do-i-change-the-application-bootloader-start-address

Is there any way to maintain the current project flash structure (MBR | SD | BOOTLOADER | APP) and still be able to start the app from bootloader? Maybe a workaround?

And, if my custom bootloader does not use DFU, do I still need the following structures held in flash storage?

‘MBR Storage Parameters’ and ‘Bootloader Settings’

Thank you.

Mircea



Parents
  • Update2:

    I build sample 'secure_bootloader' as BOOTLOADER and loaded sample 'gpay_ble_app_hrs_freertos_pca10056_s140' to flash (loaded by default at 0x27000).


    Bootloader starts but it fails to execute APP - exception.

    Application runs well as standalone application but not in conjunction with Bootloader

    Ideas? Is something missing?

  • Hi Mircea,

    Mircea Coman said:
    Bootloader starts but it fails to execute APP

    You must generate and flash the bootloader settings page (Generating and displaying bootloader settings) to tell the bootloader that there is a valid application present. It will refuse to boot the application without it.

    From what I see in the bootloader samples in SDK17, the bootloader starts the application by calling ‘nrf_bootloader_app_start’, which seems to run the SoftDevice (flash addr 0x1000) which I am guessing will default to jumping the execution at 0x26000 (which it assumes is the starting adress of app).

    This approach is only valid when the application starts on top of the Softdevice. Did you try using the app start code you had in your original project? It should still work with the new Softdevice.

    Best regards,

    Vidar

  • Hi Vidar,

    I was able to tweak the custom bootloader in such a way that now it starts the APP, no matter at what address it resides on the flash (by extracting the function 'app_start()' from 'nrf_bootloader_app_start_final.c' and mixing it with function 'nrf_bootloader_app_start' from SDK12.3. Can you please take a look and check if something's missing?

    BUT I have a strange problem: it works ONLY if the bootloader is built with SIZE OPTIMIZATION (2) or Build Optimization (1). Otherwise: exception.

    Ideas?

    Bootloader code:

    #include <stdint.h>
    #include "boards.h"
    #include "nrf_mbr.h"
    #include "app_error.h"
    #include "app_error_weak.h"
    #include "nrf_bootloader_info.h"
    #include "nrf_delay.h"
    
    void app_error_handler(uint32_t error_code, uint32_t line_num, const uint8_t * p_file_name)
    {
    }
    
    
    void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info)
    {
    }
    
    
    void app_error_handler_bare(uint32_t error_code)
    {
    }
    
    void jump_to_addr2(uint32_t new_msp, uint32_t addr)
    {
        __set_MSP(new_msp);
        ((void (*)(void))addr)();
    }
    
    
    void app_start2(uint32_t vector_table_addr)
    {
        const uint32_t current_isr_num = (__get_IPSR() & IPSR_ISR_Msk);
        const uint32_t new_msp         = *((uint32_t *)(vector_table_addr));                    // The app's Stack Pointer is found as the first word of the vector table.
        const uint32_t reset_handler   = *((uint32_t *)(vector_table_addr + sizeof(uint32_t))); // The app's Reset Handler is found as the second word of the vector table.
    
        __set_CONTROL(0x00000000);   // Set CONTROL to its reset value 0.
        __set_PRIMASK(0x00000000);   // Set PRIMASK to its reset value 0.
        __set_BASEPRI(0x00000000);   // Set BASEPRI to its reset value 0.
        __set_FAULTMASK(0x00000000); // Set FAULTMASK to its reset value 0.
    
        ASSERT(current_isr_num == 0); // If this is triggered, the CPU is currently in an interrupt.
    
        // The CPU is in Thread mode (main context).
        jump_to_addr2(new_msp, reset_handler); // Jump directly to the App's Reset Handler.
    }
    
    void nrf_bootloader_app_start_old(uint32_t start_addr)
    {
        printf("Running nrf_bootloader_app_start with address: 0x%08x\r\n", start_addr);
    
        uint32_t err_code;
    
        //NRF_LOG_INFO("Initializing SD in mbr\r\n");
        err_code = nrf_dfu_mbr_init_sd();
        if(err_code != NRF_SUCCESS)
        {
            printf("Failed running nrf_dfu_mbr_init_sd\r\n");
            return;
        }
    
        // Disable interrupts
        printf("Disabling interrupts\r\n");
    
        NVIC->ICER[0]=0xFFFFFFFF;
    #if defined(__NRF_NVIC_ISER_COUNT) && __NRF_NVIC_ISER_COUNT == 2
        NVIC->ICER[1]=0xFFFFFFFF;
    #endif
    
        // Set the sd softdevice vector table base address
        printf("Setting SD vector table base: 0x%08x\r\n", start_addr);
        err_code = sd_softdevice_vector_table_base_set(start_addr);
        if(err_code != NRF_SUCCESS)
        {
            printf("Failed running sd_softdevice_vector_table_base_set\r\n");
            return;
        }
    
        // Run application
        //nrf_bootloader_app_start_impl(start_addr);
    	app_start2(start_addr);
    }
    
    int main(void)
    {  
    	/* APP start flash address: 0x3D000*/
    	nrf_bootloader_app_start_old(0x3D000);
    }
    

    XML flash placement file:

    <!DOCTYPE Linker_Placement_File>
    <Root name="Flash Section Placement">
      <MemorySegment name="FLASH1" start="$(FLASH_PH_START)" size="$(FLASH_PH_SIZE)">
        <ProgramSection load="no" name=".reserved_flash" start="$(FLASH_PH_START)" size="$(FLASH_START)-$(FLASH_PH_START)" />
        <ProgramSection alignment="0x100" load="Yes" name=".vectors" start="$(FLASH_START)" />
        <ProgramSection alignment="4" load="Yes" name=".init" />
        <ProgramSection alignment="4" load="Yes" name=".init_rodata" />
    	<ProgramSection alignment="4" keep="Yes" load="Yes" name=".sdh_ble_observers" inputsections="*(SORT(.sdh_ble_observers*))" address_symbol="__start_sdh_ble_observers" end_symbol="__stop_sdh_ble_observers" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".sdh_req_observers" inputsections="*(SORT(.sdh_req_observers*))" address_symbol="__start_sdh_req_observers" end_symbol="__stop_sdh_req_observers" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".sdh_state_observers" inputsections="*(SORT(.sdh_state_observers*))" address_symbol="__start_sdh_state_observers" end_symbol="__stop_sdh_state_observers" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".sdh_stack_observers" inputsections="*(SORT(.sdh_stack_observers*))" address_symbol="__start_sdh_stack_observers" end_symbol="__stop_sdh_stack_observers" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".sdh_soc_observers" inputsections="*(SORT(.sdh_soc_observers*))" address_symbol="__start_sdh_soc_observers" end_symbol="__stop_sdh_soc_observers" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".nrf_sections" address_symbol="__start_nrf_sections" />
        <ProgramSection alignment="4" load="Yes" name=".text" />
        
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".fs_data"  inputsections="*(.fs_data*)" runin=".fs_data_run"/>
        <ProgramSection alignment="4" load="Yes" name=".dtors" />
        <ProgramSection alignment="4" load="Yes" name=".ctors" />
        <ProgramSection alignment="4" load="Yes" name=".rodata" size="0x4" />
        <ProgramSection alignment="4" load="Yes" name=".ARM.exidx" address_symbol="__exidx_start" end_symbol="__exidx_end" />
        <ProgramSection alignment="4" load="Yes" runin=".fast_run" name=".fast" />
        <ProgramSection alignment="4" load="Yes" runin=".data_run" name=".data" />
        <ProgramSection alignment="4" load="Yes" runin=".tdata_run" name=".tdata" />
      </MemorySegment>
      <MemorySegment name="RAM1" start="$(RAM_PH_START)" size="$(RAM_PH_SIZE)">
        <ProgramSection load="no" name=".reserved_ram" start="$(RAM_PH_START)" size="$(RAM_START)-$(RAM_PH_START)" />
        <ProgramSection alignment="0x100" load="No" name=".vectors_ram" start="$(RAM_START)" address_symbol="__app_ram_start__"/>
        <ProgramSection alignment="4" keep="Yes" load="No" name=".nrf_sections_run" address_symbol="__start_nrf_sections_run" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".fs_data_run" address_symbol="__start_fs_data" end_symbol="__stop_fs_data" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".nrf_sections_run_end" address_symbol="__end_nrf_sections_run" />
        <ProgramSection alignment="4" load="No" name=".fast_run" />
        <ProgramSection alignment="4" load="No" name=".data_run" />
        <ProgramSection alignment="4" load="No" name=".tdata_run" />
        <ProgramSection alignment="4" load="No" name=".bss" />
        <ProgramSection alignment="4" load="No" name=".tbss" />
        <ProgramSection alignment="4" load="No" name=".non_init" />
        <ProgramSection alignment="4" size="__HEAPSIZE__" load="No" name=".heap" />
        <ProgramSection alignment="8" size="__STACKSIZE__" load="No" place_from_segment_end="Yes" name=".stack"  address_symbol="__StackLimit" end_symbol="__StackTop"/>
        <ProgramSection alignment="8" size="__STACKSIZE_PROCESS__" load="No" name=".stack_process" />
      </MemorySegment>
      <MemorySegment name="uicr_bootloader_start_address" start="0x10001014" size="0x4">
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".uicr_bootloader_start_address" address_symbol="__start_uicr_bootloader_start_address" end_symbol="__stop_uicr_bootloader_start_address" start = "0x10001014" size="0x4" />
      </MemorySegment>
      
    </Root>
    

    .emProject:

    :

    <!DOCTYPE CrossStudio_Project_File>
    <solution
      Name="secure_bootloader_ble_s140_pca10056_debug"
      target="8"
      version="2">
      <project Name="secure_bootloader_ble_s140_pca10056_debug">
        <configuration
          Name="Common"
          arm_architecture="v7EM"
          arm_core_type="Cortex-M4"
          arm_endian="Little"
          arm_fp_abi="Hard"
          arm_fpu_type="FPv4-SP-D16"
          arm_linker_heap_size="0"
          arm_linker_process_stack_size="0"
          arm_linker_stack_size="512"
          arm_linker_treat_warnings_as_errors="No"
          arm_simulator_memory_simulation_parameter="RWX 00000000,00100000,FFFFFFFF;RWX 20000000,00010000,CDCDCDCD"
          arm_target_device_name="nRF52840_xxAA"
          arm_target_interface_type="SWD"
          c_preprocessor_definitions="BLE_STACK_SUPPORT_REQD;BOARD_PCA10056;CONFIG_GPIO_AS_PINRESET;DEBUG_NRF;INITIALIZE_USER_SECTIONS;NO_VTOR_CONFIG;NRF52840_XXAA;NRF_SD_BLE_API_VERSION=7;S140;SOFTDEVICE_PRESENT;SVC_INTERFACE_CALL_AS_NORMAL_FUNCTION;"
          c_user_include_directories="../../config;../../../../../components/ble/common;../../../../../components/boards;../../../../../components/libraries/atomic;../../../../../components/libraries/atomic_fifo;../../../../../components/libraries/balloc;../../../../../components/libraries/bootloader;../../../../../components/libraries/bootloader/ble_dfu;../../../../../components/libraries/bootloader/dfu;../../../../../components/libraries/crc32;../../../../../components/libraries/crypto;../../../../../components/libraries/crypto/backend/cc310;../../../../../components/libraries/crypto/backend/cc310_bl;../../../../../components/libraries/crypto/backend/cifra;../../../../../components/libraries/crypto/backend/mbedtls;../../../../../components/libraries/crypto/backend/micro_ecc;../../../../../components/libraries/crypto/backend/nrf_hw;../../../../../components/libraries/crypto/backend/nrf_sw;../../../../../components/libraries/crypto/backend/oberon;../../../../../components/libraries/crypto/backend/optiga;../../../../../components/libraries/delay;../../../../../components/libraries/experimental_section_vars;../../../../../components/libraries/fstorage;../../../../../components/libraries/log;../../../../../components/libraries/log/src;../../../../../components/libraries/mem_manager;../../../../../components/libraries/memobj;../../../../../components/libraries/mutex;../../../../../components/libraries/queue;../../../../../components/libraries/ringbuf;../../../../../components/libraries/scheduler;../../../../../components/libraries/stack_info;../../../../../components/libraries/strerror;../../../../../components/libraries/svc;../../../../../components/libraries/util;../../../../../components/softdevice/common;../../../../../components/softdevice/s140/headers;../../../../../components/softdevice/s140/headers/nrf52;../../../../../components/toolchain/cmsis/include;../..;../../../../../external/fprintf;../../../../../external/nano-pb;../../../../../external/nrf_cc310/include;../../../../../external/nrf_cc310_bl/include;../../../../../external/nrf_oberon;../../../../../external/nrf_oberon/include;../../../../../external/segger_rtt;../../../../../integration/nrfx;../../../../../modules/nrfx;../../../../../modules/nrfx/hal;../../../../../modules/nrfx/mdk;../config;"
          debug_additional_load_file="../../../../../components/softdevice/s140/hex/s140_nrf52_7.2.0_softdevice.hex"
          debug_register_definition_file="../../../../../modules/nrfx/mdk/nrf52840.svd"
          debug_start_from_entry_point_symbol="No"
          debug_target_connection="J-Link"
          gcc_debugging_level="Level 3"
          gcc_entry_point="Reset_Handler"
          linker_output_format="hex"
          linker_printf_fmt_level="long"
          linker_printf_width_precision_supported="Yes"
          linker_scanf_fmt_level="long"
          linker_section_placement_file="flash_placement.xml"
          linker_section_placement_macros="FLASH_PH_START=0x0;FLASH_PH_SIZE=0x100000;RAM_PH_START=0x20000000;RAM_PH_SIZE=0x40000;FLASH_START=0x27000;FLASH_SIZE=0xd000;RAM_START=0x20005978;RAM_SIZE=0x3a688"
          linker_section_placements_segments="FLASH1 RX 0x0 0x100000;RAM1 RWX 0x20000000 0x40000;uicr_bootloader_start_address RX 0x10001014 0x4;"
          macros="CMSIS_CONFIG_TOOL=../../../../../external_tools/cmsisconfig/CMSIS_Configuration_Wizard.jar"
          project_directory=""
          project_type="Executable" />
        <folder Name="Segger Startup Files">
          <file file_name="$(StudioDir)/source/thumb_crt0.s" />
        </folder>
        <folder Name="nRF_Libraries">
          <file file_name="../../../../../components/libraries/util/app_error_weak.c" />
          <file file_name="../../../../../components/libraries/util/app_util_platform.c" />
          <file file_name="../../../../../components/libraries/util/nrf_assert.c">
            <configuration Name="Release" build_exclude_from_build="No" />
          </file>
          <file file_name="../../../../../components/libraries/atomic_fifo/nrf_atfifo.c">
            <configuration Name="Release" build_exclude_from_build="No" />
          </file>
          <file file_name="../../../../../components/libraries/atomic/nrf_atomic.c" />
          <file file_name="../../../../../components/libraries/fstorage/nrf_fstorage.c" />
          <file file_name="../../../../../components/libraries/fstorage/nrf_fstorage_nvmc.c" />
          <file file_name="../../../../../components/libraries/experimental_section_vars/nrf_section_iter.c" />
          <file file_name="../../../../../components/libraries/fstorage/nrf_fstorage_sd.c" />
        </folder>
        <folder Name="nRF_SoftDevice">
          <file file_name="../../../../../components/softdevice/common/nrf_sdh.c" />
          <configuration Name="Release" build_exclude_from_build="No" />
        </folder>
        <folder Name="nRF_Drivers" />
        <folder Name="Application">
          <file file_name="../../main.c" />
          <file file_name="../config/sdk_config.h" />
        </folder>
        <folder Name="nRF_Segger_RTT">
          <file file_name="../../../../../external/segger_rtt/SEGGER_RTT.c" />
          <file file_name="../../../../../external/segger_rtt/SEGGER_RTT_Syscalls_SES.c" />
          <file file_name="../../../../../external/segger_rtt/SEGGER_RTT_printf.c" />
        </folder>
        <folder Name="nRF_Bootloader">
          <file file_name="../../../../../components/libraries/bootloader/nrf_bootloader_info.c">
            <configuration Name="Release" build_exclude_from_build="No" />
          </file>
          <configuration Name="Release" build_exclude_from_build="No" />
          <file file_name="../../../../../components/libraries/bootloader/dfu/nrf_dfu_mbr.c">
            <configuration Name="Release" build_exclude_from_build="No" />
          </file>
        </folder>
        <folder Name="None">
          <file file_name="../../../../../modules/nrfx/mdk/ses_startup_nrf52840.s" />
          <file file_name="../../../../../modules/nrfx/mdk/ses_startup_nrf_common.s" />
          <file file_name="../../../../../modules/nrfx/mdk/system_nrf52840.c" />
        </folder>
        <configuration Name="Release" gcc_optimization_level="Level 2 for size" />
      </project>
      <configuration
        Name="Release"
        gcc_optimization_level="Optimize For Size"
        link_time_optimization="No" />
    </solution>
    

Reply
  • Hi Vidar,

    I was able to tweak the custom bootloader in such a way that now it starts the APP, no matter at what address it resides on the flash (by extracting the function 'app_start()' from 'nrf_bootloader_app_start_final.c' and mixing it with function 'nrf_bootloader_app_start' from SDK12.3. Can you please take a look and check if something's missing?

    BUT I have a strange problem: it works ONLY if the bootloader is built with SIZE OPTIMIZATION (2) or Build Optimization (1). Otherwise: exception.

    Ideas?

    Bootloader code:

    #include <stdint.h>
    #include "boards.h"
    #include "nrf_mbr.h"
    #include "app_error.h"
    #include "app_error_weak.h"
    #include "nrf_bootloader_info.h"
    #include "nrf_delay.h"
    
    void app_error_handler(uint32_t error_code, uint32_t line_num, const uint8_t * p_file_name)
    {
    }
    
    
    void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info)
    {
    }
    
    
    void app_error_handler_bare(uint32_t error_code)
    {
    }
    
    void jump_to_addr2(uint32_t new_msp, uint32_t addr)
    {
        __set_MSP(new_msp);
        ((void (*)(void))addr)();
    }
    
    
    void app_start2(uint32_t vector_table_addr)
    {
        const uint32_t current_isr_num = (__get_IPSR() & IPSR_ISR_Msk);
        const uint32_t new_msp         = *((uint32_t *)(vector_table_addr));                    // The app's Stack Pointer is found as the first word of the vector table.
        const uint32_t reset_handler   = *((uint32_t *)(vector_table_addr + sizeof(uint32_t))); // The app's Reset Handler is found as the second word of the vector table.
    
        __set_CONTROL(0x00000000);   // Set CONTROL to its reset value 0.
        __set_PRIMASK(0x00000000);   // Set PRIMASK to its reset value 0.
        __set_BASEPRI(0x00000000);   // Set BASEPRI to its reset value 0.
        __set_FAULTMASK(0x00000000); // Set FAULTMASK to its reset value 0.
    
        ASSERT(current_isr_num == 0); // If this is triggered, the CPU is currently in an interrupt.
    
        // The CPU is in Thread mode (main context).
        jump_to_addr2(new_msp, reset_handler); // Jump directly to the App's Reset Handler.
    }
    
    void nrf_bootloader_app_start_old(uint32_t start_addr)
    {
        printf("Running nrf_bootloader_app_start with address: 0x%08x\r\n", start_addr);
    
        uint32_t err_code;
    
        //NRF_LOG_INFO("Initializing SD in mbr\r\n");
        err_code = nrf_dfu_mbr_init_sd();
        if(err_code != NRF_SUCCESS)
        {
            printf("Failed running nrf_dfu_mbr_init_sd\r\n");
            return;
        }
    
        // Disable interrupts
        printf("Disabling interrupts\r\n");
    
        NVIC->ICER[0]=0xFFFFFFFF;
    #if defined(__NRF_NVIC_ISER_COUNT) && __NRF_NVIC_ISER_COUNT == 2
        NVIC->ICER[1]=0xFFFFFFFF;
    #endif
    
        // Set the sd softdevice vector table base address
        printf("Setting SD vector table base: 0x%08x\r\n", start_addr);
        err_code = sd_softdevice_vector_table_base_set(start_addr);
        if(err_code != NRF_SUCCESS)
        {
            printf("Failed running sd_softdevice_vector_table_base_set\r\n");
            return;
        }
    
        // Run application
        //nrf_bootloader_app_start_impl(start_addr);
    	app_start2(start_addr);
    }
    
    int main(void)
    {  
    	/* APP start flash address: 0x3D000*/
    	nrf_bootloader_app_start_old(0x3D000);
    }
    

    XML flash placement file:

    <!DOCTYPE Linker_Placement_File>
    <Root name="Flash Section Placement">
      <MemorySegment name="FLASH1" start="$(FLASH_PH_START)" size="$(FLASH_PH_SIZE)">
        <ProgramSection load="no" name=".reserved_flash" start="$(FLASH_PH_START)" size="$(FLASH_START)-$(FLASH_PH_START)" />
        <ProgramSection alignment="0x100" load="Yes" name=".vectors" start="$(FLASH_START)" />
        <ProgramSection alignment="4" load="Yes" name=".init" />
        <ProgramSection alignment="4" load="Yes" name=".init_rodata" />
    	<ProgramSection alignment="4" keep="Yes" load="Yes" name=".sdh_ble_observers" inputsections="*(SORT(.sdh_ble_observers*))" address_symbol="__start_sdh_ble_observers" end_symbol="__stop_sdh_ble_observers" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".sdh_req_observers" inputsections="*(SORT(.sdh_req_observers*))" address_symbol="__start_sdh_req_observers" end_symbol="__stop_sdh_req_observers" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".sdh_state_observers" inputsections="*(SORT(.sdh_state_observers*))" address_symbol="__start_sdh_state_observers" end_symbol="__stop_sdh_state_observers" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".sdh_stack_observers" inputsections="*(SORT(.sdh_stack_observers*))" address_symbol="__start_sdh_stack_observers" end_symbol="__stop_sdh_stack_observers" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".sdh_soc_observers" inputsections="*(SORT(.sdh_soc_observers*))" address_symbol="__start_sdh_soc_observers" end_symbol="__stop_sdh_soc_observers" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".nrf_sections" address_symbol="__start_nrf_sections" />
        <ProgramSection alignment="4" load="Yes" name=".text" />
        
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".fs_data"  inputsections="*(.fs_data*)" runin=".fs_data_run"/>
        <ProgramSection alignment="4" load="Yes" name=".dtors" />
        <ProgramSection alignment="4" load="Yes" name=".ctors" />
        <ProgramSection alignment="4" load="Yes" name=".rodata" size="0x4" />
        <ProgramSection alignment="4" load="Yes" name=".ARM.exidx" address_symbol="__exidx_start" end_symbol="__exidx_end" />
        <ProgramSection alignment="4" load="Yes" runin=".fast_run" name=".fast" />
        <ProgramSection alignment="4" load="Yes" runin=".data_run" name=".data" />
        <ProgramSection alignment="4" load="Yes" runin=".tdata_run" name=".tdata" />
      </MemorySegment>
      <MemorySegment name="RAM1" start="$(RAM_PH_START)" size="$(RAM_PH_SIZE)">
        <ProgramSection load="no" name=".reserved_ram" start="$(RAM_PH_START)" size="$(RAM_START)-$(RAM_PH_START)" />
        <ProgramSection alignment="0x100" load="No" name=".vectors_ram" start="$(RAM_START)" address_symbol="__app_ram_start__"/>
        <ProgramSection alignment="4" keep="Yes" load="No" name=".nrf_sections_run" address_symbol="__start_nrf_sections_run" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".fs_data_run" address_symbol="__start_fs_data" end_symbol="__stop_fs_data" />
        <ProgramSection alignment="4" keep="Yes" load="No" name=".nrf_sections_run_end" address_symbol="__end_nrf_sections_run" />
        <ProgramSection alignment="4" load="No" name=".fast_run" />
        <ProgramSection alignment="4" load="No" name=".data_run" />
        <ProgramSection alignment="4" load="No" name=".tdata_run" />
        <ProgramSection alignment="4" load="No" name=".bss" />
        <ProgramSection alignment="4" load="No" name=".tbss" />
        <ProgramSection alignment="4" load="No" name=".non_init" />
        <ProgramSection alignment="4" size="__HEAPSIZE__" load="No" name=".heap" />
        <ProgramSection alignment="8" size="__STACKSIZE__" load="No" place_from_segment_end="Yes" name=".stack"  address_symbol="__StackLimit" end_symbol="__StackTop"/>
        <ProgramSection alignment="8" size="__STACKSIZE_PROCESS__" load="No" name=".stack_process" />
      </MemorySegment>
      <MemorySegment name="uicr_bootloader_start_address" start="0x10001014" size="0x4">
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".uicr_bootloader_start_address" address_symbol="__start_uicr_bootloader_start_address" end_symbol="__stop_uicr_bootloader_start_address" start = "0x10001014" size="0x4" />
      </MemorySegment>
      
    </Root>
    

    .emProject:

    :

    <!DOCTYPE CrossStudio_Project_File>
    <solution
      Name="secure_bootloader_ble_s140_pca10056_debug"
      target="8"
      version="2">
      <project Name="secure_bootloader_ble_s140_pca10056_debug">
        <configuration
          Name="Common"
          arm_architecture="v7EM"
          arm_core_type="Cortex-M4"
          arm_endian="Little"
          arm_fp_abi="Hard"
          arm_fpu_type="FPv4-SP-D16"
          arm_linker_heap_size="0"
          arm_linker_process_stack_size="0"
          arm_linker_stack_size="512"
          arm_linker_treat_warnings_as_errors="No"
          arm_simulator_memory_simulation_parameter="RWX 00000000,00100000,FFFFFFFF;RWX 20000000,00010000,CDCDCDCD"
          arm_target_device_name="nRF52840_xxAA"
          arm_target_interface_type="SWD"
          c_preprocessor_definitions="BLE_STACK_SUPPORT_REQD;BOARD_PCA10056;CONFIG_GPIO_AS_PINRESET;DEBUG_NRF;INITIALIZE_USER_SECTIONS;NO_VTOR_CONFIG;NRF52840_XXAA;NRF_SD_BLE_API_VERSION=7;S140;SOFTDEVICE_PRESENT;SVC_INTERFACE_CALL_AS_NORMAL_FUNCTION;"
          c_user_include_directories="../../config;../../../../../components/ble/common;../../../../../components/boards;../../../../../components/libraries/atomic;../../../../../components/libraries/atomic_fifo;../../../../../components/libraries/balloc;../../../../../components/libraries/bootloader;../../../../../components/libraries/bootloader/ble_dfu;../../../../../components/libraries/bootloader/dfu;../../../../../components/libraries/crc32;../../../../../components/libraries/crypto;../../../../../components/libraries/crypto/backend/cc310;../../../../../components/libraries/crypto/backend/cc310_bl;../../../../../components/libraries/crypto/backend/cifra;../../../../../components/libraries/crypto/backend/mbedtls;../../../../../components/libraries/crypto/backend/micro_ecc;../../../../../components/libraries/crypto/backend/nrf_hw;../../../../../components/libraries/crypto/backend/nrf_sw;../../../../../components/libraries/crypto/backend/oberon;../../../../../components/libraries/crypto/backend/optiga;../../../../../components/libraries/delay;../../../../../components/libraries/experimental_section_vars;../../../../../components/libraries/fstorage;../../../../../components/libraries/log;../../../../../components/libraries/log/src;../../../../../components/libraries/mem_manager;../../../../../components/libraries/memobj;../../../../../components/libraries/mutex;../../../../../components/libraries/queue;../../../../../components/libraries/ringbuf;../../../../../components/libraries/scheduler;../../../../../components/libraries/stack_info;../../../../../components/libraries/strerror;../../../../../components/libraries/svc;../../../../../components/libraries/util;../../../../../components/softdevice/common;../../../../../components/softdevice/s140/headers;../../../../../components/softdevice/s140/headers/nrf52;../../../../../components/toolchain/cmsis/include;../..;../../../../../external/fprintf;../../../../../external/nano-pb;../../../../../external/nrf_cc310/include;../../../../../external/nrf_cc310_bl/include;../../../../../external/nrf_oberon;../../../../../external/nrf_oberon/include;../../../../../external/segger_rtt;../../../../../integration/nrfx;../../../../../modules/nrfx;../../../../../modules/nrfx/hal;../../../../../modules/nrfx/mdk;../config;"
          debug_additional_load_file="../../../../../components/softdevice/s140/hex/s140_nrf52_7.2.0_softdevice.hex"
          debug_register_definition_file="../../../../../modules/nrfx/mdk/nrf52840.svd"
          debug_start_from_entry_point_symbol="No"
          debug_target_connection="J-Link"
          gcc_debugging_level="Level 3"
          gcc_entry_point="Reset_Handler"
          linker_output_format="hex"
          linker_printf_fmt_level="long"
          linker_printf_width_precision_supported="Yes"
          linker_scanf_fmt_level="long"
          linker_section_placement_file="flash_placement.xml"
          linker_section_placement_macros="FLASH_PH_START=0x0;FLASH_PH_SIZE=0x100000;RAM_PH_START=0x20000000;RAM_PH_SIZE=0x40000;FLASH_START=0x27000;FLASH_SIZE=0xd000;RAM_START=0x20005978;RAM_SIZE=0x3a688"
          linker_section_placements_segments="FLASH1 RX 0x0 0x100000;RAM1 RWX 0x20000000 0x40000;uicr_bootloader_start_address RX 0x10001014 0x4;"
          macros="CMSIS_CONFIG_TOOL=../../../../../external_tools/cmsisconfig/CMSIS_Configuration_Wizard.jar"
          project_directory=""
          project_type="Executable" />
        <folder Name="Segger Startup Files">
          <file file_name="$(StudioDir)/source/thumb_crt0.s" />
        </folder>
        <folder Name="nRF_Libraries">
          <file file_name="../../../../../components/libraries/util/app_error_weak.c" />
          <file file_name="../../../../../components/libraries/util/app_util_platform.c" />
          <file file_name="../../../../../components/libraries/util/nrf_assert.c">
            <configuration Name="Release" build_exclude_from_build="No" />
          </file>
          <file file_name="../../../../../components/libraries/atomic_fifo/nrf_atfifo.c">
            <configuration Name="Release" build_exclude_from_build="No" />
          </file>
          <file file_name="../../../../../components/libraries/atomic/nrf_atomic.c" />
          <file file_name="../../../../../components/libraries/fstorage/nrf_fstorage.c" />
          <file file_name="../../../../../components/libraries/fstorage/nrf_fstorage_nvmc.c" />
          <file file_name="../../../../../components/libraries/experimental_section_vars/nrf_section_iter.c" />
          <file file_name="../../../../../components/libraries/fstorage/nrf_fstorage_sd.c" />
        </folder>
        <folder Name="nRF_SoftDevice">
          <file file_name="../../../../../components/softdevice/common/nrf_sdh.c" />
          <configuration Name="Release" build_exclude_from_build="No" />
        </folder>
        <folder Name="nRF_Drivers" />
        <folder Name="Application">
          <file file_name="../../main.c" />
          <file file_name="../config/sdk_config.h" />
        </folder>
        <folder Name="nRF_Segger_RTT">
          <file file_name="../../../../../external/segger_rtt/SEGGER_RTT.c" />
          <file file_name="../../../../../external/segger_rtt/SEGGER_RTT_Syscalls_SES.c" />
          <file file_name="../../../../../external/segger_rtt/SEGGER_RTT_printf.c" />
        </folder>
        <folder Name="nRF_Bootloader">
          <file file_name="../../../../../components/libraries/bootloader/nrf_bootloader_info.c">
            <configuration Name="Release" build_exclude_from_build="No" />
          </file>
          <configuration Name="Release" build_exclude_from_build="No" />
          <file file_name="../../../../../components/libraries/bootloader/dfu/nrf_dfu_mbr.c">
            <configuration Name="Release" build_exclude_from_build="No" />
          </file>
        </folder>
        <folder Name="None">
          <file file_name="../../../../../modules/nrfx/mdk/ses_startup_nrf52840.s" />
          <file file_name="../../../../../modules/nrfx/mdk/ses_startup_nrf_common.s" />
          <file file_name="../../../../../modules/nrfx/mdk/system_nrf52840.c" />
        </folder>
        <configuration Name="Release" gcc_optimization_level="Level 2 for size" />
      </project>
      <configuration
        Name="Release"
        gcc_optimization_level="Optimize For Size"
        link_time_optimization="No" />
    </solution>
    

Children
Related