cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 read out protection also enables write protection

oliver2399
Associate
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
2 REPLIES 2
oliver2399
Associate
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.

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
Up vote any posts that you find helpful, it shows what's working..