Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Can the bootloader directly boot into the app instead of into the softdevice?

We have a standalone application with no SDK integration. We would like to have the possibility to do OTA Updates via BLE and maybe introduce BLE support later on.

So for the time being it would like not to use the Softdevice. Since this would mean a lot of work to get everything right again. (Writing to flash, handling peripherals through the SD and maybe more things would break).

That's why I thought about booting my app directly from the bootloader. Instead of the bootloader booting into SD and SD booting the app.

Is this something you can recommend? Are there any issues with that approach? Do you have examples of doing that?

Thanks for your help!

  • Hi Rico, 

    I think you want to use BLE DFU to update your standalone application with no SDK integration to the device. If so, you can use BLE Secure DFU Bootloaderbut the BLE DFU transport (see BLE) depends on the SoftDevice. For nRF52833, you can use <InstallFolder>\examples\dfu\secure_bootloader\pca10100_s140_ble. You will see the device advertise as DfuTrag.  Also, see BLE Secure DFU Bootloader

    You can let the app start above the SD, and the bootloader will boot the app directly. If you use S140 v7.0.1 for the ble bootloader, the app should locate from the FLASH start 0x27000 and RAM Start 0x20001678. To generate the package to update, you can use this command: 

    nrfutil pkg generate --application app.hex --hw-version 52 --sd-req 0x00 --application-version-string "0.5.0" --key-file priv.pem package.zip

    -Amanda H.

  • Thanks for your detailed response. That's exactly what I would like to do. I have already tested the example but with version 7.0.2 Softdevice.

    You say that the bootloader does directly boot the app without booting the Softdevice? 

    I need to write to flash in my application an I am receiving an hard fault if I use the nrfx library to do so, while booting the app through the bootloader. So it seems to me that the Softdevice has been involved and has placed memory protection on those areas. Or is this done via bootloader?

    Also does this mean I do NOT have to use the Softdevice SOC management if I am not enabling the Softdevice?

  • Hi Rico, 

    Sorry for the delay. 

    rico said:
    I need to write to flash in my application an I am receiving an hard fault if I use the nrfx library to do so,

    If your application uses sd_function in the nrfx library, you have to enable the softdevice to access the Softdevice SoC library. 

    -Amanda H.

  • No problem Amanda.

    I am using the nrfx_nvmc library. I am not using anything Softdevice related yet.

    I have checked myself and found that the flash protection is set from the bootloader and not the soft device. So I either had to disable the protection or use the application settings page for storing data in flash. Which is fine.

    So only the last question remains, 

    If I am NOT enabling the Softdevice, is it safe to NOT use the Softdevice SOC library? It isn't clear from the docs if this should only be used if the softdevice is enabled, or all the time when a softdevice is present in flash. 

  • Hi Rico,

    No, you can't use the Softdevice SOC library when the softdevice is disabled or not enabled. In that case, just call the basic nrf driver functions which do the same thing, or write the registers directly. Many of those softdevice SoC functions only exist to guard shared resources when the SD is active and have one-line counterparts in the SDK.

    -Amanda H.

Related