Hello
I'm doing some experiments with RTX to investigate how quickly it switches between tasks and how much of the time I can make the processor (STM32F103 sleep.
Following the advice in this thread (http://www.keil.com/forum/18158/) I've implemented a function in my code with the signature:
void rt_post_taskswitch (U32 task_id)
As I understand it, RTX should call this after a task switch however this never happens (the break point I've set in the function is never hit). I had a quick poke around the RTX source and I can see where the function is weakly declared and where it's called. Everything looks fine except my implementation of the function never gets called.
I suspect this is because the project is linking against the RTX library and unless I recompile RTX along with my project it'll never know I've implemented the function.
What's the neatest way to go about making this work?
Many thanks in advance, Al
Many thanks for all the input.
I'm still having no luck making my rt_post_taskswitch work. This is probably my lack of knowledge with the linker.
I'm going to play around with different ways of doing this, probably just adding calls at entry and exit points of tasks.
Cheers, Al
"probably just adding calls at entry and exit points of tasks."
Note that depending on thread priorities, and if you have round-robin scheduling, you can get lots of task switches that will not result in any printout because the task that gets put to sleep was between two printouts, and the woken task was previously paused while between two printouts.
All you can manage is to print just before you call a wait-capable function, and directly after it returns. But that isn't enough.