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