anonymous wrote on Monday, January 10, 2011:
Hi,
I’m working on a project that uses Cortex-M3 microcontroller and FreeRTOS. Recently, I found a bug that causes a crash here:
/* *** 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.
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.
**********************************************************************/
for( pxIterator = ( xListItem * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext )
I called taskENTER_CRITICAL and taskEXIT_CRITICAL from interrupt handler (irq on highest priority). Is this a general rule, that critical section could not be used from interrupt handlers, or this is true only in Cortex-M3 architecture?
It wasn’t my intention to use critical sections in interrupts, ofcourse, but I wonder why masking interrupts in IRQ handlers could cause a crash.
Best regards,
dynamiccontrast