Question
Problem with NVIC_SystemReset() after FLASH_ReadOutProtection(ENABLE)
Posted on July 28, 2015 at 23:04
I'm trying to set Flash read protection, so I run this at startup:
if (FLASH_GetReadOutProtectionStatus() != SET) {
FLASH_ReadOutProtection(ENABLE);
}
This works wrt read protection, in that if I connect later with an ST-Link, it complains correctly that it cannot read from Flash. This is good. However, if I later call NVIC_SystemReset(), the processor seems to hang, and I can't connect to it to find out where it is stuck - because of the red protection.
If I do not set the read protection programmatically, but set it using ST-Link, everything works fine. However, I'd like to avoid that extra step.
By the way, this is with the STM32F The same code (different library code, of course) works correctly on the STM32F
Any thoughts? Thanks!