Queue puts on pending completion

I have got freertos project based on queues. And one of the following queues put execution on waiting ending. And cause of that I cant get data even from UART queue

osThreadId_t networkInitHandle;
const osThreadAttr_t networkInit_attributes = {
  .name = "networkInit",
  .stack_size = 384 * 4,
  .priority = (osPriority_t)  osPriorityHigh,
};

/* Definitions for TCPProc */
osThreadId_t TCPProcHandle;
const osThreadAttr_t TCPProc_attributes = {
  .name = "TCPProc",
  .stack_size =384 * 10,//8,//4,
  .priority = (osPriority_t) osPriorityNormal,
};

void startTCPProc(void *argument);
void mstartTcpCon(void *argument);
 quTCPHandle = osMessageQueueNew (16, sizeof(MessageNode), &quTCP_attributes);;
 mtcpConHandle = osThreadNew(mstartTcpCon, NULL, &mtcpCon_attributes);
TCPProcHandle = osThreadNew(startTCPProc, NULL, &TCPProc_attributes);

void mstartTcpCon(void *argument)
{
	ip_addr_t server_ip;
	ip_addr_t client_ip;



	    err_t err;


	    IP4_ADDR(&server_ip, 169, 254, 44, 141);
	    IP4_ADDR(&client_ip, 169, 254, 44, 138);
	    conn = netconn_new(NETCONN_TCP);

	    if (conn != NULL)
	    {

	    	
	    	err = netconn_bind(conn, &client_ip, 6401);
	    	if (err == ERR_OK)
	    	{
	    		
	    		err = netconn_connect(conn, &server_ip, 6401);
				if(err == ERR_OK)
				{

					cont = 2;
					tcpstatus = 0x01;
					vTaskResume(TCPProcHandle);
					

				}
	        }

	    }
		
	   vTaskDelete(NULL);
	 

}

void startTCPProc(void *argument)
{
	u16_t len;

	 struct netbuf *buffer;
  	uint8_t *data;

  for(;;)
  {

	  if (cont == 2)
		{

			
		  	  	  	buffer = netbuf_new();
					while ((netconn_err(conn) == ERR_OK) && (netconn_recv(conn, &buffer) == ERR_OK))
					
					{


							do
							{

								if(netbuf_data(buffer, (void *)&data, &len)== ERR_OK)
								{
										
									switch(tcpstatus){
									case 0x01:

										if(server_find_unnecessary_info((const char*)data, len)==servAuthOk)
										{
											tcpstatus = 0x02;
											vTaskResume(TCPTxHandle);
											
										}
									break;

									case 0x05:

										if(server_auth_recv(ppm_id_get(),(const char* ) data)==servAuthOk)
										{
											tcpstatus = 0x06;
											
											vTaskResume(TCPTxHandle);
										}
										
									break;
									case 0x07:
										
										if(len)
										{

											server_send_msg(quTCPHandle,ppm_id_get(),(const char* )data,len);
											tcpstatus = 0x08;
											txb_size = len;
										}

									break;
									default:
									break;
									}

								}
							}
							while (netbuf_next(buffer) >= 0);
							netbuf_delete(buffer);


					}

	
		}


	 
	  osDelay(20);


  }

}

Insted of UART receiving executes
static portTASK_FUNCTION( prvIdleTask, pvParameters )
prvCheckTasksWaitingTermination()

Please help who knows in what problem is

The posted code seems incomplete since there is nothing related to UART.
However, prvCheckTasksWaitingTermination() is part of the Idle task and indicates, that … all tasks are blocked and waiting for something.
The problem is likely somewhere in the application resp. the inter-task signaling.
You mentioned queues but there are also no queue related calls in the posted code…

Thanks for your replay!, under “queue calls” you meant xqueuesendtoback?, or xqueuereceive calls?

Like @hs2, I also miss the UART related code?

A few more general remarks after looking at your code:

You are using vTaskResume() to wake up a task. But you never call vTaskSuspend() to suspend it? It looks like the TCP task will run immediately after start-up.

Have you looked at the task-notify functions? I think it is more elegant to notify a task when you want it to do something.
Are you sure that netconn_recv() will block? What is the default for SO_RCVTIMEO?

I think that you better put the code of mstartTcpCon() and startTCPProc() into a single function, running at osPriorityNormal. Call it runTCPProc().

I wonder what task is referred to by the handle TCPTxHandle? I assume that task sends TCP data? Can’t you integrate that code as well?

This statement:

    quTCPHandle = osMessageQueueNew (16, sizeof(MessageNode), &quTCP_attributes);

Does that happen within a function, or is it like a declaration/initialisation?

Regards,