2014-10-25 08:44 PM
Our STM32F103 application hangs consistently within minutes under normal operation without the debugger, but when trying to debug running with ST-LINK SWD it doesn't hang (not using breakpoints).
What is different when running under debug mode that can make the system operate differently? More application info:Keil IDEST-LINK V2FreeRTOSGPS via USART2Accelerometer on I2C11gbit NAND Flash Thanks,Todd #stm32-st-link-swd-hang-debug2014-10-26 06:59 AM
Debuggers are generally invasive, they are going to configure the system so they can access the resources they need. This will mean enabling clocks, pins, internal states, dbgmcu, etc. It was also modify the states of peripheral registers by reading them. Think USART->DR and USART->SR
When monitoring realtime systems, where the debugger will either jam things up, or destroy external equipment, you'd want to output telemetry and debug information via a serial port, or GPIO/LED, so you understand what your code is doing, and where it is when it fails. Watch out for while() loops without timeout/exit conditions. Have your HardFault routine actually output useful diagnostics.