Missing items in queues
Posted: Thu Nov 29, 2018 8:57 am
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
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