Question
Test if running STM32 under debugger.
Posted on June 11, 2012 at 13:10
STM32F103RE
I'm using the 2 wire serial debug pins as GPIO under normal operating conditions, the JTAG/SW functionality gets disabled early in the main function. Obviously this would prevent debugging as the debugger disconnects as soon as the SW lines as reconfigured, so I currently check the status of another I/O pin to see whether I should reconfigure the SW pins or not. Is it possible to test (from user code) whether the STM is running under the debugger so I can automatically reconfigure these pins as required without having to set a value on another pin? #debugger #stm32 #sw #jtag