cancel
Showing results for 
Search instead for 
Did you mean: 

Changing security option bytes (RDP level) for STM32H7 devices

FBern.2
Associate II

Hello,

I am trying to change RDP level in my own project with STM32H753 micro but without succcess.

No problem if I use the STM32 Cube Programmer but with my own fw I have error in HAL_FLASHEx_OBProgram() function.

In this function the error occurs in FLASH_WaitForLastOperation().

This is my part of code to change RDP level.

HAL_FLASHEx_OBGetConfig(&OBInit);

HAL_FLASH_OB_Unlock();

HAL_FLASH_Unlock();

OBInit.OptionType = OPTIONBYTE_RDP;

OBInit.RDPLevel  = OB_RDP_LEVEL_1;

err = HAL_FLASHEx_OBProgram(&OBInit);

if (err == HAL_OK)

{

  HAL_FLASH_OB_Launch();

HAL_FLASH_OB_Lock();

HAL_FLASH_Lock();

return (HAL_OK); 

}

else

{

   return (HAL_ERROR); 

}

May you help me please?

Thank you in advance

Fabio

1 REPLY 1
FBern.2
Associate II

no suggrstions?