When the nRF52 micro-controller is programmed through batch file i.e. nrfjprog utility, the flash fds fails to initialize. Every time, flash fds initialization fails, I have code for soft_Reset.
Initialization fails 3 times and then Flash FDS initializes with success.
After a bit of debugging, I found out fds_register(flash_fds_evt_handler) returns with Success. fds_init() returns with Success.
But the flash_fds_evt_handler() never gets called in the first 3 attempts.
Any insight will be helpful.
I have attached the code snippet below. I am using nRF52932 microcontroller, SDK12.2.0, softdevice s132 v3.0.0
ble_stack_init();
// fds must be initialized after the Softdevice, as it uses the system event to run
flash_fds_init();
// must wait for fds to initializ
while(!fds_init_complete)
{
power_led_red_on();
nrf_delay_ms(1000);
NVIC_SystemReset();
}
// use fds to get the auth params (first time though, this Writes the default auth params)
load_auth_params();