When I first generated and loaded CSEC_MASTER_ECU, the return was successful. Afterwards, CSEc was restored to factory settings and successfully returned. Subsequently, I generated and loaded CSEC_MASTER_ECU again, and the result returned was also successful. But when I tried to reset CSEc to factory settings, I returned an error code. If the power is turned off and restarted again, repeat the above steps to restore the factory settings and there will be no error code returned.Attached are the return codes for normal and abnormal states


The following is my code. I have debugged and analyzed the code. Before performing steps such as loading CSEC_MASTER-ECU and restoring factory settings, I will first check if EEESize is 0. If it is 0, I will then perform a flash partition operation. I compared the differences between the two processes. The first time I powered on, the EEESize size was 0. If I didn't perform a power down operation and entered the process again, the EEESize size would be 4096, which resulted in not performing a flash partition operation. I think this difference may have caused an error code to be returned when restoring the factory settings in the future. If that's the case, how do I need to modify my code correctly? Performing flash partition operations and CSEC initialization every time seems to be abnormal logic.
Regards,Kane123Hu.
