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?

Parents
  • 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.

    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

  • , I've ported the project to Segger embedded Studio. Download the attached zip and copy the extracted folder to \nRF5_SDK_11.0.0_89a8197\examples\dfu before you run the project. I have verified that it runs on a 51 DK (let me know if you're targeting a different Chip variant), but have not tested the DFU part. 

    bootloader_ses.zip

    Note that you need to place the non_init section in the same RAM area in both app and bootloader if you intend to support buttonless DFU, see section placement file. This area is uses to exchange data between bootloader and app. 

  • I had used XML file, got  following error

    "cannot find run section .fast_run referenced in fast"

  • Hi.

    Can you try the project vibe made?

    Best regards,

    Andreas

Reply Children
  • Hi.

    I'm not talking about vibe mode, sorry for the confusion. I was talking about the reply the user  made, he attached a project that is ported to Segger Embedded Studio.

    Vidar Berg said:

    suvarna_kadam, I've ported the project to Segger embedded Studio. Download the attached zip and copy the extracted folder to \nRF5_SDK_11.0.0_89a8197\examples\dfu before you run the project. I have verified that it runs on a 51 DK (let me know if you're targeting a different Chip variant), but have not tested the DFU part. 

    bootloader_ses.zip

    Note that you need to place the non_init section in the same RAM area in both app and bootloader if you intend to support buttonless DFU, see section placement file. This area is uses to exchange data between bootloader and app. 

     This reply.

    Best regards,

    Andreas

  • I have tested the OTA feature using the zip file using the the outputs generated by Keil. The .bat script I have used for this is the following.

    @ echo off
    cd C:\Keil_v5\ARM\ARMCC\bin
    rem pause
    echo "including %1 %2"
    rem pause
    copy "%1\nrf51422_xxac_s130.axf" C:\Keil_v5\ARM\ARMCC\bin\%2.axf
    rem  pause
    fromelf.exe --bin --output %2.bin %2.axf
    rem  pause 
    move "%2.bin" "C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio"
    rem  pause
    cd C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio
    rem  pause
    nrfutil.exe dfu genpkg --application %2.bin %2.zip
    rem  pause
    move "%2.zip" "%1"
    rem  pause
    move "%2.bin" "%1"
    rem  pause

    I would like to know how to create the equivalent zip file using the outputs generated by Segger (Please note that the .axf file is not generated while working with Segger).

    What I have tried?

    I have tried to use the following script (for Segger). After programming over the air using the zip file generated by this method, the device stops advertising.

    @ echo off
    cd C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio
    rem pause
    echo "including %1"
    rem pause
    copy "%1\*.bin" "C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio\%2.bin"
    rem  pause
    nrfutil.exe dfu genpkg --application %2.bin %2.zip
    rem  pause
    copy "C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio\%2.zip" "%1"
    rem  pause
    
    

    Suggestions?

  • Hi.

    There are some things which are unclear for me.

    You are now using SDK 11? Which version of nrfutil do you have? Because if you read the README on GitHub about versions you can read this:

    • Version 0.5.2 generates legacy firmware packages compatible with nRF SDK 11.0 and older
    • Versions 1.5.0 and later generate modern firmware packages compatible with nRF SDK 12.0 and newer

    What does the file you put into your packet contain? Do you expect it to advertise? Have you added a bootloader settings page?

    Best regards,

    Andreas

  • I have added the reply inline.

    There are some things which are unclear for me.

    You are now using SDK 11?

    Yes.

    Which version of nrfutil do you have? Because if you read the README on GitHub about versions you can read this:

    • Version 0.5.2 generates legacy firmware packages compatible with nRF SDK 11.0 and older
    • Versions 1.5.0 and later generate modern firmware packages compatible with nRF SDK 12.0 and newer

      We have been  using nrf util version 0.3 which worked okay with Keil. So I assume the version of nrfutil is not the issue.

    What does the file you put into your packet contain? Do you expect it to advertise?

    Yes, it is supposed to advertise, connect to our mobile and do some packet transfer.

    Have you added a bootloader settings page?

    We have already added bootloader settings. Attached the batch file which we are using to generated merged hex file.

    @ echo off
    cd C:\Program Files (x86)\Nordic Semiconductor\nrf5x\bin
    
    mergehex.exe -m app_valid_setting_apply.hex tmp_dfu_dual_bank_ble_no_s130_pca10028.hex -o test1.hex
    rem  pause 
    mergehex.exe -m test1.hex tmp_s130_nrf51_2.0.0_softdevice.hex -o test2.hex
    rem  pause 
    echo "including %1 %2"
    rem  pause 
    copy "%1\nrf51422_xxac_s130.hex" "C:\Program Files (x86)\Nordic Semiconductor\nrf5x\bin\%2.hex"
    rem  pause
    mergehex.exe -m test2.hex %2.hex -o %2_merge.hex
    rem  pause 
    move "%2_merge.hex" "%1"
    rem  pause 

  • Hi.

    Can you please try to upgrade to nrfutil version 0.5.2?

    Best regards,

    Andreas

Related