Hi,
My call stack is below. And the code gets stuck in a "for" loop. For loop is also pasted below. It is from file:list.c Function: vListInsert.
Does anyone know when does this happen?
myApp [Code Composer Studio - Device Debugging]
Stellaris In-Circuit Debug Interface_0/Cortex_M4_0 (Suspended)
vListInsert(struct xLIST *, struct xLIST_ITEM *)() at list.c:159 0x200101B8
vTaskPlaceOnEventList(struct xLIST *, unsigned int)() at tasks.c:2,189 0x2000908E
xQueueGenericReceive(void *, void *, unsigned int, long)() at queue.c:1,330 0x2000AD48
vSimpleLinkSpawnTask(void *)() at osi_freertos.c:502 0x2000CB2C
prvTaskExitError() at port.c:234 0x200104B4 (next frame is identical to an existing frame)
Code snippet where the code gets stuck (in the for loop):
/* Insert the new list item into the list, sorted in xItemValue order.
If the list already contains a list item with the same item value then
the new list item should be placed after it. This ensures that TCB's which
are stored in ready lists (all of which have the same xItemValue value)
get an equal share of the CPU. However, if the xItemValue is the same as
the back marker the iteration loop below will not end. This means we need
to guard against this by checking the value first and modifying the
algorithm slightly if necessary. */
if( xValueOfInsertion == portMAX_DELAY )
{
pxIterator = pxList->xListEnd.pxPrevious;
}
else
{
/* *** NOTE ***********************************************************
If you find your application is crashing here then likely causes are:
1) Stack overflow -
see http://www.freertos.org/Stacks-and-stack-overflow-checking.html
2) Incorrect interrupt priority assignment, especially on Cortex-M3
parts where numerically high priority values denote low actual
interrupt priories, which can seem counter intuitive. See
configMAX_SYSCALL_INTERRUPT_PRIORITY on http://www.freertos.org/a00110.html
3) Calling an API function from within a critical section or when
the scheduler is suspended, or calling an API function that does
not end in "FromISR" from an interrupt.
4) Using a queue or semaphore before it has been initialised or
before the scheduler has been started (are interrupts firing
before vTaskStartScheduler() has been called?).
See http://www.freertos.org/FAQHelp.html for more tips, and ensure
configASSERT() is defined! http://www.freertos.org/a00110.html#configASSERT
**********************************************************************/
for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) /*lint !e826 !e740 The mini list structure is used as the list end to save RAM. This is checked and valid. */
{
/* There is nothing to do here, we are just iterating to the
wanted insertion position. */
}
}