Hi,
Here is my issue, I don't enter in bootloader by using the buttonless DFU characteristic. Here below I expose my action and what it happens.
Thank you in advance for your help.
Set-up : nRF5_SDK_13.0.0_04a0bfd, Eclipse 2019 03 IDE, NRF52832_xxAA, s132_nrf52_4.0.2_softdevice, windows 64 bits, NRFConnect 4.22.3, JLINK RTT Viewer
From NRFConnect I go in Secure DFU Service and in Buttonless DFU I click on the button so that indication enabled is sent, then the log display:
-> Data written to 00002902-0000-1000-8000-00805f9b34fb value : (0x) 02-00 "Indication enabled" sent.
I put some NRF_LOG_INFO and SEGGER_RTT_Write in different functions of the ble_dfu.c :
In the switch of void ble_dfu_on_ble_evt(ble_dfu_t * p_dfu, ble_evt_t * p_ble_evt),
in each case function : on_rw_authorize_req(p_dfu, p_ble_evt) , on_write(p_dfu, p_ble_evt); on_hvc(p_dfu, b p_ble_evt)
in function static void on_ctrlpt_write(ble_dfu_t * p_dfu, ble_gatts_evt_write_t const * p_evt_write)
I can notice in JRTT Viewer that the program enters into the function static void on_write(ble_dfu_t * p_dfu, ble_evt_t const * p_ble_evt) and goes into : if (p_evt_write->handle != p_dfu->control_point_char.cccd_handle), I got a return so they are different... (17 and 23)
:INFO:Enter on_write function ' DFU'
:INFO:p_evt_write->handle 17, p_dfu->control_point_char.cccd_handle 23
From that constat, I have different questions :
Why do I get different values of cccd?
What does represent this value of cccd and where is it set initially ?
When I click on the button of Buttonless DFU to send Request, the program enters in the function static void on_rw_authorize_req(ble_dfu_t * p_dfu, ble_evt_t const * p_ble_evt)
I got log :
INFO:on_rw_authorize_req' DFU'
but it doesn't pass the IF condition :
if (
(p_auth_req->type == BLE_GATTS_AUTHORIZE_TYPE_WRITE)
&&
(p_auth_req->request.write.handle == p_dfu->control_point_char.value_handle)
&&
(p_auth_req->request.write.op != BLE_GATTS_OP_PREP_WRITE_REQ)
&&
(p_auth_req->request.write.op != BLE_GATTS_OP_EXEC_WRITE_REQ_NOW)
&&
(p_auth_req->request.write.op != BLE_GATTS_OP_EXEC_WRITE_REQ_CANCEL)
)
{
on_ctrlpt_write(p_dfu, &p_auth_req->request.write);
}
I got with my SEGGER_RTT :
0> p_auth_req->request.write.handle 16, p_dfu->control_point_char.value_handle 22
Same questions :
Why do I get different values of cccd?
What does represent this value of cccd and where is it set initially ?
As in consequence, it doesn't execute the function on_ctrlpt_write which call the function enter_bootloader...