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

SDK14.2 Secure DFU Timers

Hi there,

I was trying to use the bootloader_secure_ble example from nRF5_SDK_14.2.0 but it didn't work out of the box... I wasn't able to detect the board from nrfConnect & the advertising indication LED didn't turn on.

Edit : Using PCA10040 with SDK14.2 & S132 V5.0, compiled using armgcc v7.2.1. This problem doesn't seem to happen when using armgcc v5.4.1, I need to look a bit more into it to be sure.

After some playing around, I found out that the problem is in the if (enter_bootloader_mode != 0 || !nrf_dfu_app_is_valid()) condition block. More precisely the inactivity_timeout_timer block execution when started:

ret_val = app_timer_start(nrf_dfu_inactivity_timeout_timer_id,
                              APP_TIMER_TICKS(NRF_DFU_INACTIVITY_TIMEOUT_MS),
                              NULL);

Commenting out app_timer_start() calls from nrf_dfu.c & dfu_req_handling.c (reset timer in that case), allows executing to run properly, but no inactivity timeout anymore ...

I tried editing sdk_config in order to make the app_timer work properly, but I could find anything... I can't find a way to make this example work like the one in secure_dfu_test_images, which has the inactivity timeout feature working has expected.

I'm currently modifying nrf_dfu.c & dfu_req_handling.c from nRF5_SDK_14.2.0 to use RTC instead of app_timer as shown in this thread : SDK12.2 Secure DFU Timeout

There is also a solution using WDT : S130 DFU BLE Bootloader: no timeout?

I think there is a way to make it work without reimplementing these timers using RTC, if anyone have an idea on how to make the app_timer in this example work without modifying nrf_dfu library it would be great !

Cheers, Vincent

Related