adding buttonless dfu service to heart rate service example application

Hello Everyone,

   I used the HRS application example for LESC secure communication and added the OTA to the HRS application. After adding that, the device restarts. I debugged, and the following error is arising.

<error> app: ERROR 8 [NRF_ERROR_INVALID_STATE] at C:\nRF_SDK\nRF5_SDK_17.1.0_ddde560\nRF5_SDK_17.1.0_ddde560\examples\ble_peripheral\ble_app_hrs_LESC_BEACON_V2\main.c:598
PC at: 0x0002CDA3
<error> app: End of error report

this error is arising when this function is called in the service_init() function.

 err_code = ble_dfu_buttonless_init(&dfus_init);
APP_ERROR_CHECK(err_code); 

kindly help me on this issue. I have used nrf_sdk_17.1.0 and Segger embedded studio v5.68. I followed the tutorials https://novelbits.io/nrf52-ota-dfu-ble-part-4/ and nordic official tutorial.

Best Regards,

Srinivasa

Parents
  • Hello Srinivasa,

    I don't see anything inside ble_dfu_buttonless_init() that may cause the function to return with NRF_ERROR_INVALID_STATE. Could you upload your project so I can try to debug it here?

    Best regards,

    Vidar

  • Hi Vidar,

    Thanks for your response, I have attached the project file. kindly review the code and waiting for the quick replay. 

    Best regards,

    Srinivasable_app_hrs_LESC_BEACON_V2.zip

  • No, because I don't know what code changes you've made since uploading the original version. Also, in your comments above, you mentioned that you were able to bond initially, but then it stopped working. I need to know the steps to reproduce that. 

  • yes,

    1. first, I used examples of HRS and flashed the device. from my nRF connect app I can connect and get bonded with the device. 

    2. second thing is I added the buttonless dfu characteristics to the HRS example. and I did the following procedure

    I have enabled the NRF_DFU_BLE_BUTTONLESS_SUPPORT_BONDS is enable in application and NRF_DFU_BLE_REQUIRES_BONDS enabled in secure bootloader and remaining I followed as per procedure as mentioned in nordic infocenter. 

    first I generate bl_settings.hex using following command

    .\nrfutil.exe settings generate --family NRF52 --application ble_app_hrs_pca10040_s132.hex --application-version 1 --bootloader-version 1 --bl-settings-version 2 bl_settings.hex

    next command I used below for generating bl_sd_settings_app.hex

    PS C:\nRF_SDK> mergehex --merge bl_settings.hex secure_bootloader_ble_s132_pca10040.hex s132_nrf52_7.2.0_softdevice.hex ble_app_hrs_pca10040_s132.hex --output bl_sd_settings_app.hex

    for generating package I used following command

    PS C:\nRF_SDK> .\nrfutil pkg generate --hw-version 52 --application-version 2 --application ble_app_hrs_pca10040_s132.hex --sd-req 0x101 --sd-id 0x101 --key-file private.key BEACON_DFU_SEC_TEST.zip

    I flashed the  bl_sd_settings_app.hex to the controller using segger j_flash and the device restarted and started advertising. I tried to connect and bond with the device, but the device was bonded and disconnected after 3 seconds. I tried to connect again but it is not connecting but the device is bonded. I have tried deleting the bonding information on the nRF connect app and again initiated the connection and bonding same issue is arising. 



    regards,

    Srinivasa

  • srinivasa m said:
    I tried to connect again but it is not connecting but the device is bonded. I have tried deleting the bonding information on the nRF connect app and again initiated the connection and bonding same issue is arising. 

    To support this scenario, you need to set the .allow_repairing flag as shown in this post:  RE: SDK15 paring problem . But it is still not clear when you get the NRF_ERROR_INTERNAL errors shown in the log you posted earlier.

  • could you please try OTA with the existing example? 

  • Hi Vidhar,

    Is there any update on this, your response is significant for completing the project.

    Regards,

    Srinivasa

Reply Children
Related