Hello all,
I have a simple scenario of using queues in which ISR of serial port queues messages and the one and only task keeps checking to dequeue the message.
The App is just this single task
The problem is that if I check for the data in queue inside the task loop directly as follows :
static void task (void *pvParameters)
{
msg_t msg;
BaseType_t enu_ret;
while(1)
{
/*Check if Data Report Received*/
enu_ret = xQueueReceive(ghdl_data_queue, &msg, 0);
if(enu_ret == pdPASS)
{
printf("msg rcvd \n");
}
}
}
Things work as expected , and I get the messages when they r sent.
But if I put the checking section inside a function and call this function as follows :
static check_msg (void)
{
msg_t msg;
BaseType_t enu_ret;
/*Check if Data Report Received*/
enu_ret = xQueueReceive(ghdl_data_queue, &msg, 0);
if(enu_ret == pdPASS)
{
printf("msg rcvd \n");
}
}
static void task (void *pvParameters)
{
while(1)
{
check_msg ();
}
}
Hardfault exception occurs inside xQueueReceive !
The problem may seem to be stack limitation , but I have increased the stack size significantly and I still get the same exception !!!
Any Ideas ?
Thank u