Hi every body.
I want to protect my code but I don't know how I can make for set the user password for BSL.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi every body.
I want to protect my code but I don't know how I can make for set the user password for BSL.
Thanks very much Lucas,
I did it according you tell me, but first was necesary setting the linker in IAR:
Project->Options->Linker->Extra Options:
-P(CONST)MYDRIVE1=0x1000-0x11FF
-P(CONST)MYDRIVE2=0x1200-0x13FF
-P(CONST)MYDRIVE3=0x1400-0x15FF
-P(CONST)MYDRIVE4=0x1600-0x17FF
After I my code I make according you tell me:
SYSBSLC &= ~SYSBSLPE;
char * Flash_ptr; // Initialize Flash pointer
Flash_ptr = (char *) 0x1000;
FCTL3 = FWKEY; // Clear Lock bit
FCTL1 = FWKEY+ERASE; // Set Erase bit
*Flash_ptr = 0; // Dummy write to erase Flash seg
FCTL1 = FWKEY; // Clear WRT bit
FCTL3 = FWKEY+LOCK; // Set LOCK bit
Flash_ptr = (char *) 0x1200;
FCTL3 = FWKEY; // Clear Lock bit
FCTL1 = FWKEY+ERASE; // Set Erase bit
*Flash_ptr = 0; // Dummy write to erase Flash seg
FCTL1 = FWKEY; // Clear WRT bit
FCTL3 = FWKEY+LOCK; // Set LOCK bit
Flash_ptr = (char *) 0x1400;
FCTL3 = FWKEY; // Clear Lock bit
FCTL1 = FWKEY+ERASE; // Set Erase bit
*Flash_ptr = 0; // Dummy write to erase Flash seg
FCTL1 = FWKEY; // Clear WRT bit
FCTL3 = FWKEY+LOCK; // Set LOCK bit
Flash_ptr = (char *) 0x1600;
FCTL3 = FWKEY; // Clear Lock bit
FCTL1 = FWKEY+ERASE; // Set Erase bit
*Flash_ptr = 0; // Dummy write to erase Flash seg
FCTL1 = FWKEY; // Clear WRT bit
FCTL3 = FWKEY+LOCK; // Set LOCK bit
The BSL is disable!!!
Thanks very much
**Attention** This is a public forum