Skip to main content
jun_01
Associate
August 18, 2011
Question

Help, How to set Read protection in STM32F207

  • August 18, 2011
  • 2 replies
  • 645 views
Posted on August 18, 2011 at 07:34

use API set the RDP to Level_2 :

if ((*(__IO uint8_t*)(OPTCR_BYTE1_ADDRESS) != (uint8_t)OB_RDP_Level_2))

 {

  FLASH_OB_Unlock();

  FLASH_OB_RDPConfig(OB_RDP_Level_2);

  FLASH_OB_Lock();

}

and read value from OPTCR_BYTE1_ADDRESS, send it to USART, make sure the RDP value has changed to 0xCC already.

but , why RDP no effect, the code can be read out by ''Flash Loader Demonstrator'' ?

How to protect code by program to prevent code is read out  ?

    This topic has been closed for replies.

    2 replies

    root
    Associate III
    August 18, 2011
    Posted on August 18, 2011 at 15:06

    Hello,

    My code to change write protection ...

    // disables write protection on sector 4 and 5.

    FLASH_OB_Unlock();

    FLASH_OB_WRPConfig(OB_WRP_Sector_4, DISABLE);

    FLASH_OB_WRPConfig(OB_WRP_Sector_5, DISABLE);

    if (FLASH_OB_Launch() != FLASH_COMPLETE)

    return False;

    FLASH_OB_Lock();

    It seems you are missing the FLASH_OB_Launch() step.

    Thomas.

    jun_01
    jun_01Author
    Associate
    August 18, 2011
    Posted on August 18, 2011 at 15:29

    thank you very much!

    I will test tomorrow.