Hi,
- the mcu did not use the secure featrue, i used the freemaster tool to read the mcu data after i download the program by codeworrior "debug" button and do power off to reset the mcu.
As I understand, you didn’t verify that program code is as you left it, you only verified that in Freemaster you see wrong data. This is expected if code stuck somewhere.
It would be nice to verify if code in flash isn’t modified. I don’t know yet how to do it with Eclipse version of CW, I’ll try latter and let you know after I figure the way how to do it without code reflashing. I hope you didn’t erase or reflash bad unit yet?
i used eeprom function generated by processor expert to modify the eeprom and then i read back the data to check whether the data is writed success,
Well, read to verify write was OK isn’t bad thing. But, if MCU is left powered from start to the end of EEPROM programming, the nothing wrong is likely to happen to EEPROM ECC. Problem may arise if MCU is powered down in the middle of EEPROM operation.
and how to handle machine exception? is this handle by the.processoer expert settings CPU-Events-OnMachineException ?
(I’m not using Processor Expert. It always pays to deep study MCU features, and once done code generator like PE IMO just adds an extra level of complication, also the question arises how I’ll move to MCU, which is not supported by PE...) I tried creating project with PE, yes it’s OnMachineException. By default, in case ME handler is not defined, ME vector in PE generated vectors.c points to empty interrupt handler! This is obvious PE bug. Since ME doesn’t stack registers on exception, code will run into the weeds... By default it should be routine with for(;;) loop inside.
if the eeprom ecc triggers a machine exception ,how to solve the eeprom uncorrect data to prevent it from eeprom endless machine exception loop?
i also see.that there is a OnSRAM_ECCerrer events settings in the CompomentInspecter Cpu ,can this also help?
SRAM ECC has nothing to do with EEPROM ECC. Oh, if there would be registers, which pointed to address with bad ECC! It could be also some EEPROM check ECC command. Here it was discussed a bit:
https://community.nxp.com/thread/453862?sr=stream&ru=214565
You could handle it like this: Prior to reading any EEPROM address, you should register read address A in some global variable. Once ME happens, check bits in MMCECH registers to verify if exception was caused by EEPROM ECC or something different. If it really was EEPROM, erase EEPROM sector at A. Then reset MCU using COP or any other means.
Regards,
Edward