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

Peer data storage in bootloader and application

Hello Nordic Support,

I am developing an application which has BLE bootloader and application using the custom nRF52840 board and nRF5 SDK v17.0.0. Both of them require bonding when connect. From the Nordic Info center, the Peer Manager library will call the FDS library functions and these FDS functions then call the fstorage functions. I would like to ask in my case, how can I manage the peer data of both the application and the bootloader? I don't want data from both programs to overlap each others. If not overlapping, can the application reuse the peer data from the bootloader?

Thanks and best regards,

          Duy Tran

Parents
  • If you set the definition NRF_DFU_BLE_REQUIRES_BONDS in the bootloader's sdk_config.h file is set to 1, then the bootloader will require bonds before allowing the connected device to run the DFU.

    NB: Please consider what will happen if you for some reason ends up in a state where the device is stuck in DFU mode, but there are no bonded devices (if a user deletes the bonding information from the phone, so that the nRF thinks it is bonded, but the phone doesn't have the bonding data).

    The Peer manager and the bootloader will share the same bonding data. That is how it is implemented in the bootloaders in the nRF5 SDKs.

  • Hi ,

    I enabled NRF_DFU_BLE_REQUIRES_BONDS to 1 but the code jumped into error. Do I have to add peer manager again? I am running the secure_bootloader_ble_s140_pca10056_debug example.

    Thanks and best regards,

              Duy

  • Hello,

    Do you have any stored bonds at the point in time when the error occurs?

    The bootloader is not capable of generating new bonds, so this needs to be done from the application. What you need to do when you program a bootloader that requires bonding is that you also need to program an application that is able to create bonding, and the bootloader settings are generated using the bootloader's private key and the application .hex file.

    See how to generate bootloader settings here.

    BR,

    Edvin

  • Hello,

    I don't have any stored bonds when the error occurs. 

    The bootloader is not capable of generating new bonds, so this needs to be done from the application. What you need to do when you program a bootloader that requires bonding is that you also need to program an application that is able to create bonding, and the bootloader settings are generated using the bootloader's private key and the application .hex file.

    => Cleared with this.

    May I ask what is the sd reg code for the latest softdevice (7.2.0) when I generate the packaging using nrfutil?

    BTW, I tried to load the test images in RF5_SDK_17.0.0_9d13099\examples\dfu\secure_dfu_test_images\ble\nrf52840 but the images with bonds do not work.

    Thanks and best regards,

             Duy Tran

  • Duy said:
    BTW, I tried to load the test images in RF5_SDK_17.0.0_9d13099\examples\dfu\secure_dfu_test_images\ble\nrf52840 but the images with bonds do not work.

     That depends on how you test it. It doesn't magically flash any bonds.

     

    Duy said:
    May I ask what is the sd reg code for the latest softdevice (7.2.0) when I generate the packaging using nrfutil?

     Try with --sd-req 0x0100

    This will be listed in a future version of nrfutil.

    Best regards,

    Edvin

Reply
  • Duy said:
    BTW, I tried to load the test images in RF5_SDK_17.0.0_9d13099\examples\dfu\secure_dfu_test_images\ble\nrf52840 but the images with bonds do not work.

     That depends on how you test it. It doesn't magically flash any bonds.

     

    Duy said:
    May I ask what is the sd reg code for the latest softdevice (7.2.0) when I generate the packaging using nrfutil?

     Try with --sd-req 0x0100

    This will be listed in a future version of nrfutil.

    Best regards,

    Edvin

Children
No Data
Related