I'm trying to write to the lock bits which occupy the upper 16 bytes of the upper flash page (page 127 or the 128th page). The users guide says this is the only section of page 127 we can write to without entering debug mode, but I'm finding that I can not write the lock bits outside of debug mode. Has anyone had any lock with this or found an odd quirk in the system. The code is straightforward:
uint16 Waddr = 0xfffC; //word address of final 16 byte boundary
uint8 lockingBuff[16]; //initialize to some bitmapped value
HalFlashWrite(Waddr, lockingBuff, 4);
This code should write the lock bits to the value.