virtual timer strangeness
Posted: Thu Oct 17, 2013 2:25 am
I am using the stm32f373 virtual timers.
The strange stuff
On the bench with short sensors wires the code works correctly.
All timers are set, and all set timers expire and trigger their coresponding call back.
On the vehicile with long inductive sensor wires the code does not work correctly.
All timers are set, but only the first timer expires and triggers its coresponding call back.
The other timers are set, but do not expire and trigger their coresponding call back.
The timers are set in an ICU callback.
To me this looks like a race condition, caused by the ICU callback triggering too often because of noise on the long inductive sensor wires. How should I add locking to prevent timer race conditions? Assuming that is the problem, could the problem be something else?
The strange stuff
On the bench with short sensors wires the code works correctly.
All timers are set, and all set timers expire and trigger their coresponding call back.
On the vehicile with long inductive sensor wires the code does not work correctly.
All timers are set, but only the first timer expires and triggers its coresponding call back.
The other timers are set, but do not expire and trigger their coresponding call back.
The timers are set in an ICU callback.
To me this looks like a race condition, caused by the ICU callback triggering too often because of noise on the long inductive sensor wires. How should I add locking to prevent timer race conditions? Assuming that is the problem, could the problem be something else?