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

NRF_FSTORAGE fails to write/erase during update in Bootloader with two update options. BLE and GSM.

SDK 15.3

SD S340

Bootloader implemented to update over GSM and BLE. BLE update code is taken from example secure_bootloader_dfu*. GSM update code is custom made. SDK is modified to choose which method to use by writing magic numbers to GPREGRET register.

The problem occurs when DFU tries to erase and write old settings. However, when one type of update works, the other does not, also it looks like to be dependent on sdk_config.h settings, particularly:

Having choose FSTORAGE_NVMC to 1 and define BLE_STACK_SUPPORT_REQD updates successfully over BLE, but fails with GSM update.

// <i> NRF_FSTORAGE_SD uses the nrf_fstorage_sd backend implementation using the SoftDevice API. Use this if you have a SoftDevice present.
// <i> NRF_FSTORAGE_NVMC uses the nrf_fstorage_nvmc implementation. Use this setting if you don't use the SoftDevice.
// <1=> NRF_FSTORAGE_NVMC
// <2=> NRF_FSTORAGE_SD

#ifndef FDS_BACKEND
#define FDS_BACKEND 1
#endif

Changing FDS_BACKEND to 2 and removing BLE_STACK_SUPPORT_REQD, enables successful update over GSM, but BLE fails.

Failure pattern, when GSM fails

Failure pattern, when BLE fails

Related