Quantcast
Channel: Wireless Connectivity
Viewing all articles
Browse latest Browse all 116964

Forum Post: Flash Memory Read and Write Only once!!!

$
0
0

Hallo All, 

I know that a lot of posts discussed this problem. However, my problem is that I can write the value only once and when I try to write it another value the value doesn't change? Any help would be appreciated: The following is the main function that I'm using 

void Set_BSL_FW_BIT(char bit,int address)
{

char * Flash_ptr;
Flash_ptr = (char *) address; // Initialize Flash pointer

Enable_Flash_Lock();


*Flash_ptr = bit; // Write value to flash

Disable_Flash_Lock();

}

char Get_BSL_FW_BIT(int address){

char * Flash_ptr;
char value;
Flash_ptr = (char *) address; // Initialize Flash pointer

value = * Flash_ptr;

return value;

}

void Enable_Flash_Lock(void){

__disable_interrupt();
FCTL3 = FWKEY; // Clear Lock bit
FCTL1 = FWKEY+ERASE; // Set Erase bit
FCTL1 = FWKEY+WRT; // Set WRT bit for write operation

}

void Disable_Flash_Lock(void){

FCTL1 = FWKEY; // Clear WRT bit
FCTL3 = FWKEY+LOCK; // Set LOCK bit

__enable_interrupt();

}


Viewing all articles
Browse latest Browse all 116964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>