FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [April 2011 Threads] Queue receive used from a TaskPosted by Ananda Kumar B on April 18, 2011 Hi,
Currently I'm working on a project that uses Cortex-M3 microcontroller and FreeRTOS.
Recently, I found a bug that causes a crash here:
list.c file: ----------- for( pxIterator = ( xListItem * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) {
}
When it is crashed at this point, the call stack shows likes this:
vListInsert vTaskPlaceOnEventList prvUnlockQueue TskHandler
In the task handler, xqueuereceive function is used to get the message which is posted based on the interrupt.
Can anyone tell, why this is crashed after calling xqueuereceive()?
Regards, Ananda
RE: Queue receive used from a TaskPosted by Richard on April 18, 2011 From experience of answering this question, I would say it is almost certain that you have your interrupt priorities and configuration set incorrectly.
See the documentation page for the port you are using, the descriptions of configKERNEL_INTERRUPT_PRIORITY and configMAX_SYSCALL_INTERRUPT_PRIORITY in the customisation section of the web site and in the Cortex-M3 edition of the FreeRTOS tutorial book, and item three here: http://www.freertos.org/FAQHelp.html
Regards.
RE: Queue receive used from a TaskPosted by Ananda Kumar B on April 18, 2011 Thanks for your quick reply..
For your information.. our application has the kernel & Max_Syscall priority as follows: #define configKERNEL_INTERRUPT_PRIORITY 255 #define configMAX_SYSCALL_INTERRUPT_PRIORITY 191
And i am using two interrupt service routine, which has the interrupt priority level set to 192 & 193 respectively for ISR1 & ISR2. These two ISRs will call "FromISR" API.
But with the above priority settings, still i see the crash is happening at the infinite for loop for( pxIterator = ( xListItem * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) {
}
Can you please tell me whether the above ISRs interrupt priority is proper or not.?
RE: Queue receive used from a TaskPosted by Richard on April 18, 2011 Which microcontroller are you using (I know it's a Cortex-M3, but which).
Do you have the priority grouping set such that all the priority bits are set as being pre-emption priority, and not sub-priority?
Regards.
RE: Queue receive used from a TaskPosted by Ananda Kumar B on April 19, 2011 I am using STM32 microcontroller(Medium density VL) for our project and For the 1st ISR, NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 192; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
for the 2nd ISR, NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 193; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
This is how the pre-emption priority & sub priority were initialized in our project.
Regards, Ananda
RE: Queue receive used from a TaskPosted by woops_ on April 19, 2011 Do you call NVIC_PriorityGroupConfig( NVIC_PriorityGroup_4 ) in your set up routine. That sets how many bits are used for each before you set actual interrupts like in your code. As well, there are only 4 upper bits so 192 and 193 will end with the same priority.
RE: Queue receive used from a TaskPosted by Ivan on April 25, 2011 Hi,
Just to chime in ... I've gotten stuck here before when using FreeRTOS v6.1.0 on an RX62N. The reason for being stuck in the infinite loop here was there one of my tasks was not allocated enough stack space.
You might want to check the memory map of your Task just in case.
Cheers, Ivan
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|