I'm using nRF52, SDK 17.1.0 on custom hardware.
I am trying to add bonding to the bootloader. The hardware appears to reboot and immediately restart the application code instead of going into bootloader mode.
I have followed section five of this post:
I'm able to get the bootloader,settings.hex, application code and soft device installed on our hardware.
Our application has a command characteristic. One of the commands we send to our device is to enter the bootloader mode. It does this with the following code:
sd_power_gpregret_clr(ZRF_DFU_GPREGRET_ID, 0xFFFFFFFF); sd_power_gpregret_set(ZRF_DFU_GPREGRET_ID, ZRF_DFU_GPREGRET_MASK); sd_nvic_SystemReset();
(this code is a bit abridged as the error handling is not shown). This works when not using the bonded bootloader.
I think the bonded bootloader is not working because there is no explicit sharing of the bonding information (e.g. no call to nrf_dfu_set_peer_data()).
The problem I'm having is trying to add the DFU bonding code (e.g. ble_dfu_bonding.c) to the project. I consistently get errors of unknown types:
Compiling ‘ble_dfu.c’ Compiling ‘ble_dfu_bonded.c’ nrf_dfu_ble_svci_bond_sharing.h ble_dfu_bonded.c unknown type name 'nrf_dfu_set_peer_data_svci_async_t' in definition of macro 'SVCI_DECL' in expansion of macro 'SVCI_1' in expansion of macro 'SVCI_IMPLI' in expansion of macro 'SVCI_IMPL' in expansion of macro 'SVCI' in expansion of macro 'NRF_SVCI_ASYNC_FUNC_DEFINE' unknown type name 'nrf_dfu_set_peer_data_svci_async_t' in definition of macro 'SVCI_1' in expansion of macro 'SVCI_IMPLI' in expansion of macro 'SVCI_IMPL' in expansion of macro 'SVCI' in expansion of macro 'NRF_SVCI_ASYNC_FUNC_DEFINE' nrf_dfu_ble_svci_bond_sharing.h ble_dfu_bonded.c unknown type name 'nrf_dfu_set_peer_data_svci_async_t' in definition of macro 'NRF_SVCI_ASYNC_FUNC_DEFINE' implicit declaration of function 'nrf_dfu_set_peer_data_svci_async_init'; did you mean 'nrf_dfu_set_peer_data_init'? [-Wimplicit-function-declaration] in definition of macro 'NRF_SVCI_ASYNC_FUNC_DEFINE' request for member 'async_func' in something not a structure or union in expansion of macro 'NRF_SVCI_ASYNC_FUNC_DEFINE' request for member 'state' in something not a structure or union in expansion of macro 'NRF_SVCI_ASYNC_FUNC_DEFINE' request for member 'sys_evt_handler' in something not a structure or union in expansion of macro 'NRF_SVCI_ASYNC_FUNC_DEFINE' request for member 'state' in something not a structure or union in expansion of macro 'NRF_SVCI_ASYNC_FUNC_DEFINE' request for member 'async_func' in something not a structure or union in expansion of macro 'NRF_SVCI_ASYNC_FUNC_DEFINE' request for member 'sys_evt_handler' in something not a structure or union in expansion of macro 'NRF_SVCI_ASYNC_FUNC_DEFINE' 'nrf_dfu_peer_data_t' has no member named 'ble_id' 'nrf_dfu_peer_data_t' has no member named 'enc_key' 'SYSTEM_SERVICE_ATT_SIZE' undeclared (first use in this function) each undeclared identifier is reported only once for each function it appears in 'nrf_dfu_peer_data_t' has no member named 'sys_serv_attr' Build failed
I have added the following directories to my project include path:
./components/libraries/bootloader ./components/libraries/bootloader/ble_dfu ./components/libraries/bootloader/dfu
with no luck.
How do I get this functionality included so I can share the peer data?
Thanks.