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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
943 次查看
maxxu
Contributor IV

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 项奖励
回复
1 解答
920 次查看
dianabatrlova
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

在原帖中查看解决方案

1 回复
921 次查看
dianabatrlova
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