Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Adding Buttonless DFU service to an existing application: GATT Timeout error while trying to write ENTER_BOOTLOADER command

Hi,

I'm trying to implement Buttonless DFU into an existing BLE application. I'm using nRF52832 V1.1.0 boards (one for the BLE peripheral running the application and buttonless DFU service and another one to run nRFConnect firmware on), SoftDevice 132v6.0 and SDK15.0.

First, I followed the steps described here: https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-0-0/service_dfu, "Adding Buttonless Secure DFU Service to a BLE application". In order the add Buttonless Secure DFU Service to the existing application.

After that, I followed the steps described here: https://github.com/gamnes/nRF52832-buttonless-dfu-development-tutorial, in order to a) create our own bootloader using our own private/public key pair, b) Create our own FW.zip package which we can upload to the device over wireless DFU and c) Create a product release image including all components. Both b) and c) use an application.hex file generated from the extended BLE application with the Buttonless DFU service added as described above. Ultimately, I was able to flash all components (bootloader and correct settings generated in c), softdevice and application) onto one of the nRF52 boards. I then flashed the other one with the nRF Connect app firmware and was able to connect with the BLE peripheral board. I could see both the custom service (which is associated with the already existing BLE application) and the DFU service, as shown below:

I then click the DFU button also shown and tried to flash the zip.file generated in b), which contains the softdevice + application with updated adv name, in order to be able to double check the update's success. However, after waiting some time (and the nRF connect app being stuck at "initializing"), I get the following error message:

Since then, I've been trying to find the solution to this problem... I've tried adding some things that are not in my application but are in the buttonless DFU BLE example code, such as:

  • Setting BLE_DFU_ENABLED from 0 to 1. Seems logical to do so, as it is said in the comments that in such a way, I enable DFU Service. But this is not described in the documentation as part of adding the DFU service to an existing BLE application (https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-0-0/service_dfu).
  • Initialize the async SVCI interface to bootloader, in the services_init(void) method. This is also something that is done in the buttonless DFU BLE example but not described in the documentation as part of adding the DFU service to an existing BLE application. It consists of calling "ble_dfu_buttonless_async_svci_init()". However, when I implement this, my code is stuck in the internal SVC method "sd_softdevice_vector_table_base_set(NRF_UICR->NRFFW[0])" and thus doesn't work at all anymore... I'm not sure if I need to add this, and if so, what else I need to do to get it working this way?

So, to summarize, so far my efforts to find the solution have been in vain. I'm at a bit of a loss here and don't know at all what else I'm missing / doing wrong.

Thank you in advance for having a look at this question and assisting me in finding a solution.

Kind regards,

Mathias

Parents
  • Hi Bjørn,

    Thank you for making the case private. I've also check the Preprocessor Definitions you mentioned and two of them were not there: BL_SETTINGS_ACCESS_ONLY and CONFIG_GPIO_AS_PINRESET. I added them but it had no effect.

    You can find the code here: ... . To be able to compile, the folder should be placed in SDK15.0-Location/examples.

    Thanks again for your help.

    Kind regards,

    Mathias

Reply
  • Hi Bjørn,

    Thank you for making the case private. I've also check the Preprocessor Definitions you mentioned and two of them were not there: BL_SETTINGS_ACCESS_ONLY and CONFIG_GPIO_AS_PINRESET. I added them but it had no effect.

    You can find the code here: ... . To be able to compile, the folder should be placed in SDK15.0-Location/examples.

    Thanks again for your help.

    Kind regards,

    Mathias

Children
No Data
Related