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

Trying to compile DFU bootloader code in segger embedded studio.

When I tried to compile bootloader example code of sdk  bootloader_secure, I am facing some of the errors when I tried to compile using Segger Embedded Studio, which could not be solved. I think this is generating because of compiler difference. I am using s130.

`.bootloaderSettings' will not fit in region `UNPLACED_SECTIONS' region .

   In function `nrf_dfu_transports_init':
     undefined reference to `__stop_dfu_trans'
     undefined reference to `__start_dfu_trans'
   In function `nrf_dfu_bl_continue':
    undefined reference to `__isr_vector'
Build failed

Parents
  • You,re probably missing the bootloaderSettings section in the flash_placement.xml file, take a look at the flash_placement.xml file from this answer. 

    Best regards

    Bjørn

  • I have uploaded this image of upgraded SDK code. But in my 12.3.0 there is no option in linker of Section placement file.

    So there would be no effects of flash_placement.xml. whether I will do changes or not.

  • In keil it is

    #elif defined (__CC_ARM)
        #define BOOTLOADER_START_ADDR        (uint32_t)&Image$$ER_IROM1$$Base

  • Look it up:

    http://www.keil.com/support/man/docs/armlink/armlink_pge1362065952432.htm

    A key part of any porting exercise is a solid understanding of what you're porting - and what you're porting it to!

  • Hey I have resolved all my errors with this flash_placement.xml file

    <!DOCTYPE Linker_Placement_File>
    <Root name="Flash Section Placement">
      <MemorySegment name="$(FLASH_NAME:FLASH)">
        <ProgramSection alignment="0x100" load="Yes" name=".vectors" start="$(FLASH_START:)" address_symbol="__isr_vector" />
        <ProgramSection alignment="4" load="Yes" name=".init" />
        <ProgramSection alignment="4" load="Yes" name=".init_rodata" />
        <ProgramSection alignment="4" load="Yes" name=".text" />
        <ProgramSection alignment="4" load="Yes" name=".dtors" />
        <ProgramSection alignment="4" load="Yes" name=".ctors" />
        <ProgramSection alignment="4" load="Yes" name=".rodata" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".dfu_trans" inputsections="*(SORT(.dfu_trans*))" address_symbol="__start_dfu_trans" end_symbol="__stop_dfu_trans" />
        <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" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" runin=".fs_data_run" name=".fs_data" />
        <ProgramSection alignment="4" load="Yes" name=".bootloaderSettings" start="$(BOOTLOADER_SETTINGS_START:)" size="$(BOOTLOADER_SETTINGS_SIZE:)" />
      </MemorySegment>
       <MemorySegment name="$(FLASH2_NAME:BOOTLOADER_SETTINGS)">
        <ProgramSection alignment="4" load="No" name=".bootloaderSettings"/>
      </MemorySegment>
      <MemorySegment name="$(RAM_NAME:RAM);SRAM">
        <ProgramSection alignment="0x100" load="No" name=".vectors_ram" start="$(RAM_START:$(SRAM_START:))" />
        <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" keep="Yes" name=".fs_data_run" address_symbol="__start_fs_data" end_symbol="__stop_fs_data" />
        <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" />
        <ProgramSection alignment="8" size="__STACKSIZE_PROCESS__" load="No" name=".stack_process" />
      </MemorySegment>
      <MemorySegment name="$(FLASH2_NAME:FLASH2)">
        <ProgramSection alignment="4" load="Yes" name=".text2" />
        <ProgramSection alignment="4" load="Yes" name=".rodata2" />
        <ProgramSection alignment="4" load="Yes" runin=".data2_run" name=".data2" />
      </MemorySegment>
      <MemorySegment name="$(RAM2_NAME:RAM2)">
        <ProgramSection alignment="4" load="No" name=".data2_run" />
        <ProgramSection alignment="4" load="No" name=".bss2" />
      </MemorySegment>
      
    </Root>
    
    But I don't know what should I add in options ->build->memory segments and options->linker->Section placement macros to run this dfu bootloader_secure code in segger embedded studio

Reply
  • Hey I have resolved all my errors with this flash_placement.xml file

    <!DOCTYPE Linker_Placement_File>
    <Root name="Flash Section Placement">
      <MemorySegment name="$(FLASH_NAME:FLASH)">
        <ProgramSection alignment="0x100" load="Yes" name=".vectors" start="$(FLASH_START:)" address_symbol="__isr_vector" />
        <ProgramSection alignment="4" load="Yes" name=".init" />
        <ProgramSection alignment="4" load="Yes" name=".init_rodata" />
        <ProgramSection alignment="4" load="Yes" name=".text" />
        <ProgramSection alignment="4" load="Yes" name=".dtors" />
        <ProgramSection alignment="4" load="Yes" name=".ctors" />
        <ProgramSection alignment="4" load="Yes" name=".rodata" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".dfu_trans" inputsections="*(SORT(.dfu_trans*))" address_symbol="__start_dfu_trans" end_symbol="__stop_dfu_trans" />
        <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" />
        <ProgramSection alignment="4" keep="Yes" load="Yes" runin=".fs_data_run" name=".fs_data" />
        <ProgramSection alignment="4" load="Yes" name=".bootloaderSettings" start="$(BOOTLOADER_SETTINGS_START:)" size="$(BOOTLOADER_SETTINGS_SIZE:)" />
      </MemorySegment>
       <MemorySegment name="$(FLASH2_NAME:BOOTLOADER_SETTINGS)">
        <ProgramSection alignment="4" load="No" name=".bootloaderSettings"/>
      </MemorySegment>
      <MemorySegment name="$(RAM_NAME:RAM);SRAM">
        <ProgramSection alignment="0x100" load="No" name=".vectors_ram" start="$(RAM_START:$(SRAM_START:))" />
        <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" keep="Yes" name=".fs_data_run" address_symbol="__start_fs_data" end_symbol="__stop_fs_data" />
        <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" />
        <ProgramSection alignment="8" size="__STACKSIZE_PROCESS__" load="No" name=".stack_process" />
      </MemorySegment>
      <MemorySegment name="$(FLASH2_NAME:FLASH2)">
        <ProgramSection alignment="4" load="Yes" name=".text2" />
        <ProgramSection alignment="4" load="Yes" name=".rodata2" />
        <ProgramSection alignment="4" load="Yes" runin=".data2_run" name=".data2" />
      </MemorySegment>
      <MemorySegment name="$(RAM2_NAME:RAM2)">
        <ProgramSection alignment="4" load="No" name=".data2_run" />
        <ProgramSection alignment="4" load="No" name=".bss2" />
      </MemorySegment>
      
    </Root>
    
    But I don't know what should I add in options ->build->memory segments and options->linker->Section placement macros to run this dfu bootloader_secure code in segger embedded studio

Children
No Data
Related