Will this code clear the memory block in the flash memory?

Status
Not open for further replies.

london

Member level 4
Joined
Jun 30, 2006
Messages
79
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,945
following program i wrote
{
while(FCTL3 & BUSY);
FCTL2 = FWKEY + FSSEL1 + FN0; // SMCLK/2 = ~500kHz
FCTL3 = FWKEY; // Clear LOCK
FCTL1 = FWKEY + ERASE; // Enable segment erase
*(unsigned int *)0x1000 = 0; // Dummy write, erase info B

while(FCTL3 & BUSY);
FCTL1 = FWKEY + WRT; // Enable write
Lock_f=Lock;

while(FCTL3 & BUSY);
FCTL1 = FWKEY; // Done. Clear WRT
FCTL3 = FWKEY + LOCK;
}

conform me when prog execute the bolded line will be clear the memoey block or only the 0x1000 memory segment in the flash memory?
 

flash memory

Hi,

It will clear when your program has execute that line.
that is thw value of 0x1000 is 0;

the function of your line same as below

int *p;
p= (unsigned int*)0x1000;
*p=0;

by

arsamy
 

    london

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…