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

flash operation error

I usually see a system event "NRF_EVT_FLASH_OPERATION_ERROR" when updating my device firmware. SDK says that this event indicates that the ongoing flash operation has timed out with an error. What I have done would cause this error? How do I handle this event? I don't think restart DFU is a good choice. Thanks.

  • Hello,

    I have tried the proposed solution on SDK 8.0.0, and it was not fixing flash error on command involving swapping.

    First i try to reset the m_swap_state to STATE_SWAP_DIRTY after erasing the swap page, this was causing data corruption if the error occur after successful STATE_DATA_ERASE.

    And as m_swap_state is updated before flash execution complete (sys_event_handler), i have added a backup of the m_swap_state and on NRF_EVT_FLASH_OPERATION_ERROR: if (m_swap_state != STATE_INIT) { m_swap_state = m_prev_swap_state; }

Related