Recentally we receive some failed modules, according to the failure reports, the failure are always happened when the module is powered up.
According to the test result, we find the program is always stuck in below while(1), that means the failed modules will be reset again and again. Does it mean that program to clear error flag of FSTAT and FERFSTAT should be added before module reset?
This module had been released to market for several years, but the failed modules are only found in the modules manufactured in last year. Why? Does it mean that CPU reset could clear these error flags for old S12XE chips, but not for the new chips manufactered in last year? Please advise. Thank you.
status=LaunchFlashCommand(0 ,ENABLE_EEPROM_EMULATION, 0, 0, 0, 0, 0, 0);
if(((status.fstat_var&0x33)!=0)||((status.ferfstat_var&0xDF)!=0))
{
normal_rst1=0xAA;
normal_rst2=0xAA;
while(1);
}
Jason,
It's a pity you don't know which FSTAT or FERSTAT bits led to the problem.
Do you provide any real means to prevent power loss during EEE write to flash operation? If not I would expect some errors sometimes due to incomplete write/erase on power down. The question is are such errors recoverable without repartition or not.
I would try issuing EEE query command to check whether xxPART parameters are OK and to know how big is erase count.
Hi Edward,
Thank you for the suggestion. I'll try to issue EEE query command to request EEE status. But up to now, we can't reproduce the failure in our test lab. Is it possible EMC issue on site resulted in the errors of FSTAT and FERSTAT registers?
Best Regards,
Jason Zhu
Hi Jason,
I doubt it, more likely EMC caused reset during write/erase.
Best Regards,
Edward
Hi,
I would like to suggest you to compare your approach to example which is working - see atachment.
There is no info how you process the EEEPROM in your example.
Some more examples you can find at:
LAMA's S12XE unofficial examples
Best regards,
Ladislav
Hi Iama,
Thank you for the example.
According to AN3743, if errors of FSTAT and FERSTAT registers are detected, the user should use software to mitigate the occurrence and clear the error flag. But I can't find out example code in AN3743SW example or your attached example. Any example code for my reference?
Best Regards,
Jason Zhu