2014-06-06 07:30 AM
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?
#stm32f42014-06-16 06:15 AM
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.2014-06-16 07:50 AM
Thanks for the update, observe that ''What am i doing wrong?'' is really hard to answer with the context provided in your original question.