This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DFU Bootloader with S340 Softdevice

Hi, I learned how to replace the softdevice for a normal application. I've replaced 140 with 340 in my app. However I don't know to do that for the boolloader.

What I want to achieve is

- Have a BLE bootloader with S340

- Have my app on top, which will support the Buttonless DFU (next step)

For now I'm struggling to make the step 1 work. The example works when I use the S140, but when I replace with S340 it does not. I guess I don't have to change the the target addresses, because the bootloader goes to it's place no matter the softdevice, but what should be changed? Are there major differences between 140 and 340? I thought it was just an addition of ANT+? Maybe I just to need to midify some macros? 

Please help. Thanks

  • OK. I've changed the nrf_sdm.h file to the one provided with the S340 softdevice and it compiled and runs. Please let me know if this should be enough or maybe there is something more I should do. Thanks

  • Ok. I think the bootloader itself is ok, because I can upload a new zip containing my app. However, my app, which I tried to extend with the DFU functionality does not function properly. The DFU service is visible, but when i click on the "Start DFU" button in the BLE app (in the nrf connect suit), after connecting and upploading the zip, my app restarts, but does not go into the bootloader. What am I missing? Where to look for a mistake?

  • Hi,

    what should be changed? Are there major differences between 140 and 340?

    Assuming the S340 SoftDevice you are using is the same major version as the S140 version and you only use a BLE bootloader in both cases, the API etc. is the same (so not just the nrf_sdm.h file). This should be enough, though there could be something I do not think about which you should see when you test.

    Regarding memory, the bootloader is located at the end of the flash, so flash start address will not be a problem even if the SoftDevice increases. If the version is the same and you only use BLE still, the RAM configuration should also be good. Alternatively you could increase the bootloader RAM start address and decrees the size a bit just to be on the safe side (you will get a runtime error when configuring the SoftDevice if this is a problem, though).

  • Hi, Thanks for your answer. This part of my question is clear. Can you please address the other part (buttonless dfu app does not work). 

    What I can say in addition is that the app does not go into the ble_dfu_evt_handler. It just resets.

    PS: I also implemented parts of the power management example app into my app, which I think might be in conflict.

  • Hi,

    I did not see any questions related to buttonless other than the statement that you want to use it.

    dragilla said:
    What I can say in addition is that the app does not go into the ble_dfu_evt_handler. It just resets.

    If it "just resets" then something is resetting. An error handler perhaps? Have you attempted to make a debug build (with DEBUG defined) and logging enabled? If so, you should easily see that. Generally, the buttonless DFU mechamism is very simple, by just writing a magic work to GPREGREG and performing a soft reset. Then the bootloader checks GPREGRET for the magic word - and if it is present, it enters DFU mode.

Related