AnsweredAssumed Answered

Problem with NVIC_SystemReset() after FLASH_ReadOutProtection(ENABLE)

Question asked by grimes.robert on Jul 28, 2015
Latest reply on Sep 13, 2016 by pribyl.adam
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 STM32F103.  The same code (different library code, of course) works correctly on the STM32F071.

Any thoughts?  Thanks!

Outcomes