2021-02-03 08:53 PM
Hi,
I have a counter incrementing as:
if (condition == TRUE)
count++
The counter is initialised as:
int count = 0;
I would expect that the counter would increment by '1' every time the condition is 'TRUE'. And this is in fact the case when I'm stepping through the code and have a breakpoint set within the 'if' statement. However, if I let the program run its course, I see in the "Live Expressions" window the count value increment by an arbitrary number. Super strange. This is a simple task, and so I'm at a loss as what could be causing it.
It looks like depending on whether I have a break statement at that line of code determines the value added to "count".
Is this a bug in STM32IDE?
Best,
Nat
Solved! Go to Solution.
2021-02-03 11:34 PM
Most probably all is working like a charm here.
"Live Expression" doesn't mean "Real time" ....
To get live expression working you've to understand on one side your hardware device is running then on the other some physical data transaction is required thru debug link between such device and your IDE. Debug link transaction is initiated based on some sampling frequency which is less than your cpu one ... A bit disturbing behavior maybe but I would say hopefully working this way if not expecting to get debug workload higher than functional one ...
2021-02-03 11:34 PM
Most probably all is working like a charm here.
"Live Expression" doesn't mean "Real time" ....
To get live expression working you've to understand on one side your hardware device is running then on the other some physical data transaction is required thru debug link between such device and your IDE. Debug link transaction is initiated based on some sampling frequency which is less than your cpu one ... A bit disturbing behavior maybe but I would say hopefully working this way if not expecting to get debug workload higher than functional one ...
2021-02-04 01:57 PM
Hi,
Thanks, makes sense.
In fact, in my case, this behaviour means that the condition I monitor triggers more frequently than I expected. Good to know.
Best,
Nat