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

Counting flash writing operations in Bootloader (Bug maybe?)

Hello,

I'm working on the bootloader using SDK13.1. In the file dfu_req_handling.cthere is a variable called m_flash_operations_pendingthat 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.

Parents Reply Children
No Data
Related