Hi,
I am developing a routine to write a single word in internal flash.
I've tryed the following code but it doesn't work:
//The sector is already unlocked
t_WORD *pa;
pa = (t_WORD *)0xA0000; //High Memory, sector 1
FLASH.MCR.B.PEAS = 0;
FLASH.MCR.B.PGM = 1;
*pa = 0xCAFE; // Data Interlock Write
FLASH.MCR.B.EHV = 1;
while(!FLASH.MCR.B.DONE)
{
;
}
FLASH.MCR.B.PEG = 1;
FLASH.MCR.B.EHV = 0;
FLASH.MCR.B.PGM = 0;
...
The question is that if when the "data interlock" instruction an EXCEPTION IVOR2 arise and the system hang.
What's wrong with the code above?
Thanks to all,
emme
emme
You can go to ecu.zeeff.com to find some working flash writing code.
did you ever find a solution
Hi,
I have exactly the same problem (to erase and program the internal flash).
I work on the MPC5554 but the problem is the same.
Did you find the solution?
Thank you.