I have created rx and tx tasks with priority as 1,2.
My rx task will post item back to Queue using xQueueSendToBack and tx task will receive an item from Queue.
Before posting item to Queue my rx task will perform compression(LZ4) on my data then post item to Queue but after compression of item my rx task always stuck at xQueueSendToBack() func
Can any body faced the same issue. Please help me to find the root cause.
My first thought is what exactly are you posting on the queue. Queues deal with fixed length items, so ‘compression’, which tends to give a variable length, doesn’t really seem applicable.
My guess (since we see no code) is that the sending task is adding more data than the receiving task tasks, so the queue fills and blocks.
Well, then it seems that the invocation of your compression routine corrupts something maybe due to a stack overflow.
The Q itself doesn’t care about 5 compressed or uncompressed bytes so the invocation routine is the only difference.
Did you enable the debug check macros like configCHECK_FOR_STACK_OVERFLOW ?
Would agree with the above. If sending to the queue works, but performing some unrelated compression then sending to the same queue in the same way doesn’t, it would see that it was the compression operation that was causing the issue - and that was unrelated to the queue send operation if that has not changed. Take a look through the following to see if it helps - it mentions things like stack overflow detection as per hs2’s post: https://www.freertos.org/FAQHelp.html
Because you need to define the routine in your code, that is why it begins with Application. Generally I try to print some error message and then halt the program.
As pointed in above replies, the symptoms seems that of a memory corruption. Would you be able to break the code in debugger and see where it is stuck? Also, have you defined configASSERT?
Another quick check to ensure that it is not stack overflow is to increase the size of stack and see if the problem persists.