toddatm wrote on Friday, April 27, 2012:
I’ve taken the IAR tools port for the Cortex M3 (specifically the STM32F103ZE) and ported it to gcc 4.6.2 (yagarto). I’m just having a look at several of the examples in the “Using FreeRtos…” document and trying to make sure things are working.
One of the thing that puzzles me is I create 2 tasks both with priority 1. All they do is check which task they are and increment 1 of 2 counters. In my debugger I stop the core and clear both counters then let it run awhile and stop it again. 1 counter is twice the other counter. Shouldn’t they be fairly close to the same? I’m just surprised that 1 task appears to be getting twice as much time as the other. My tick time is set to 0.001 (that was the default with the demo).
Another thing that puzzles me is I set a break point on both increment counters statements and it always hits one but not the other. If I set it on one or the other it does hit both, but if I set it on both, it always hits the first one (task 1) and never on task 2. Task 2, in fact, starves.
It looks basically like
if (taskNum == 1)
counter1++;
else
counter2++;
I am new to this Rtos and forum. I just want to verify things are working and how before I move into design/coding of my application.
Thanks.