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

Adding DFU in custom application

Hi all,

There are lots of posts on the devzone about adding DFU service to a custom application and they have been very helpful in getting to this point.

At this point, I have an application that works very well on its own. Within this application I have defined a custom service with a 128-bit UUID. For adding the DFU service I am following the buttonless_dfu example (which works well on its own).

Now in the services_init() function when I call ble_dfu_init(&m_dfus, &dfus_init); and ble_ais_init(&m_ais, &ais_init);both, the application doesn't advertise anything. The log shows:

SDH:DEBUG:sd_ble_enable: RAM start at 0x20002128
:INFO:running nrf_dfu_settings_init
APP_ERROR:ERROR:Fatal

If I run the application with only the DFU service and do not initialise my own service, it does advertise. Similarly, if I init my own service only it works fine (functionally) without the DFU service.

The problem appears to be similar to these posts:

devzone.nordicsemi.com/.../

devzone.nordicsemi.com/.../

The two main solutions are to increment vs_uuid_count and/or to increase the GATT table size. I have tried the first one and that still results in the same problem. I don't know how to increase the GATT table size and what value should it be increased to. Additionally, I have updated my linker file with the bootloader settings section as well.

Can someone point me in the direction of how to go about finding the root cause of the problem here? I am using SDK 12.2 with nRF52832.

UPDATE:

I am getting an error code of 4, when doing the init of the second service (regardless of whether its the DFU or my custom one - even if I change their orders).

Parents
  • @anasimtiaz

    Take a look at the buttonless DFU.

    Basically, AFIK, that service sets up some data on non-volatile storage and then reboots.

    So that if you have the DFU bootloader installed, it checks the non-volatile storage to find out if it needs to do a normal boot or whether to enter DFU (i.e advertise as a DFU service etc)

    Nordic seem to have changed the implementation of how they signal from the main application to the bootloader i.e via some sort of non-volatile storage, and in SDK 11 and SDK 13, I think this is is via a non volatile register in the MCU, but in SDK 12 they use some of the flash for this purpose.

Reply
  • @anasimtiaz

    Take a look at the buttonless DFU.

    Basically, AFIK, that service sets up some data on non-volatile storage and then reboots.

    So that if you have the DFU bootloader installed, it checks the non-volatile storage to find out if it needs to do a normal boot or whether to enter DFU (i.e advertise as a DFU service etc)

    Nordic seem to have changed the implementation of how they signal from the main application to the bootloader i.e via some sort of non-volatile storage, and in SDK 11 and SDK 13, I think this is is via a non volatile register in the MCU, but in SDK 12 they use some of the flash for this purpose.

Children
No Data
Related