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

Add buttonless DFU functionality to example ble app blinky

Hi, I am trying to add Buttonless DFU functionality to the ble_app_blinky example.

The process I took

1. added the following files to the project 

ble_dfu.c
ble_dfu_bonded.c
ble_dfu_unbonded.c
nrf_dfu_svci.c

2. added the following paths to Preprocessor->User include Directories  the Common build configuration

../../../../../../components/libraries/bootloader
../../../../../../components/libraries/bootloader/ble_dfu
../../../../../../components/libraries/bootloader/dfu
../../../../../../components/libraries/svc

3. and lastly added the following Preprocessor Defines

BL_SETTINGS_ACCESS_ONLY
NRF_DFU_SVCI_ENABLED
NRF_DFU_TRANSPORT_BLE=1

and then I replaced the services_init() of the ble_app_blinky with

static void services_init(void)
{
uint32_t err_code;
nrf_ble_qwr_init_t qwr_init = {0};
ble_dfu_buttonless_init_t dfus_init = {0};

// Initialize Queued Write Module.
qwr_init.error_handler = nrf_qwr_error_handler;

err_code = nrf_ble_qwr_init(&m_qwr, &qwr_init);
APP_ERROR_CHECK(err_code);

// Initialize the async SVCI interface to bootloader before any interrupts are enabled.
err_code = ble_dfu_buttonless_async_svci_init();
APP_ERROR_CHECK(err_code);
dfus_init.evt_handler = ble_dfu_evt_handler;

err_code = ble_dfu_buttonless_init(&dfus_init);
APP_ERROR_CHECK(err_code);

}

The project is building fine but is not running or working. If I run the software step by step in debug mode then I can see that it ends up running into app_error_fault_handler.

The last function it runs befor going into error handler is ble_advdata_encode() as you can see in the picture below and after the APP_ERROR_CHECK() call it goes into error handler().

I am using "SEGGER Embedded Studio for ARM 5.10a" and  nrf52840dk Rev. 2.0.1.

my main()

What could be the reason for this?

How can I resolve the issue?

Related