guruxin 2021-05-21 16:58 采纳率: 0%
浏览 456

Stm32H7使用HAL的Freertos LWIP http长时间不间断定时刷新页面卡死

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;
}

 

求教,有没有哪位高人,也遇到同样的问题啊?搞了两个礼拜了,没有任何的进展,再搞不定,要提桶跑路了。

 

 

  • 写回答

1条回答 默认 最新

  • 壶中墨水 2021-08-20 00:22
    关注

    我也遇到了你的问题,我把任务的栈空间调大之后就好了.后续有新的进展,再看看.

    评论

报告相同问题?

悬赏问题

  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器