Stm32H7使用HAL的Freertos CMSIS v2 LWIP 2.1.2 http长时间不间断定时刷新页面(一小时左右),系统死机。卡死后,停止在等待消息的位置。
BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue, TickType_t xTicksToWait )
{
BaseType_t xEntryTimeSet = pdFALSE;
TimeOut_t xTimeOut;
Queue_t * const pxQueue = xQueue;
#if( configUSE_MUTEXES == 1 )
BaseType_t xInheritanceOccurred = pdFALSE;
#endif
/* Check the queue pointer is not NULL. */
configASSERT( ( pxQueue ) );
/* Check this really is a semaphore, in which case the item size will be
0. */
configASSERT( pxQueue->uxItemSize == 0 );//停在这一行
/* Cannot block if the scheduler is suspended. */
#if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
{
configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
}
#endif
尝试了网上多种方式,也无法解决。现象依旧。
打印log,发现多次停在这个位置。
……
[16:08:51.483]收←◆tcp_slowtmr: no active pcbs
[16:08:51.984]收←◆tcp_slowtmr: no active pcbs
[16:08:52.490]收←◆tcp_slowtmr: no active pcbs
[16:08:52.984]收←◆tcp_slow
[16:08:53.031]收←◆tmr: no active pcbs
tcp_alloc: killing off oldest TIME-WAIT connection
tcp_kill_timewait: killing oldest TIME-WAIT PCB 0x24013c24 (20)
if (pcb != NULL) {
tcp_recved: received 379 bytes, wnd 2920 (0).
tcp_close: closing in pcb->state: 4
对应的函数是tcp.c中的
static err_t
tcp_close_shutdown_fin(struct tcp_pcb *pcb)
{
err_t err;
LWIP_ASSERT("pcb != NULL", pcb != NULL);
LWIP_DEBUGF(TCP_DEBUG, ("pcb->state: %d \n",pcb->state));
switch (pcb->state) {
case SYN_RCVD:
err = tcp_send_fin(pcb);
if (err == ERR_OK) {
tcp_backlog_accepted(pcb);
MIB2_STATS_INC(mib2.tcpattemptfails);
pcb->state = FIN_WAIT_1;
}
break;
case ESTABLISHED:
err = tcp_send_fin(pcb);
if (err == ERR_OK) {
MIB2_STATS_INC(mib2.tcpestabresets);
pcb->state = FIN_WAIT_1;
}
break;
case CLOSE_WAIT:
err = tcp_send_fin(pcb);
if (err == ERR_OK) {
MIB2_STATS_INC(mib2.tcpestabresets);
pcb->state = LAST_ACK;
}
break;
default:
/* Has already been closed, do nothing. */
return ERR_OK;
}
if (err == ERR_OK) {
/* To ensure all data has been sent when tcp_close returns, we have
to make sure tcp_output doesn't fail.
Since we don't really have to ensure all data has been sent when tcp_close
returns (unsent data is sent from tcp timer functions, also), we don't care
for the return value of tcp_output for now. */
tcp_output(pcb);
} else if (err == ERR_MEM) {
/* Mark this pcb for closing. Closing is retried from tcp_tmr. */
tcp_set_flags(pcb, TF_CLOSEPEND);
/* We have to return ERR_OK from here to indicate to the callers that this
pcb should not be used any more as it will be freed soon via tcp_tmr.
This is OK here since sending FIN does not guarantee a time frime for
actually freeing the pcb, either (it is left in closure states for
remote ACK or timeout) */
return ERR_OK;
}
return err;
}
求教,有没有哪位高人,也遇到同样的问题啊?搞了两个礼拜了,没有任何的进展,再搞不定,要提桶跑路了。