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

Dfu problem in segger

Hi

Getting problem in DFU feature while using segger embedded studio.Device gets programmed  successfully but stops working after that.

I am following the same process for keil and segger IDE. For keil it's working fine, but for segger it fails.

For DFU I am following this thread :

devzone.nordicsemi.com/.../

I am using sdk 11

Has any one tried dfu feature using segger IDE?

Are there any additional steps for DFU in segger IDE?

  • Hi.

    1) I recommend that you use SDK 12.3, that is the latest SDK compatible with nRF51, it also has the same SoftDevice as SDK 11.

    2) If you wish to use Segger Embedded Studio, you have to import the Keil project to Segger Embedded Studio, take a look at this guide.

    3) Take a look at the Infocenter where the DFU bootloader is explained, and follow that procedure under testing.

    Best regards,

    Andreas

  • Hello Andreas, Thanks for the reply.

    1) I have tried the example project ble_app_uart, ble_app_hrs and experimental_ble_buttonless_dfu on SDK 12.3 (with softdevice 130).

    1.a) ble_app_uart worked successfully in Segger IDE, ble_app_hrs  gets stuck when you do the debugging. Please see the image below.

     )

    Note: I had to use the debug mode for ble_app_hrs, because it was not even advertising in normal mode.

    1.b) In the application experimental_ble_buttonless_dfu, I am getting a compilation error. Attaching the error trace below.

    Building ‘ble_app_buttonless_dfu_pca10028_s130’ from solution ‘ble_app_buttonless_dfu_pca10028_s130’ in configuration ‘nrf51422_xxac’
      Assembling ‘thumb_crt0.s’
      Compiling ‘system_nrf51.c’
      Assembling ‘ses_nrf51_startup.s’
      Compiling ‘main.c’
      Compiling ‘nrf_dfu_flash_buttonless.c’
      Compiling ‘boards.c’
      Compiling ‘bsp.c’
      Compiling ‘bsp_nfc.c’
      Compiling ‘ble_advdata.c’
      Compiling ‘bsp_btn_ble.c’
      Compiling ‘ble_advertising.c’
      Compiling ‘ble_conn_params.c’
      Compiling ‘ble_conn_state.c’
      Compiling ‘ble_dfu.c’
      Compiling ‘ble_srv_common.c’
      Compiling ‘gatt_cache_manager.c’
      Compiling ‘gatts_cache_manager.c’
      Compiling ‘id_manager.c’
      Compiling ‘peer_data.c’
      Compiling ‘peer_data_storage.c’
      Compiling ‘peer_database.c’
      Compiling ‘peer_id.c’
      Compiling ‘peer_manager.c’
      Compiling ‘pm_buffer.c’
      Compiling ‘pm_mutex.c’
      Compiling ‘security_dispatcher.c’
      Compiling ‘security_manager.c’
      Compiling ‘nrf_dfu_settings.c’
      Compiling ‘nrf_drv_clock.c’
      Compiling ‘nrf_drv_common.c’
      Compiling ‘nrf_drv_gpiote.c’
      Compiling ‘nrf_drv_uart.c’
      Compiling ‘app_button.c’
      Compiling ‘app_error.c’
      Compiling ‘app_error_weak.c’
      Compiling ‘app_scheduler.c’
      Compiling ‘app_timer.c’
      Compiling ‘app_util_platform.c’
      Compiling ‘crc16.c’
      Compiling ‘crc32.c’
      Compiling ‘fds.c’
      Compiling ‘fstorage.c’
      Compiling ‘hardfault_implementation.c’
      Compiling ‘nrf_assert.c’
      Compiling ‘sdk_errors.c’
      Compiling ‘sdk_mapped_flags.c’
      Compiling ‘sensorsim.c’
      Compiling ‘nrf_log_backend_serial.c’
      Compiling ‘nrf_log_frontend.c’
      Compiling ‘RTT_Syscalls_KEIL.c’
      Compiling ‘SEGGER_RTT.c’
      Compiling ‘SEGGER_RTT_printf.c’
      Compiling ‘softdevice_handler.c’
      Generating linker script ‘ble_app_buttonless_dfu_pca10028_s130.ld’
      Linking ble_app_buttonless_dfu_pca10028_s130.elf
        Output/nrf51422_xxac/Exe/ble_app_buttonless_dfu_pca10028_s130.elf section `.bootloaderSettings' will not fit in region `UNPLACED_SECTIONS'
        region `UNPLACED_SECTIONS' overflowed by 1024 bytes
    Build failed
    

    2) We have already done the porting of projects from Keil to Segger already  and made everything work except DFU in SDK 11 (Softdevice S130 and nrf51-dk)

    3) We have been using DFU successfully in SDK 11 (in Keil) for quite some time on nrf51-DK and our product version with nrf51822.

    4) Our work is almost complete on SDK 11 except for DFU (for our product) in Segger. Is there anyway you can guide us to use SDK 11 itself for DFU applications itself Segger. The reason is that it will take good amount of time to port all our applications to SDK12 from SDK11.

    Thanks a lot for your time :)

  • Hi.

    1.a) It is not clear to me why your program stopped, which function call made it stop?

    1.b)

    You have to define the memory area in the flash_placement.xml file, try this:

    <ProgramSection alignment="4" load="Yes" name=".bootloaderSettings" start="$(BOOTLOADER_SETTINGS_START:0x0003FC00)" size="$(BOOTLOADER_SETTINGS_SIZE:0x400)" />

    Are 2) and 3) questions? In that case can you please explain more?

    4) Have you looked into the API for DFU in SDK 11?

    Best regards,

    Andreas

  • Hello Andreas,

    1 b) We have edited the flash_placement.xml and added the suggested line at the end. When we compile it, the following error appears.

    Building ‘ble_app_buttonless_dfu_pca10028_s130’ from solution ‘ble_app_buttonless_dfu_pca10028_s130’ in configuration ‘nrf51422_xxac’
      Assembling ‘thumb_crt0.s’
      Compiling ‘system_nrf51.c’
      Assembling ‘ses_nrf51_startup.s’
      Compiling ‘main.c’
      Compiling ‘nrf_dfu_flash_buttonless.c’
      Compiling ‘bsp.c’
      Compiling ‘boards.c’
      Compiling ‘bsp_btn_ble.c’
      Compiling ‘bsp_nfc.c’
      Compiling ‘ble_advdata.c’
      Compiling ‘ble_advertising.c’
      Compiling ‘ble_conn_params.c’
      Compiling ‘ble_conn_state.c’
      Compiling ‘ble_dfu.c’
      Compiling ‘ble_srv_common.c’
      Compiling ‘gatt_cache_manager.c’
      Compiling ‘gatts_cache_manager.c’
      Compiling ‘id_manager.c’
      Compiling ‘peer_data.c’
      Compiling ‘peer_data_storage.c’
      Compiling ‘peer_database.c’
      Compiling ‘peer_id.c’
      Compiling ‘peer_manager.c’
      Compiling ‘pm_buffer.c’
      Compiling ‘pm_mutex.c’
      Compiling ‘security_dispatcher.c’
      Compiling ‘security_manager.c’
      Compiling ‘nrf_dfu_settings.c’
      Compiling ‘nrf_drv_clock.c’
      Compiling ‘nrf_drv_common.c’
      Compiling ‘nrf_drv_gpiote.c’
      Compiling ‘nrf_drv_uart.c’
      Compiling ‘app_button.c’
      Compiling ‘app_error.c’
      Compiling ‘app_error_weak.c’
      Compiling ‘app_scheduler.c’
      Compiling ‘app_timer.c’
      Compiling ‘app_util_platform.c’
      Compiling ‘crc16.c’
      Compiling ‘crc32.c’
      Compiling ‘fds.c’
      Compiling ‘fstorage.c’
      Compiling ‘hardfault_implementation.c’
      Compiling ‘nrf_assert.c’
      Compiling ‘sdk_errors.c’
      Compiling ‘sdk_mapped_flags.c’
      Compiling ‘sensorsim.c’
      Compiling ‘nrf_log_backend_serial.c’
      Compiling ‘nrf_log_frontend.c’
      Compiling ‘RTT_Syscalls_KEIL.c’
      Compiling ‘SEGGER_RTT.c’
      Compiling ‘SEGGER_RTT_printf.c’
      Compiling ‘softdevice_handler.c’
      Generating linker script ‘ble_app_buttonless_dfu_pca10028_s130.ld’
      Linking ble_app_buttonless_dfu_pca10028_s130.elf
        Output/nrf51422_xxac/Exe/ble_app_buttonless_dfu_pca10028_s130.elf section `.bootloaderSettings' will not fit in region `UNPLACED_SECTIONS'
        region `UNPLACED_SECTIONS' overflowed by 1024 bytes
    Build failed

    Also the updated flash_placement.xml for reference

    <!DOCTYPE Linker_Placement_File>
    <Root name="Flash Section Placement">
      <MemorySegment name="$(FLASH_NAME:FLASH)">
        <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" 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" 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" />
      </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>
      <ProgramSection alignment="4" load="Yes" name=".bootloaderSettings" start="$(BOOTLOADER_SETTINGS_START:0x0003FC00)" size="$(BOOTLOADER_SETTINGS_SIZE:0x400)" />
    </Root>
    

    4) Yes we have been referring to this link for DFU related work.

    Thanks

  • Hi.

    Can you try this flash_placement.xml file?

    <!DOCTYPE Linker_Placement_File>
    <Root name="Flash Section Placement">
      <MemorySegment name="FLASH" start="0x0" size="0x3FC00">
        <ProgramSection alignment="0x100" load="Yes" name=".vectors" start="0x35C00" />
        <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" 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="RAM">
        <ProgramSection alignment="0x100" load="No" name=".vectors_ram" start="0x20002080" />
        <ProgramSection alignment="4" load="No" name=".fast_run" />
        <ProgramSection alignment="4" load="No" name=".data_run" />
        <ProgramSection alignment="4" load="No" name=".bss" />
        <ProgramSection alignment="4" load="No" name=".tbss" />
        <ProgramSection alignment="4" load="No" name=".tdata_run" />
        <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="bootloaderSettings" start="0x0003FC00" size="0x400">
        <ProgramSection alignment="4" keep="Yes" load="yes" name=".bootloaderSettings" address_symbol="__bootloaderSettings_segment_start__" end_symbol="__bootloaderSettings_segment_end__" start="0x3FC00" size="0x400" />
      </MemorySegment>
      <MemorySegment name="uicr_bootloader_start_address" start="0x10001014" size="0x4">
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".uicrBootStartAddress" address_symbol="__start_uicr_bootloader_start_address" end_symbol="__stop_uicr_bootloader_start_address" start="0x10001014" size="0x4" />
      </MemorySegment>
    </Root>
    

    Best regards,

    Andreas

Related