单片机/MCU论坛
直播中

孙悟空

7年用户 74经验值
私信 关注
[问答]

STM32移植LWIP问题

代码功能是创建客户端,静态ip,在407跑通了,但是直接复制移植到429的板子就运行报错,用的ucosii,请问可能是啥原因,lwip初始化成功,tcp客户端也初始化成功,之后就运行调试串口打印出这个
Assertion "arp_table[i].q == NULL" failed at line 369 in ..\LWIP\lwip-1.4.1\src\netif\etharp.c

那几行代码是
/* 1) empty entry available? /
if (empty < ARP_TABLE_SIZE) {
i = empty;
LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: selecting empty entry %"U16_F"\n", (u16_t)i));
} else {
/
2) found recyclable stable entry? /
if (old_stable < ARP_TABLE_SIZE) {
/
recycle oldest stable*/
i = old_stable;
LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: selecting oldest stable entry %"U16_F"\n", (u16_t)i));
/* no queued packets should exist on stable entries /
LWIP_ASSERT("arp_table[i].q == NULL", arp_table[i].q == NULL); //这里就是369行
/
3) found recyclable pending entry without queued packets? */
}

回帖(1)

张丽

2023-10-18 10:08:28
This assertion means that the q (queue) pointer in the ARP table entry is not NULL, which should not be the case when trying to find an empty entry in the ARP table. This could be caused by a memory allocation issue or a problem with the network interface driver.

One possibility is that the memory settings are different between the two boards, leading to a memory allocation error on the STM32F429 board. Another possibility is that the network interface driver code is not properly adapted to the new board and is causing the ARP table entry to be incorrectly initialized.

I suggest checking the memory settings, making sure they match between the two boards, and reviewing the code for the network interface driver to ensure it is correctly configured for the STM32F429 board. It may also be helpful to debug the code and narrow down the specific line of code causing the error.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分