Hi ,
I am trying to write data in flash information memory segment C of MSP430F5437.
I have followed sample codes for MSP430F543x flash read write operation.
I am using following function to write data to flash-
main()
{
write_segment(0x1880,15);
}
void write_segment(unsigned long address, char valveOff)
{
unsigned long *Flash_ptr; // Flash pointer
Flash_ptr = (unsigned long *)address; // Initialize Flash pointer to 0x1080
FCTL3 = FWKEY; // Clear Lock bit
FCTL1 = FWKEY + WRT; // Set WRT bit for write operation
*Flash_ptr = valveOff; // Write value to flash
__no_operation();
FCTL1 = FWKEY; // Clear WRT bit
FCTL3 = FWKEY + LOCK; // Set LOCK bit
}
After execution of this function system is reset.Data is written to specified memory
address ,but I did not get reason for system reset.Can anybody help me out with this?
Thank You,
Smita.