I have some code with multiple tasks and queues and I'm creating some test data and the application is exhibiting some odd behaviour.
Basic principle, the main application posts a series of messages to a queue (UARTTaskQueue). A task, UARTTxTask, waits on the queue and retrieves the messages being posted. It then sends the bytes in the message over the UART.
Should be simple.
The odd behaviour I am seeing is the fact that odd numbered messages go into the queue and the UARTTxTask processes the messages as expected. The even numbered messages appear to go into the queue but they do not get processed, they seem to go into the queue and then disappear.
I have put some debug statements around the post message statement (xQueueSendToBack) and uxQueueMessagesWaiting shows an increase in the number of messages in the queue.
I can get the application to work as expected if I add a vTaskDelay call prior to posting the data.
Has anyone seen this before? Any pointers to what I need to do to get the expected behaviour?
Regards,
Mark
Missing items in queues
Re: Missing items in queues
Are you checking the return value of xQueueSendToBack?
It sounds to me that you're posting more messages than fit in the queue, i.e. not reading the queue quickly enough.
It sounds to me that you're posting more messages than fit in the queue, i.e. not reading the queue quickly enough.
-
- Posts: 34
- Joined: Thu Dec 24, 2015 12:04 pm
Re: Missing items in queues
I think you are right about the timing issue, I did some optimisation yesterday and it looks to be performing as expected. I'll see how it does under stress testing
Thanks for your time,
Mark
Thanks for your time,
Mark
Re: Missing items in queues
Check the return value and you'll know for sure if you're dropping items.
Who is online
Users browsing this forum: Baidu [Spider], brsmdnlr and 118 guests