Hello,
I'm working on the bootloader using SDK13.1. In the file dfu_req_handling.c
there is a variable called m_flash_operations_pending
that gets incremented with every call to nrf_dfu_flash_store()
or nrf_dfu_flash_erase()
.
My question is why you don't increase this variable each time you write to the DFU settings. Each time nrf_dfu_settings_write()
is called, two flash calls happen, one erase and one write. I'm currently having problems with the DFU settings being clean after an error recovery (reset with APP_ERROR_CHECK), and it's because the statement while(m_flash_operations_pending)
doesn't make sure that all the writes to the DFU settings have finished. Is there a particular reason for this? I think this may have been overlooked.
NOTE: I'm not trying to get rid of the reset, it should happen in this case. I'm actually causing it to test the reliability of the bootloader. I want to make sure that the DFU settings get written to in case of such an error.