Improper Shutdown and Data Corruption

Question:
Why can an improper shutdown lead to data corruption?
Answer:

The article Background Sector Switch Execution describes, how NvM sets the mode of the FEE right after NvM_WriteAll request.


Although NvM is idle after having finished the NvM_WriteAll request, the call of Fee_SetMode might result in a Background Sector Switch and a busy FEE. However, the BswM module, which is responsible for the shutdown, only waits for an idle NvM before starting the shutdown process. It might be possible that the BswM shuts down the power while the FEE is accessing the flash. A possible consequence is corrupted data in flash. In order to avoid such a situation, an additional state Wait on FEE has to be configured within the BswM’s ECU state handling. 



Article ID: 1199
Last updated: 2018-12-05
Revision: 2
MICROSAR and DaVinci -> Troubleshooting -> MICROSAR MEM -> Improper Shutdown and Data Corruption
https://kb.vector.com/entry/1199/