LWIP调试中BUG"tcpip_thread: invalid message" failed at line 146 in …\LWIP\lwip-1.4.1\src\api\tcpip.c
问题的根本原因是sys_arch_mbox_fetch函数的问题,请看已经测试过的代码。
这里OS_TIMEOUT必须等于-1,不然,如题的问题继续出现,你品,你细品!
u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout)
{
u8_t ucErr;
u32_t ucos_timeout;
sys_mbox_t m_box=*mbox;
if(msg!= NULL)
{
*msg =OSQPend(m_box->pQ,(u16_t)ucos_timeout,&ucErr);
}
else
{
OSQPend(m_box->pQ,(u16_t)ucos_timeout,&ucErr);
}
if(ucErr == (u8_t)OS_TIMEOUT)
{
timeout=SYS_ARCH_TIMEOUT;
}
else
{
if(*msg==(void*)&pvNullPointer)*msg = NULL;
timeout =(ucos_timeout-ucErr)*(1000/OS_TICKS_PER_SEC);
}
return timeout;
}