Skip to main content
oliver2399
Associate
June 6, 2014
Question

STM32F4 read out protection also enables write protection

  • June 6, 2014
  • 2 replies
  • 748 views
Posted on June 06, 2014 at 16:30

When setting read protection to level 1 and rebooting the controller, the bootloader is not abled to erase flash. I get the Bit FLASH_FLAG_WRPERR set. According to the reference manual, erasing and writing to flash should be possible if no swd/jtag is connected and the controller is booting from flash. Both is the case. What am i doing wrong?

#stm32f4
This topic has been closed for replies.

2 replies

oliver2399
Associate
June 16, 2014
Posted on June 16, 2014 at 15:15

If anybody cares: i solved the problem.

i used

FLASH->OPTCR &= !(FLASH_OPTCR_RDP);

instead of

FLASH->OPTCR &= ~(FLASH_OPTCR_RDP);

so the complete register was zeroed, even the write protection bits.

Tesla DeLorean
Guru
June 16, 2014
Posted on June 16, 2014 at 16:50

Thanks for the update, observe that ''What am i doing wrong?'' is really hard to answer with the context provided in your original question.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..