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

Buttonless DFU SDK14.1 without bonding

Board: PCA10040 (NRF52832)

Compiler: GCC

SDK: 14.1

I'm trying to add the buttonless DFU service to my application and I've had several issues.

First, I have a custom BLE service and the DFU service also requires a custom 128-bit UUID. When I have both of them initialized, the application crashes with "fatal error" and constantly resets.

If I only have my service initialized, everything runs correctly. When only the DFU service is initialized, my device advertises correctly (seen from the nRFConnect app) but once I connect, none of my services appear and nRFConnect shows:

Error 133 (0x85): GATT ERROR
Disconnected

I've modified my code according to this example from Nordic and added the following code to my init function:

err_code = ble_dfu_buttonless_async_svci_init();
APP_ERROR_CHECK(err_code);

after seeing this suggested from another user. This hasn't solved my problem however.

When I program my board, I go through the following steps:

  1. Program the softdevice (5.0.0)
  2. Program the bootloader (from the secure_ble_bootloader)
  3. Program the bootloader settings (generated using nrfutil)
  4. Program my application
  5. Reset the board

Has anyone had this problem with the buttonless dfu service?

EDIT: So a quick update. I was able to get everything working. Here's how:

  1. I had already changed the sdk_config.h with the values that Hung suggested but I had remembered reading that you needed to change what I assumed was a global "sdk_config.h" in "<sdk_root>/config/sdk_config.h". This is what I was changing the entire time and nothing worked until I changed the local sdk_config.h. So that was dumb.

  2. I went through the entire process I listed previously and everything worked after changing my local sdk_config.h.

Thank you for your help Hung!

Parents
    1. If you have 2 128bit UUIDs service, you need to increase NRF_SDH_BLE_VS_UUID_COUNT in sdk_config.h

    2. If you change the services, you should erase bond information on the phone, try turn off and on Bluetooth, there is a chance that the attribute table is cached. Also make sure you set NRF_SDH_BLE_SERVICE_CHANGED = 1 in sdk_config.h

    3. Please try to test first the bootloader alone, just to make sure DFU works (no bootloader setting or application flashing). Then please test with the default buttonless example, before you implement it on your application.

  • Hi Hung,

    How do you test the bootloader alone? I programmed the softdevice and the bootloader into my device, but I cannot find it when I scan on nRF Connect. Does that mean my bootloader is wrong?

    Thanks

Reply Children
Related