Hello Forum,
I am now working for a year with the nrf52832 and whenever I had a software problem I found a solution in this forum so thank s for that :).
However now I started with DFU some problems with it.
Our Setup:
- SDK 14.2
- Development Kit PCA10028 operated with nRF Connect v2.3.0
- Custom board without buttons and LEDs
- Programming Environment: Eclpise Oxygen
- Debugger: Segger
So our main goal is to run a Central operation on the custom board, but we still want to be able to perform a OTA-DFU.
To accomplish this as a template we used the experimental application ble_app_hrs_rscs_relay and merged it with the ble_app_uart_c and the ble_app_buttonless_dfu.
The BLE services hrs and rscs where discarded and deleted from the template.
For the bootloader we used the standard bootloader_secure_ble example given in the SDK compiled with our own generated public keys like shown in Getting Started with Nordics secure dfu bootloader.
The bootloader works fine since I use nRF util tool to:
- erase the chip
- flash the soft device (s132_nrf52_5.0.0_softdevice.hex)
- at last I flash the bootloader and reset the chip.
With that done the application can be transferred to the chip via DFU. The application advertises normally as shown in the picture below.
Sorry for the long intro, but here is my problem. When I try to use the DFU option again to upload the same application after some time it gives me the following error:
Attribute value changed, handle: 0x11, value (0x): 02-00
Attribute value changed, handle: 0x10, value (0x): 01
Attribute value changed, handle: 0x10, value (0x): 20-01-01
DFU failed with error: Timed out when waiting for target device to disconnect.
I suspect I my mistake is located in the following code part:
static void ble_dfu_evt_handler(ble_dfu_buttonless_evt_type_t event) { ret_code_t err_code; switch (event) { case BLE_DFU_EVT_BOOTLOADER_ENTER_PREPARE: NRF_LOG_INFO("Device is preparing to enter bootloader mode."); // YOUR_JOB: Disconnect all bonded devices that currently are connected. // This is required to receive a service changed indication // on bootup after a successful (or aborted) Device Firmware Update. break;
The problem is I don't have any bonded devices since I am using ble_dfu_unbonde.c and also the ble nus_c.c is not bonding to its peripheral.
Thanks in advance for your time and support.
Andreas