Viewing all objects in the Timer List queue?

Is there a way to get the information of all the timers in the Timer queue? I’m thinking of something along the lines of uxTaskGetSystemState where you can get the state of all the Tasks in the system. I’ve been poking around in the Timers.c/.h files but I don’t see anything that would give me similar functionality. If I’m correct in reading the code (and I might not be), it also seems like if a Timer is stopped it gets removed from the list so no record is kept of it anywhere in the OS? If I don’t keep track of my timers and I stop one it seems like I’ll lose all visibility of it?

I recently found and fixed a memory leak revolving around how I was using timers in one specific instance and it occurred to me that is a section of our system that I have no visibility into. I have debug commands that I can enter over our communication interface to view ISR timings, Task runtime and stack usage and well as heap usage and availability, but I have nothing for the Timer Service. I’m trying to rectify that deficiency but I’m not having luck so far. Any help would be greatly appreciated.


I think you are right - there is no programmatic way of querying timers that are in the list. The StateViewer plug-ins for IAR and Eclipse may give a graphical view though.

Timers are created by the application and referenced by a handle. You can’t start, stop, reset, etc. them if you don’t have the handle - the kernel itself doesn’t maintain a list of every created timer. We could introduce a timer registry, similar to the queue registry, where you can manually add a timer to the registry, and give it a name, after creating it.

Well that’s a bummer but thanks for the speedy response!

I didn’t even know there was a queue registry :slight_smile: Some people might find it useful, but we were already keeping tracking of our the timers anyways so it wouldn’t provide any benefit for us. I mostly just confirming that I was reading the code correctly.