Hello,
I'm trying to write to the flash in order to implement a bootloader. I have been trying with my own code and with the hal code, but I can't see any change in the flash. I have included my code.
The debug variable fctl remains at 0x04 in all cases. Running the hal produces the same result - FCTL never changes from 0x04. So it seems that I never get FULL, BUSY or ABORTED. Any ideas on why this piece of code doesn't work? I'm running CCDebugger in IAR.
IEN0 &= ~0x80; FADDRH = 0x02; FADDRL = 0x00; FCTL |= 1<<1; for(int i=0;i<size;i++) { FWDATA = buffer[i]; fctl = FCTL; while(FCTL & 0xC0); } IEN0 |= 0x80;