Skip to main content
misha-zvukovik
Visitor II
August 30, 2019
Question

How can i disable WRP with RDP is active? STM32F103RGT6

  • August 30, 2019
  • 0 replies
  • 584 views

I am use this code for write page with disabling WRP:

FLASH_Unlock();
if( FLASH->WRPR != 0xFFFFFFFF ) //WRP is active for any pages
{
 FLASH_EraseOptionBytes();
 NVIC_SystemReset(); //according to the manual
}
if( FLASH_ErasePage( address ) != FLASH_COMPLETE )
{
 printf( "FAIL" );
}
FLASH_ProgramWord( address, value );
FLASH_EnableWriteProtection( FLASH_WRProt_Pages0to1 );
FLASH_Lock();

If RDP is not active or WRP is not active, it work successfull,

but if RDP and WRP is active, printf( "FAIL" ) is called, and write is impossible

This topic has been closed for replies.