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

Deinit fully BLE

Hi i use a soft with DFU and Beacon. I will use the beacon and when i press on a button i can update the software with DFU. DFU and BEACON works independently but when i will use the 2 together the soft stop or restart.

for deinit the BLE i have try : sd_ble_gap_adv_stop(); softdevice_handler_sd_disable();

but the result as the same. Do you have a method for completely deinit the BLE BEACON ?

Parents Reply Children
  • Thank you for your answer, In fact, I can run the DFU BEACON and independent way, but when I try to send the BEACON and perform OTA with just after DFU, monn program stops. By making several test I noticed that the problem came from the ble_stack_init function (); when I call 2x the program stops, that's why I try to deinit the BLE in order to reset the data with DFU.

    I have try sd_soft_device_disable like say in the post but it doesn't work in my code.

  • i am not sure why your main starts directly after DFU? While in DFU, your device is in bootloader mode and after your firmware upload is complete there should be a reset so that your device comes our of bootloader mode and your application program starts. When your application starts calling ble_stack_init function will be first one after reset. So I do not understand how your DFU and application are able to run without a reset in between? have you modified the DFU code?

  • in fact when i try to use the 2 code in same time, there is no DFU start, the program stop when i will start the DFU. My program start and works (he send BEACON) and when i will launch the DFU my program stop. If i delete all code for the BEACON i can do the DFU after pushing on button. this is why I think my problem is the initialization of the BLE and therefore I would like it removed completely After sending the BEACON and reset to start my DFU. But i can't do that and i don't know why.