AnsweredAssumed Answered

STM32 Behavior different when on debugger

Question asked by Erratosthenes on Nov 7, 2013
Latest reply on Nov 8, 2013 by hargreaves.steve
Hello all,

Recently I came across a puzzling situation. I have a system that behaves differently depending on whether I am debugging the application or running otherwise. 

My environment
1) STM32F103x running at 8MHz
2) IAR jtrace debugger 
3) IAR Compiler for ARM

Some specifics
I have a timer configured in up counting mode with the update and one compare interrupt enabled. I use this timer to control some LEDs in a very elaborate pattern. 
What I see is that the behavior of the LEDs is perfect when I operate within the debugger; what happens in normal runtime is a completely different story. The LEDs show some strange artifacts in their pattern that _should_ not be there. 

What I have considered:
1) I can perhaps imagine the debugger introducing lags and fixing some strange race condition that there might be in normal operation.
2) I have measured the system ticks every time the timer interrupt fires to see if there is a difference depending on whether the debugger is present or not, but I have not seen any there.

Have any of you experienced anything like this ?  Any suggestions on how to go about debugging this where I cannot trust the debugger ?