xTaskResumeAll - Endless loop

nobody wrote on Monday, December 19, 2005:

I’m using LPC2148 and freeRTOSV3.2.4.

It works fine for a whole bunch of tasks. But if I start now anothoer one I get into this while loop in xTaskResumeAll after a while:

/* If any ticks occurred while the scheduler was suspended then they should be processed now.  This ensures the tick count does not slip, and that any delayed tasks are resumed at the correct time. */
if( uxMissedTicks > ( unsigned portBASE_TYPE ) 0 )
{
  while( uxMissedTicks > ( unsigned portBASE_TYPE ) 0 )
{
vTaskIncrementTick();
–uxMissedTicks;
}

It doesn’t return from this loop anymore, so RTOS is blocked. I’m just starting a simple task more like:

for(;:wink:
{
vTaskDelay(20);
}

If i don’t start this task, my application works fine. I don’t have an idea what I have done wrong.

Can you help me?

Thanks, Stefan

nobody wrote on Monday, December 19, 2005:

Most likely memory corruption.  Check the stacks of your tasks have not overflowed.  Also, try stepping through the creation of the offending task to check it can obtain the memory it requires.

jwestmoreland wrote on Tuesday, December 20, 2005:

I agree.

You said you allocated a whole bunch of tasks.
Each task takes stack space - you can deplete
available memory with too many tasks.

How many tasks have you created?
What is the amount of stack space allocated for
each task?
How much memory can your application address?

These types of problems are usually simple to figure out - so that’s the good news I suppose.
The bad news is that you many not be able to allocate all of the tasks you require with the memory available.

Good Luck,
John W.

nobody wrote on Tuesday, December 20, 2005:

Thanks a lot. I’ll check out the memory allocation and I’m sure I’ll get this thing working. Thanks for helping me, kind regards Stefan