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

How to add DFU to ANCS example

Hi, I want to add DFU to ANCS example.

I use SAMSUNG GALAXY Note5, nRFToolbox, SDK 11, nRF52832, softdevice 2.0.1. Bootloader project I use is : nRF5_SDK_11.0.0_89a8197\examples\dfu\bootloader\pca10040\dual_bank_ble_s132\arm5_no_packs, And ANCS projcet I use is : nRF5_SDK_11.0.0_89a8197\examples\ble_peripheral\ble_app_ancs_c\pca10040\s132\arm5_no_packs

When I try DFU, I select device and an application zip file then press upload button. After for a while, the device is automatically rebooted and the Toolbox application is repeating connecting -> starting bootloader -> connecting -> starting bootloader messages

I think there are some errors, so the device is rebooted. But I don't know where problems are and how to figure out where the errors are

Here are BLE Event IDs which are sent to ANCS device. 0x10, 0x14, 0x1A, 0x30, 0x50 then -> device is rebooted.

Thanks.

  • Do you have the same problem when you test with other examples ?

    Can you provide the log file after you do DFU will Toolbox? You can get the log by using the nRFLogger app from App store.

    Please provide the command you use to generate .zip file and list the steps you do to test DFU, start first with flashing the softdevice.

  • Here is command I use 'nrfutil.exe dfu genpkg exam.zip --application app.hex'

    I don't know how to use nRFLogger. I think, When I try DFU with a device which has ANCS service, then the device is stopped.

    In this example, 'nRF5_SDK_11.0.0_89a8197\examples\ble_peripheral\ble_app_ancs_c\pca10040\s132\arm5_no_packs' I use app_error.c file and checked the error location. An error is occurred sd_ble_gap_adv_stop() function in main.c

    I commented out advertising_stop() in reset_prepare, then the device stuck at dfu_ble_svc_peer_data_set again........

  • Hi, so you are telling you are testing with buttonless code ? I assume you have no trouble doing DFU to update the image. Only having trouble with switching from application to bootloader ? Please list exactly the step you used for testing, start with step 1 flashing the softdevice.

    Have you tried to test with the ble_app_hrs_with_dfu ? The buttonless example in our SDK ?

    You said "An error is occurred sd_ble_gap_adv_stop() " what error ?

    then the device stuck at dfu_ble_svc_peer_data_set(), how do you know that ? If you simply step through the code, it won't work because it's an svc call , and the code is in the bootloader code, Keil won't be able to follow.

Related