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

BLE DFU Issue

Hi,

I am trying to develop the DFU capability for my device.

I added the necessary code from the example ble_app_buttonless_dfu to my application.

then started as explained in this step by step guide:

https://devzone.nordicsemi.com/nordic/short-range-guides/b/software-development-kit/posts/getting-started-with-nordics-secure-dfu-bootloader#h23sjziacp7vrw0scs2t3tua1ax0426

I flash the softdevice then the bootloader, then DFU the application successfully, but the application doesn't start up at all,

then I tried to debug the application and it is also doesn't start up, it behaves like when flashing the application without the softdevice.

I noticed in the.

when I flash only the softdevice and the application everything works fine when I comment the DFU service and the ble_dfu_buttonless_async_svci_init function.

seems like the bootloader not jumping to the application even after a successful DFU.

Please help

BR

JK

Parents
  • Hi JK,

    I don't have an immediate suggestion about what causes this issue, but I have some suggestions about how to narrow down the problem:

    • Which address does app_start() jump to? 0x1000? If so, that would be correct and should cause the application to be started (by the SoftDevice in this case).
    • Can you try verifying if the application is started or not? It could be that for some reason the presence of the bootloader causes the application to hit an error, and therefore it does not start to advertise. Can you try putting a breakpoint in the start of main in the application? If that causes problems, can you try toggling a GPIO a few times at the start of main, and check with a logic analyzer if that happens.
    • You could also add RTT logging to the bootloader to see what is going on, but based on what you have written it seems likely that the application is likely started and that we need to look there to understand what is happening.
    • Which SDK version do you use?

    Einar

  • Hi Einar,

    And thank you for your help.

    I figured something using the nRF Connect Programmer.

    when I flash the soft device alone and rea the memory every thing seems right.

    But after that when I flash the bootloader and read the memory again by the nRF Connect Programmer the region name of the sofdevice switched to Application ( the color switches from blue to green) and the start address of the softdevice switches to be 0xFF8 instead of 0x1000.

    So I think this way when the bootloader jumps to the address 0x1000 the softdevice will not be able to run properly ! 

    What can cause this problem !??

    here is a screen shot for the problem using nRF Connect Programmer.

    Thank you again for your help

    BR

    JK

Reply
  • Hi Einar,

    And thank you for your help.

    I figured something using the nRF Connect Programmer.

    when I flash the soft device alone and rea the memory every thing seems right.

    But after that when I flash the bootloader and read the memory again by the nRF Connect Programmer the region name of the sofdevice switched to Application ( the color switches from blue to green) and the start address of the softdevice switches to be 0xFF8 instead of 0x1000.

    So I think this way when the bootloader jumps to the address 0x1000 the softdevice will not be able to run properly ! 

    What can cause this problem !??

    here is a screen shot for the problem using nRF Connect Programmer.

    Thank you again for your help

    BR

    JK

Children
  • Hi JK,

    jawadk said:
    But after that when I flash the bootloader and read the memory again by the nRF Connect Programmer the region name of the sofdevice switched to Application ( the color switches from blue to green) and the start address of the softdevice switches to be 0xFF8 instead of 0x1000.

    You should not put much emphasis in the addresses ranges from nRF Connect programmer when it reads the memory of a device and attempts to interpret it. This is just an issue with nRF Connect Programmer app. The last two words of the MBR page 0xFF8-0xFFF are used by the bootloader and written to either when you program the bootloader hex or by the MBR itself (depending on SDK version etc). Since they are not empty (not all FFFF's, the programmer app interprets it as the start of the application, but that is not the case. I do not think this is related to the issue you are seeing.

    jawadk said:
    So I think this way when the bootloader jumps to the address 0x1000 the softdevice will not be able to run properly ! 

    No, that is not the problem.

    jawadk said:
    What can cause this problem !??

    Good question. Can you try to verify that the application is not started? My assumption is that the application is started, but misbehaving for some reason, perhaps because the bootloader did not clean up properly after itself. Checking what happens in the application (or verifying that it does not start) should be the next step. I also wonder what SDK version you are using?

    Einar

  • Hi,

    I an using the latest SDK with softdevice 7.0.1

    I don't think the problem is in my application, cause it worked fine with the softdevice.

    besides I tried the ble_app_buttonless_dfu example instead of my application, and I faced the same problem.

    besides I will try to print something at the beginning of my application and will inform you when I have the result.

    BR

    JK

  • Hi Einar,

    you were right.

    my application starts and !!

    but when I flash just the softdevice + application it works fine.

    what can be the problem ? because I tried to DFU the ble_app_buttonless_dfu example and its also didn't start advertising 

    BR

    JK

  • Hi Einar,

    just tried to DFU the my nominal application without the ble_app_buttonless_dfu example code I added to the application and it works, my application start working.

    No I need your help to solve this please.

    when I run the application with the ble_app_buttonless_dfu code without the bootloader the ble_dfu_buttonless_async_svci_init function return an error, but I think it should be doesn't it ? cause their is no bootloader

    BR

    JK

  • Hi,

    Now I managed to perform the DFU correctly.

    The remaining problem now is the buttonless DFU part at the application.

    when I initialize thw DFU service I can't use the NUS service !

    I increased the NRF_SDH_BLE_VS_UUID_COUNT from 1 to 2

    And have the ble_uuid updated to: 

    static ble_uuid_t m_adv_uuids[]          =                                          /**< Universally unique service identifier. */
    {
        {BLE_UUID_DEVICE_INFORMATION_SERVICE, BLE_UUID_TYPE_BLE},
        {BLE_UUID_NUS_SERVICE, NUS_SERVICE_UUID_TYPE}
    };

    Also updates the RAM-Start address to give the softdevice the memory size needed !

    But still I have a Problem.

Related