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 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 ? 

Children
  • 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. 

  • Hi Hung,

    1. I don't know where to enable indication and write 0x0104

    I have noticed that there is locked icon.Is that normal?

    But I found there are two options request and command in write icon of Secure Buttonless DFU.

     

    When I send request, logs are below:

    When I send command, logs are below. And no response.

    =============

    2. I will try your buttonless dfu application first and compare it.

    [Update 12/2] 

    The difference between app_new.hex and app_original.hex is NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS flag?

    [Update 12/3]

    Test A 

    A.1 Execute flash.bat using app_original.hex

    A.2 Bond device from Android app

    A.3 Connect device 

    A.4 Start DFU, and select package1.zip

    A.5 nRF52DK goes to bootloader succesfully but process is failed, not finished.

    Logs are below:

    TestB 

    B.1 Execute flash.bat using app_new.hex

    ...

    ...

    B.5 Got same result as Test A.

    Are those result is expected?

     =======

    3. I can't not find where to bond in nRFConnect on PC.

    Thanks for help !!

Related