AnsweredAssumed Answered

Occasionally_lwmsgq_receive Never Returns

Question asked by Leif Zars on Feb 17, 2015
Latest reply on Jul 13, 2015 by justanotheruser

I am testing my application and all is well for the first hour or so. But it seems that something fowls up the scheduler so that on of my tasks never executes again.


I am stuck and would really appreciate some help.


The line that never returns is: if (_lwmsgq_receive(SL_Q_PTR, (void*) &msg, LWMSGQ_RECEIVE_BLOCK_ON_EMPTY, 100, 0) == MQX_OK) {

It functions fine for a few hundred if not thousand calls.

I found some odd details in the MQX debugging tools. All of my other tasks that should be blocking on as similar _lwmsgq_receive call show a State of 'LW MSg RX Blocked, timeout' the offending task shows a State of 'Time delay blocked'. I also show 16 messages in the offending tasks blocking lwm queue, so it should be executing.

Another oddity is that the kernel time is 59902 seconds, functioning tasks have a 'Task Status'  'Timeout' of around 59595, while the problem task has a timeout of 31341, not sure if that knowledge is worth anything.

All elements of the MQX appear to be valid, I ran the MQX 'Check for Errors utility', no problems found.


I have the Kernel data structure but am not sure how to inspect it for the error. How do you think I should proceed debugging this?