AnsweredAssumed Answered

STM32F0 and Read Out Protect problem

Question asked by xadamus on May 19, 2017
Latest reply on Nov 23, 2017 by Olivier FAURAX

I want to protect ST32F030 code RDP_Level_1. I use stadrard perihperial library and call protect function when program starts:

 

void ProtectMcu (void)

{

   if(FLASH_OB_GetRDP()==SET) return;
   FLASH_OB_Unlock();
   FLASH_OB_RDPConfig(OB_RDP_Level_1);
   FLASH_WaitForLastOperation(FLASH_ER_PRG_TIMEOUT);
   FLASH_OB_Lock();
   FLASH_OB_Launch();

  }

 

But it doesnt work. The function executes full sentence each time the processor starts. I also power down device but with no effect - code is not protected and can be read by a debugger.

When I protect device by a programmer it is protected ok.

Where is the problem ?

 

With best regards

Outcomes