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 Mathias, 

    You're using nRF52 DK boards?

    Make sure that you have the following Preprocessor Definitions set in KEIL project settings

     BL_SETTINGS_ACCESS_ONLY BOARD_PCA10040 CONFIG_GPIO_AS_PINRESET FLOAT_ABI_HARD NRF52 NRF52832_XXAA NRF52_PAN_74 NRF_DFU_SVCI_ENABLED NRF_DFU_TRANSPORT_BLE=1 NRF_SD_BLE_API_VERSION=6 S132 SOFTDEVICE_PRESENT SWI_DISABLE0 __HEAP_SIZE=8192 __STACK_SIZE=8192

    As for the async interface, this should be initialized as its used in the buttonless DFU service code. The sd_softdevice_vector_table_base_set() call should not hang unless you've not flashed the SD, which you've clearly done as the application code is running and you can connect to your nRF52 board. 

    Would it be possible for you to share the project ( just zip the project folder) so that I can debug the project on my end?

    Best regards

    Bjørn 

Reply
  • Hi Mathias, 

    You're using nRF52 DK boards?

    Make sure that you have the following Preprocessor Definitions set in KEIL project settings

     BL_SETTINGS_ACCESS_ONLY BOARD_PCA10040 CONFIG_GPIO_AS_PINRESET FLOAT_ABI_HARD NRF52 NRF52832_XXAA NRF52_PAN_74 NRF_DFU_SVCI_ENABLED NRF_DFU_TRANSPORT_BLE=1 NRF_SD_BLE_API_VERSION=6 S132 SOFTDEVICE_PRESENT SWI_DISABLE0 __HEAP_SIZE=8192 __STACK_SIZE=8192

    As for the async interface, this should be initialized as its used in the buttonless DFU service code. The sd_softdevice_vector_table_base_set() call should not hang unless you've not flashed the SD, which you've clearly done as the application code is running and you can connect to your nRF52 board. 

    Would it be possible for you to share the project ( just zip the project folder) so that I can debug the project on my end?

    Best regards

    Bjørn 

Children
No Data
Related