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

SDK 12.3.0 DFU service not work

Hi Forums,

I work 51822 custom board.

I try to add Buttonless DFU so I test the "experimental_ble_app_buttonless_dfu" compile is good.

But flash to the board can't find DFU service on NRF Connect tool.

I search online then find most discuss SDK 12.1.0 So I download SDK 12.1.0 build "experimental_ble_app_buttonless_dfu" then flash to board. Magic! It's fine.

I think is strange so try test SDK 12.2.0 . Sadly not worked.

What's different between SDK 12.1.0 ~ SDK 12.2.0 make ble dfu service not work?

Is any suggestion to fix this on SDK 12.3.0?

Thanks for any information.

Parents
  • There is a bootloader settings section that is missing in the linker script, so if you modify the ble_app_buttonless_dfu_gcc_nrf51.ld to the following you should be able to get the buttonless example to run.

    /* Linker script to configure memory regions. */
    
    SEARCH_DIR(.)
    GROUP(-lgcc -lc -lnosys)
    
    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x1b000, LENGTH = 0x24000
      RAM (rwx) :  ORIGIN = 0x20001ff8, LENGTH = 0x6008
      BOOTLOADER_SETTINGS (rw) : ORIGIN = 0x0003F000, LENGTH = 0x1000
    }
    
    SECTIONS
    {
      .bootloaderSettings(NOLOAD) :
      {
    
      } > BOOTLOADER_SETTINGS
      
      .fs_data :
      {
        PROVIDE(__start_fs_data = .);
        KEEP(*(.fs_data))
        PROVIDE(__stop_fs_data = .);
      } > RAM
      .pwr_mgmt_data :
      {
        PROVIDE(__start_pwr_mgmt_data = .);
        KEEP(*(.pwr_mgmt_data))
        PROVIDE(__stop_pwr_mgmt_data = .);
      } > RAM
    } INSERT AFTER .data;
    
    INCLUDE "nrf5x_common.ld"
    
Reply
  • There is a bootloader settings section that is missing in the linker script, so if you modify the ble_app_buttonless_dfu_gcc_nrf51.ld to the following you should be able to get the buttonless example to run.

    /* Linker script to configure memory regions. */
    
    SEARCH_DIR(.)
    GROUP(-lgcc -lc -lnosys)
    
    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x1b000, LENGTH = 0x24000
      RAM (rwx) :  ORIGIN = 0x20001ff8, LENGTH = 0x6008
      BOOTLOADER_SETTINGS (rw) : ORIGIN = 0x0003F000, LENGTH = 0x1000
    }
    
    SECTIONS
    {
      .bootloaderSettings(NOLOAD) :
      {
    
      } > BOOTLOADER_SETTINGS
      
      .fs_data :
      {
        PROVIDE(__start_fs_data = .);
        KEEP(*(.fs_data))
        PROVIDE(__stop_fs_data = .);
      } > RAM
      .pwr_mgmt_data :
      {
        PROVIDE(__start_pwr_mgmt_data = .);
        KEEP(*(.pwr_mgmt_data))
        PROVIDE(__stop_pwr_mgmt_data = .);
      } > RAM
    } INSERT AFTER .data;
    
    INCLUDE "nrf5x_common.ld"
    
Children
  • Hi Bjørn,

    Thanks your patient answer now is great see the DFU service back on buttonless example.

    But still have some little problem I can't jump to the bootloader when I press DFU on NRF Connect App.

    My flow is erase flash -> load softdevice s130 2.0.1 -> load secure bootloader

    switch to android NRF Connect: connect DfuTarg ->press DFU update DFU app_package.zip -> success -> connect buttonless service -> press DFU update DFU app_package.zip -> loop connecting then staring bootloader.

    Is I did something wrong of bootloader?

  • @johnathan_lyu: Are you still experiencing this issue?

  • Hi Bjørn Spockeli: I can use DFU now. But, yes I need send the cmd to my board make it to into DFU mode. Then I need connect to DFUTARG then select my package file to starting DFU.

    For now it is work. But have a lousy step.

    1. I need connect my board trigger to DFU mode.
    2. Dissconnect my board.
    3. Connect my board with device name "DFUTARG"
    4. press DFU and select my package file.
    5. wait finish.
    6. disconnect.
  • @johnathan_lyu: I apologize for the late reply, I have been looking at the secure bootloader and buttonless examples in SDK v12.3.0 and it would appear that the .enter_buttonless_dfu field in the s_dfu_settings is not correctly written to flash by the buttonless application. All callbacks from the fstorage module indicate that the flash write operation was OK, but once you reset to the bootloader and read it back, the value is set to 0. I have not been able to determine why, but I do not think this is worth looking into as this is an experimental implementation. We reverted to using the GPREGRET registers instead of writing to flash in SDK v13.x.x. Hence, my suggestion would be to backport the buttonless example and bootloader from SDK v13.0.0 to SDK v12.3.0.

Related