# Cant receive from the queue

**URL:** <https://forums.freertos.org/t/cant-receive-from-the-queue/4554>\
**Category:** Kernel\
**Created:** [January 17, 2012, 9:58am UTC](https://forums.freertos.org/t/cant-receive-from-the-queue/4554 "2012-01-17T09:58:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 17, 2012, 9:58am UTC](https://forums.freertos.org/t/cant-receive-from-the-queue/4554/1 "2012-01-17T09:58:11Z")

</div>

**[tjohansen](https://sourceforge.net/u/tjohansen/)** wrote on [Tuesday, January 17, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/c698439e/#f9fb):

Hi

I have a strange problem. I have created an queue.

I post on the queue every 1 sec with task 1 using:  
xQueueSend(g\_xRXEvent, (void\*)&nAll, ( portTickType ) 10);  
The function do succeed every time.

In task 2 I try to receive the queue message using the xQueueReceive  
while(TRUE)  
{  
if(pdTRUE == xQueueReceive (g\_xRXEvent, &nRXBufferIndex, portMAX\_DELAY))  
{  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; …. Do stuff

The xQueueReceive never returns?  
When the scheduler is started, the xQueueReceive do return in task 2 the first time, but that is before anything is send to the queue by task 1.?

The two task have the same priority  
I’m running 7.1.0 on a LPC2478

Thomas

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 17, 2012, 10:01am UTC](https://forums.freertos.org/t/cant-receive-from-the-queue/4554/2 "2012-01-17T10:01:15Z")

</div>

**[tjohansen](https://sourceforge.net/u/tjohansen/)** wrote on [Tuesday, January 17, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/c698439e/#79cc):

I may add, that other queue seems to work. I have a UART isr using xQueueSendFromISR that is working.

Thomas
