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

ble_app_hrs + Buttonless DFU on NRF52DK(52832) + OTA update

Hi,

I want to verify

1. Program  ble_app_hrs with buttonless dfu integrated + secure bootloader + bootloader setting to nRF52DK. 

2. Boot up nRF52DK, then use buttonless dfu goto bootloader mode

3. Update app_dfu_package.zip (nrfutil pkg generate --hw-version 52 --application-version 0 --application ble_ap nrfutil pkg generate --hw-version 52 --application-version 0 --application ble_app_hrs_pca10040_s132.hex --sd-req 0xCB --key-file private.key app_dfu_package.zip
Zip created at app_dfu_package.zip)

====

Below are my steps:

Step1 Generate bootloader setting page

Step2  merge secure bootloader(\dfu\secure_bootloader\pca10040_s132_ble\) + bootloader settings

Step3 Program secure bootloader (examples\dfu\secure_bootloader\pca10040_s132_ble)+ bl setting

Step4 Program softdevice (s132_nrf52_7.0.1)

Step5 Program app(ble_app_hrs_pca10040_s132 which is integrate with buttonless_duf already)

Step 6 When nRF52DK bootup, error logs are below:

Are my steps correct?

How can I make it right?

Thanks.

Vick

Parents
  • Hi Sudharsan,

    I have followed the blog, and try below steps:

    1. 

     In sdk_config.h in the bootloader:

    • Change NRF_DFU_BLE_REQUIRES_BONDS to 1
    • Change NRF_SDH_BLE_SERVICE_CHANGED to 1

    - In sdk_config.h in ble_app_buttonless_dfu + ble_app_hrs

    • Change NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS to 1
    • Check if NRF_SDH_BLE_SERVICE_CHANGED is not 1 then set it to 1

    Compile the two projects. 

    2. Generate bl setting

    3.

    mergehex -m bootloader.hex setting.hex -o bootloader_and_setting.hex

    4.

    mergehex -m nrf52832_xxaa.hex bootloader_and_setting.hex -o app_bootloader_and_setting.hex

    5. flash softdevice

    6.  flash the app_bootloader_and_setting.hex

    7. After bootup, error logs show below:

    Could you give me a hand?

    By the way, I have tested sec_bootloader + ble_app_hrs(without buttonless_dfu), the result is following.

    When nRF52DK boots up, it will enter bootloader mode directly.  Is that normal?

    (This verification just make sure the bootloader is available.)

    Thanks you!

  • Hi Vick,

    In your command for settings hex generation, If you are using SDK version > 15.2, please use --bl-settings-version 2 when generating bootloader setting. 

    Our SDK version is 17.0.2 which is greater than SDK 15.2 and I am using S140 soft-device.

    Here I am giving my settings generation command. We are using secure boot validation. In SDK v15.2 and earlier, it's simply a CRC check of the application image.

    nrfutil settings generate --family NRF52 --application ..\..\XXX_52833\Output\Release\Exe\XXX_52833_s140_V1702.hex --application-version 0 --softdevice ..\..\..\components\softdevice\s140\hex\s140_nrf52_7.2.0_softdevice.hex --bootloader-version 0 --bl-settings-version 2 --sd-boot-validation VALIDATE_ECDSA_P256_SHA256 --app-boot-validation VALIDATE_ECDSA_P256_SHA256 --key-file private.key settings.hex

    Regards

    Sudharsan

  • Hi Sudharsan,

    I have followed Section4 => Success.

    Next I have followed Section5, nRF52DK goes bootloader mode directly when booting up, not advertising with Nordic_HRM_DFU.

    (I'm using ble_app_hrs to integrate)

    I think it is good start and maybe ble_app_hrs is more complex than nus.

    How do I debug next?

    By the way, I have noticed that RAM size configuration.

    Origin is below:

    RAM_START=0x20002bd0

    RAM_SIZE=0xd430

    If I  increase the RAM_START by 0x10 and decrease the RAM_SIZE by 0x10.

    After:

    RAM_START=0x20002be0

    RAM_SIZE=0xd420

    =>Then UART logs complain RAM size issue when booting up

    So below is my current setting, and nRF52DK goes to bootloader mode directly.

    Thanks.

  • Have you tried with --bl-settings-version 2 ? 

    Please let me know which IDE you are using for compiling ? Usually you set the optimization and pre-processor symbols inside project setting. 

  • Hi Hung,

    Have you tried with --bl-settings-version 2 ? 

    => Yes

    IDE: SEGGER Embedded Studio

  • So below is my current setting, and nRF52DK goes to bootloader mode directly.

    Are you able to run your application code? 

Reply Children
  • Hi Sudharsan,

    After nrfjprog -f nrf52 --recover, download ble_app_hrs_pca10040_s132 by SES.

    The app works fine. Nordic_HRM_DFU is shown in scan list (My other nRF52DK)