STM32L552CCT6 Read Protection Question
I want to apply Read Protection to the STM32L552CCT6 .
If you execute HAL_FLASH_OB_Launch(); after setting Read Protection, reboot does not work.
Read Protection is applied only when the power is physically rebooted.
I want Read Protection to be applied as ST reboots after executing HAL_FLASH_OB_Launch();.
Below is the code I used.
----------------------------------------------------------------------------------------------------------------------------
///* Unlock the Flash to enable the flash control register access *************/
HAL_FLASH_Unlock();
///* Unlock the Options Bytes *************************************************/
HAL_FLASH_OB_Unlock();
OptionsBytesStruct.RDPLevel = OB_RDP_LEVEL_1;
OptionsBytesStruct.OptionType = OPTIONBYTE_RDP;
if(HAL_FLASHEx_OBProgram(&OptionsBytesStruct) != HAL_OK)
{
/* Error occurred while options bytes programming. **********************/
}
else
{
/* Generate System Reset to load the new option byte values ***************/
HAL_FLASH_OB_Launch();
}
/* Lock the Options Bytes *************************************************/
HAL_FLASH_OB_Lock();
HAL_FLASH_Lock();
---------------------------------------------------------------------------------------------------------------------------------------
Help
