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 Reply
  • Hi Hung,

    I have just enabled  NRF_DFU_BLE_REQUIRES_BONDS  and NRF_SDH_BLE_SERVICE_CHANGED  in bootloader.

    In application, there is only NRF_SDH_BLE_SERVICE_CHANGED, I can not find NRF_DFU_BLE_REQUIRES_BONDS.

    And there is other flag NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS.

    If I set it to 1, application bootup will be failed => can not see advertising

    [11/27  4:00 pm Update:]

    After adding DEBUG in Preprocessor. The error is below

    [====]

    If I set it to 0, application bootup will be OK.=> see advertising

Children
  • Hi Vick, 
    Could you please run the application in debug and add a breakpoint in side the function ble_dfu_buttonless_init() and step into the code of the function to find which exact function inside that returned INVALID_STATE ? 

    I suspect it has something to do with that you integrated the buttonless feature into hrs example. (I assume you increased the NRF_SDH_BLE_VS_UUID_COUNT ? )

    Could you try testing again with the unmodified ble_app_buttonless_dfu ? 

  • Hi Hung,

    1. Please see below:

    "ble_dfu_buttonless_backend_init"

    2. Yes, from 1 to 2.  I followed UBX-19050198 page19-24.

    3. Could you try testing again with the unmodified ble_app_buttonless_dfu ? 

    => I'm not sure about "unmodified ble_app_buttonless_dfu". What's the condition?

    Thanks!

  • Hi Vick 

    It seems that you got the error because the peer manager was not initialized before the buttonless service init (ble_dfu_buttonless_init() ). 
    If you have a look at the ble_app_buttonless example you can find that we call peer_manager_init() before we call service_init() (which call ble_dfu_buttonless_init() ) when in ble_app_hrs it's not the case.

    Please try to change that and let us know if you still have the issue.

  • Hi Hung

    It works, the device goes to advertising now!

    After that, I'm trying to do DFU, but meet some problem.

    Please see below.

    1. Generate zip first

    nrfutil pkg generate --application ble_app_hrs_pca10040_s132.hex --application-version-string "1.0.0" --hw-version 52 --sd-req 0xCB --key-file private.key app_v1.zip

    2. Use Android phone nRFconnect 

    3. Scan and bond first

    4. Connect 

    5. Click DFU

    6. Select file zip

    7. Starting DFU

    8. Timeout

    9. Device is disconnected.

    9. LED1 of nRF52DK is lit. DFU process is not successfull.

    Is there anything wrong ?

    ===========

    So I tried DFU by other nRF52DK, there is an error msg below:

    Is there any configuration I should modify?

    Thanks.

  • Hi Vick,

    Please check the log in nRF Connect on Android (swipe right on the screen to see the log). 

    I think what you can try to test is to manually switch the buttonless application to the bootloader (enable indication, then write 0x0104 to the application , or click switch to DFU if the app support that feature)

    Then you can check if the bootloader is advertising with DFU_Targ. 

    I also attached here the project, files I used to test here. It's with SDK v16.0 , nRF52832. 



    2063.DFU_Bond.zip

    If you want to test with nRF Connect on PC, you need to bond with the device before testing. 

Related