tabulous2011 wrote on Tuesday, September 17, 2013:
Updated OS from 7.1.1 where everything was working fine, now i’m getting hardfault in xQueueGenericReceive. I’ve traced this down to uart rx interrupt, where the driver calls xQueueSendFromISR to put teh recieved data into queue.
The uart interrupt is configured as:-
NVIC_InitStructure.NVIC_IRQChannel = USART2_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY + 3;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init( &NVIC_InitStructure );
The freertos cfg is as follows:-
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5
/* The lowest priority. /
#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
/ Priority 5, or 95 as only the top four bits are implemented. */
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
The receiving task for the data in the queue is this, this task is running @ priority tskIDLE_PRIORITY + 3
while( 1 )
{
if( xQueueRx != NULL )
{
/* block until something arrives in the queue */
xStatus = xQueueReceive( xQueueRx, &cChar, portMAX_DELAY );
if( xStatus == pdTRUE )
{
switch( pd->service )
{
case DAT_MODE:
data_mode_handler( pd, cChar );
break;
case CMD_MODE:
command_mode_handler( pd, cChar );
break;
}
}
}
else
{
TSL_DEBUGF( ATH_DEBUG | DBG_TRACE | 1, ( "AtHandler:Queue Error! \r\n" ));
}
}
The task stack is currently largely over what is needed, set to 512 at the moment with 476 free
Why should updating to 7.5.2 break my system ? any suggestions welcome
Why should upgrading break this ? what as changed in freertos that would do this ?