Hello everyone,
I have board and I used STM32G071 MCU on this board. I want to activate RDP Level 1. There is my code:
void SysCodeProtection( void )
{
FLASH_OBProgramInitTypeDef pOBInit = {0};
HAL_FLASHEx_OBGetConfig( &pOBInit );
if ( pOBInit.RDPLevel != OB_RDP_LEVEL_1 )
{
HAL_FLASH_Unlock();
HAL_FLASH_OB_Unlock();
pOBInit.OptionType = OPTIONBYTE_RDP;
pOBInit.RDPLevel = OB_RDP_LEVEL_1;
HAL_FLASHEx_OBProgram( &pOBInit );
HAL_FLASH_OB_Launch();
HAL_FLASH_OB_Lock();
HAL_FLASH_Lock();
}
}
I'm programming my MCU on ST-LINK with ST-LINK Utility. But sometimes after I programmed my MCU It's locking or crushing. My power LED is not working on my board and I can't connect my board. I lost many boards after activate RDP If I disable RDP I didn't see any problems. Can anyone help me about it ?