Hi David,
Thanks for your swift response.
Actually I found the solution but not sure, why it is happening like that.
Actually I'm trying to flash at the end address of my device MPC5602P which is 0x3FFF8 with eight bytes 0xFFFFFFFFFFFFFFFF as it replaces the 0xFFFF0000FFFF0000 .
Instead of using 0xFFFFFFFFFFFFFFFF, I used 0x0 which worked for me, so as to come out of while(!(CFLASH.MCR.B.PEG == 1)) {} ;
If possible, can you try to share the reason for the same.
Thanks in advance,
Raju