stm32f1x: reset command not working after locking flash

Hi!

After issuing ‘stm32f1x lock 0’, the ‘reset run’ command is not working (device is not enumerated on USB) and I need to reinsert my device to USB slot to be seen by the OS again. Everything works as expected until lock command is issued.

Is this normal? I would prefer the ‘reset run’ would work (as usual) so the device would be reset and I could connect to it without making a power-cycle.

I use SWD, ST-Link v2 (original) and STM32F103TB, OpenOCD v0.10.

Here is my debug log:

http://paste.ubuntu.com/p/cqwTCGy8z8/

Commands I use:

# lock device           
reset halt              
stm32f1x lock 0         
                        
# try to run the device 
reset run               
                        
# finish connection     
exit