holyhope wrote on Friday, April 17, 2015:
Goodmorning to all.
I’m developing with FreeRTOS 8.0.2 for uP FreeScale K20
I’m using KDS 2.0.0 for developing firmware and Processor Expert to install FreeRtos. I suppose that is an official version (8.0.2) of FreeRTOS and not modified. I have not directly downloaded form this site but it was generated from ProcesorExpert
I’m using “Cross ARM GCC” compiler, I not see the version
I read the guide for arm-cortex-M4 about priority and I have this problem… But I can’t resolve it, or understand perfectly the problem.
I have several task, the problem origin when I use 2 task; the first is used for manage external device (and speach to ModBus task for low level communication) and the second is used for manage the internal ADC of uP.
I have 2 interrupt for the 2 ADC-Conv inside the uP. After some conversion, inside TIMER interrupt (not ADC interupt but timer interrupt) I do a xQueuePutFromISR that that awake ADC tast (that is waiting in xQueueReceive )
The task for manage external device communicate via ModBus task via some semaphoreGive and some queue.
If I enable All two task, after a deterministic number of iteration, I see my code stuck in void vListInsert( List_t * const pxList, ListItem_t * const pxNewListItem ) where there is an explanation that say:
1) Stack overflow -
see http://www.freertos.org/Stacks-and-stack-overflow-checking.html
2) Incorrect interrupt priority assignment, especially on Cortex-M
parts where numerically high priority values denote low actual
interrupt priorities, which can seem counter intuitive. See
http://www.freertos.org/RTOS-Cortex-M3-M4.html and the definition
of 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?).
I try to do:
-check StackOverflow: I have enabled stackoverflowhook via FreeRtos but seems do not enter here my code…
- Priority: I modify some interrupt priority and task priority. Modifing them I see change in duration time of my code before it stuck but never resolved my problem
Due my code execute very well many times before it stuck I exclude the 3 and 4 case…
i suppose that there is something wrong with priority: and I read the literature about it but i can’t resolve my problem (maybe I do not understand very well…)
What I can do?
Many thanks,
Massimiliano