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

Establish connection for DFU (implementing DFU master over BLE)

Hello,

I implement my own DFU master in nrf52 using SDK11 to replace use of Nordic mobile App. Target to upgrade is also nrf52 but with SDK15.

I have difficulty to get GAP connection.

From master I initiate connection with :

sd_ble_gap_connect(...)

In bootloader of peripheral (nrf_dfu_ble.c), BLE_GAP_EVT_SEC_PARAMS_REQUEST is received but following error occurs :

err_code = sd_ble_gatts_value_get(m_conn_handle, BLE_UUID_GATT_CHARACTERISTIC_SERVICE_CHANGED, &gatts_value);
APP_ERROR_CHECK(err_code); // found error 5 (not found)

If I comment this code, the connection is possible and I can do the DFU.

Any idea ?

Thanks & best regards

Vincent

Parents
  • Hi Vincent,

    Sorry for the late reply. The DFU master sends a BLE_GAP_EVT_SEC_PARAMS_REQUEST, but the bootloader doesn't support bonding or pairing.

    What happens then is that sd_ble_gatts_value_get() returns NRF_ERROR_NOT_FOUND and this gets picked up by APP_ERROR_CHECK, which causes the nRF to reset.

    Have you added the Service Changed characteristic on the DFU master? You can do this by changing the NRF_CONFIG macro

    #define NRF_SDH_BLE_SERVICE_CHANGED

    to 1 in the sdk_config.h file in SDK v16.0.0.

    Best regards,

    Marjeris

  • Hello Marjeris,

    Nice to hear you. The master DFU use SDK11 and I am looking now for the way to enable Service Changed characteristic in SDK11.

    I found the enum SD_BLE_GATTS_SERVICE_CHANGED but I don't know where to enable it (there is no sdk_config.h).

    Best regards and thanks for the support

Reply Children
No Data
Related