I am trying DFU with:
- BOARD_PCA10040,
- nRF52_SDK_0.9.2_dbc28c9
- s132_nrf52_1.0.0-3.alpha
One interesting thing is the SDK_0.9.2_dbc28c9 can not work with s132_nrf52_2.0.0-7.alpha and s132_nrf52_2.0.0-4.alpha, which suppose to be newer!
I use dual_bank_ble_s132 project in examples\dfu\bootloader, change the support board to BOARD_PCA10040. I can see the advertisement of DfuTarg in the Master Control Panel of my smart phone. When I choose the application hex dfu_test_app_hrm_s132.hex file in the \examples\dfu\ble_dfu_send_hex and start the DFU. The Master Control Panel shows:
- "Connecting"
- "Starting DFU..."
- "0%"
and then the BOARD_PCA10040 restart !!! I debug the bootloader and catch the message:
0> m_error_code = 12292
0> m_line_num = 291
0> m_p_file_name=............\components\libraries\bootloader_dfu\dfu_transport_ble.c
The error take place in the file: ble_dfu.c the function: uint32_t ble_dfu_response_send(...) line 665: return sd_ble_gatts_hvx(p_dfu->conn_handle, &hvx_params);
and the uint32_t ble_dfu_response_send(...) function was called in the static void dfu_cb_handler(...) functon:
case START_PACKET:
// Translate the err_code returned by the above function to DFU Response Value.
resp_val = nrf_err_code_translate(result, BLE_DFU_START_PROCEDURE);
err_code = ble_dfu_response_send(&m_dfu,
BLE_DFU_START_PROCEDURE,
resp_val);
APP_ERROR_CHECK(err_code);
break;
What does it mean? Something wrong in the hex file? But it is the test file provide in the sdk. How can I modify to make it run?