STM32 gotchas
227. Power cycle required after STM32 programming, if RDP Level has been increased

If in STM32, FLASH Read Out Protection is enabled by setting RDP Level 1 or 2, using a device programmer or debugger, the processor, for security reasons, enters a lockup state, from which it cannot be recovered by using software reset. RM0090 explains, that:
If the read protection is set while the debugger is still connected (or has been connected since the last power-on) through JTAG/SWD, apply a POR (power-on reset).

While the chip might have been programmed previously (which of course implies RDP Level 1) for this effect to happen; in production, where usually a "pristine" chip is programmed, the symptoms may be outwardly similar to the case where the PEMPTY bit prevents application to run frun user FLASH. However, in case of RDP Level increase, OBL_LAUNCH won't effect a restart akin to power-on reset.

If the RDP Level increase is performed from a program runing in the chip, RM0090 offers the following workaround to avoid actual power removal:
If the read protection is programmed by software (executing from SRAM), perform a POR to reload the option byte and clear the detected intrusion. This can be done with a transition Standby mode followed by a wake-up.