On the problem of machine exceptions causing the system to restart continuously

cancel
Showing results for 
Search instead for 
Did you mean: 

On the problem of machine exceptions causing the system to restart continuously

Jump to solution
78 Views
Contributor III

hi

      Hello everyone, my s12zvml31 driver will occasionally stop working after repeatedly switching on and off, and it will be invalid to power on again. Then, it will resume normal operation after re writing the program.
    My analysis is because the program saves data to EEPROM when power down, and there is watchdog restart command in machine exceptions interrupt. I suspect that an error occurred while writing EEPROM during power down, which caused the machine exceptions interrupt to be triggered and the system was restarted
    I'd like to ask experts a few questions
1. Why can't the error flag reset after a restart, resulting in repeated restarts?
2. Is that register not cleared by reset interrupt?
3. Can there be any way to eliminate this problem? I can tolerate EEPROM data saving errors, but I can't accept repeated chip reboots?

0 Kudos
1 Solution
55 Views
NXP TechSupport
NXP TechSupport

Hi,

 

It is possible that the ECC error occurs in the situation described above. However, the machine exception interrupt occurs after the read corrupted data. Do you read EEPROM after the reset, for example, during initialization?

Possible workaround depends on your application requirements, for example:

Check where the source of the machine exception occurs in the MMCEC register before MCU reset by the watchdog in machine exception interrupt.

After that, you can erase memory where the corrupted data are located. Or you can store variable in the RAM which indicates that ECC error occurs in EEPROM. So, you can skip reading corrupted data in a certain memory after reset.

Or you can use the approach described below: https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-machine-exception-caused-by-ECC-issue-...

 

I hope it helps.

Best regards,

Diana

View solution in original post

1 Reply
56 Views
NXP TechSupport
NXP TechSupport

Hi,

 

It is possible that the ECC error occurs in the situation described above. However, the machine exception interrupt occurs after the read corrupted data. Do you read EEPROM after the reset, for example, during initialization?

Possible workaround depends on your application requirements, for example:

Check where the source of the machine exception occurs in the MMCEC register before MCU reset by the watchdog in machine exception interrupt.

After that, you can erase memory where the corrupted data are located. Or you can store variable in the RAM which indicates that ECC error occurs in EEPROM. So, you can skip reading corrupted data in a certain memory after reset.

Or you can use the approach described below: https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-machine-exception-caused-by-ECC-issue-...

 

I hope it helps.

Best regards,

Diana

View solution in original post