i want to enable the normal Read Out Protection, currently I do it in the ST Link Utility but better will be in code. I found some old snippets which are for the old Std Lib, not for HAL:
if (FLASH_OB_GetRDP() != SET) {
FLASH_OB_Unlock();
FLASH_OB_RDPConfig(OB_RDP_Level_1);
// Start the Option Bytes programming process
if (FLASH_OB_Launch() != FLASH_COMPLETE) {
// User can add here some code to deal with this error
}
FLASH_OB_Lock();
}
Does anybody have the right Code which is working for HAL Lib?
Thanks!