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.

CC2541 - lock bits

Please confirm: after a programmer programs the chip, the lock bit page is locked. The only way to access the lock bits is for the chip to be in debug mode, or to configure the  hex file to set the lock bits. Under no special circumstances the application can set the lock bits.

After experimenting with the following code:

UINT8 memctr;
UINT8 * flash_ptr;
 
//Save mapping to restore later
memctr = MEMCTR;
 
uint16 lockBitsAddr = 0xfffC;    
 
uint8 lockBitsData[16]; 
   
MEMCTR = (MEMCTR & 0xF8u) | 0x07u;
 
flash_ptr = (UINT8 *)lockBitsAddr;
 
for (UINT8 i = 0; i < 16; i++) // read lock bit info
{
    lockBitsData[i] = *flash_ptr++;
}
 
lockBitsData[15] &= 0x7f; // clear DBGLOCK bit
 
HalFlashWrite(lockBitsAddr, lockBitsData, 4);
 
//restore mapping
MEMCTR = memctr;

The memory was locked; the only access to the flash was through a mass erase. However, the code has not executed properly, indicating that some of the flash has been corrupted. 

Could you therefore confirm that no alternatives exist to manipulate DBGLOCK during regular operation of the device?

Thank you!