STLink-V2 appears to reset running code when plugged in to Target
I am currently trying to track a bug in my code running on a STM32F091 MCU that causes my outputs to be really "wrong" after a random amount of time. I have 4 targets running the same code and when one "fails" I'd like to be able to plug in the debugger and view the code execution in Keil. I have set up Keil according to their guide ( http://www.keil.com/support/docs/3697.htm ) so it doesn't reset the code when I connect to it with the software and I know that part works. However, when I physically connect the STLink-V2 debugger to the target all my outputs return to normal before I can even try and connect with Keil. This leads me to believe the code is resetting when it is physically attached to the debugger. Is there anything I can do to prevent this from happening? I have tried to leave the debugger attached over night to one of the targets and connected...except it never seems to "fail" when actively debugging.
