Hi
I'm using the lwIP sample program to test my hardware.
I'm using LPC1788 at 120 MHZ and the DP83848 PHY
I use the EA1788 TCP Echo sample as a stand alone.
When I set it to 10 mbit (the PHY_USE_100MBS in the lpc_emac_config.h to zero) the sample program works fine.
But when I set it to 100 mbit (the PHY_USE_100MBS to 1) it will assert after few seconds.
It is something with the pBuf reference count.
"pbuf_free: p->ref > 0:628 in file ..\..\..\..\..\..\..\lwip_lpc\lwip-1.4.0\src\core\pbuf.c"
Same place every time.
Is it hardware issues?
Speed issues that the lwIP cant handle the pbufs fast enough?
From debug:
sys_timeout: 2000613c msecs=1000 handler=ip_reass_timer arg=00000000
sys_timeout: 20006128 msecs=5000 handler=arp_timer arg=00000000
sys_timeout: 20006114 msecs=60000 handler=dhcp_timer_coarse arg=00000000
sys_timeout: 20006100 msecs=500 handler=dhcp_timer_fine arg=00000000
Starting LWIP TCP echo server...
netif: IP address of interface set to 0.0.0.0
netif: netmask of interface set to 0.0.0.0
netif: GW address of interface set to 0.0.0.0
pbuf_alloc(length=153: en0
IP header:
+-------------------------------+
| 4 | 5 | 0x00 | 336 | (v, hl, tos, len)
+-------------------------------+
| 0 |000| 0 | (id, flags, offset)
+-------------------------------+
| 255 | 17 | 0xba9d | (ttl, proto, chksum)
+-------------------------------+
| 0 | 0 | 0 | 0 | (src)
+-------------------------------+
| 255 | 255 | 255 | 255 | (dest)
+-------------------------------+
netif->output()pbuf_free(20003244)
pbuf_free: deallocating 20003244
sct calling h=dhcp_timer_fine arg=00000000
tcpip: dhcp_fine_tmr()
sys_timeout: 20006100 msecs=500 handler=dhcp_timer_fine arg=00000000
sct calling h=ip_reass_timer arg=00000000
tcpip: ip_reass_tmr()
sys_timeout: 2000613c msecs=1000 handler=ip_reass_timer arg=00000000
sct calling h=dhcp_timer_fine arg=00000000
tcpip: dhcp_fine_tmr()
sys_timeout: 20006100 msecs=500 handler=dhcp_timer_fine arg=00000000
sct calling h=dhcp_timer_fine arg=00000000
tcpip: dhcp_fine_tmr()
sys_timeout: 20006100 msecs=500 handler=dhcp_timer_fine arg=00000000
sct calling h=ip_reass_timer arg=00000000
tcpip: ip_reass_tmr()
sys_timeout: 2000613c msecs=1000 handler=ip_reass_timer arg=00000000
sct calling h=dhcp_timer_fine arg=00000000
tcpip: dhcp_fine_tmr()
pbuf_alloc(length=308)
pbuf_alloc(length=308) == 20003244
pbuf_header: old 2000328c new 20003284 (8)
inet_chksum_pseudo(): checksumming pbuf 20003244 (has next 00000000)
inet_chksum_pseudo(): pbuf chain lwip_chksum()=20fb
pbuf_header: old 20003284 new 20003270 (20)
ip_output_if: en0
IP header:
+-------------------------------+
| 4 | 5 | 0x00 | 336 | (v, hl, tos, len)
+-------------------------------+
| 1 |000| 0 | (id, flags, offset)
+-------------------------------+
| 255 | 17 | 0xba9c | (ttl, proto, chksum)
+-------------------------------+
| 0 | 0 | 0 | 0 | (src)
+-------------------------------+
| 255 | 255 | 255 | 255 | (dest)
+-------------------------------+
netif->output()pbuf_free(20003244)
pbuf_free: deallocating 20003244
sys_timeout: 20006100 msecs=500 handler=dhcp_timer_fine arg=00000000
pbuf_alloc(length=308)
pbuf_alloc(length=308) == 20003244
pbuf_header: old 2000328c new 20003284 (8)
inet_chksum_pseudo(): checksumming pbuf 00015e (-14)
ip_input: iphdr->dest 0xffffffff netif->ip_addr 0x0 (0x0, 0x0, 0xffffffff)
ip_input: UDP packet to DHCP client port 68
ip_input: DHCP packet accepted.
ip_input:
IP header:
+-------------------------in lwip_chksum()=7601
pbuf_header: old 200002f0 new 200002dc (20)
ip_output_if: en0
IP header:
+-------------------------------+
| 4 | 5 | 0x00 | 336 | (v, hl, tos, len)
+-------------------------------+
| f_free: deallocating 20000758
pbuf_header: old 20000d80 new 20000d8e (-14)
ip_input: iphdr->dest 0xffffffff netif->ip_addr 0x0 (0x0, 0x0, 0xffffffff)
ip_input: UDP packet to DHCP client port 68
ip_input: netif->ip_addr 0x0 (0x0, 0x0, 0xffffffff)
ip_input: UDP packet to DHCP client port 68
ip_input: DHCP packet accepted.
ip_input:
IP header:
+-------------------------------+
| 4 | 5 | 0x00 | 328 | (v, hl, tos, len)
+-------------------------------+
| 17564 |000| 0 | (id, flags, offset)
+-------------------------------+
| 128 | 17 | 0xd7dd | (ttl, proto, chksum)
+-------------------------------+
| 10 | 35 | 19 | 9 | (src)
+-------------------------------+
| 255 | 255 | 255 | 255 | (dest)
+-------------------------------+
ip_input: p->len 328 p->tot_len 328
pbuf_header: old 200013a6 new 200sct calling h=dhcp_timer_fine arg=00000000
tcpip: dhcp_fine_tmr()
pbuf_alloc(length=42)
pbuf_alloc(length=42) == 20000140
pbuf_free(20000140)
pbuf_free: 20000140 has ref 1, ending here.
sys_timeout: 20006100 msecs=500 handler=dhcp_timer_fine arg=00000000
pbuf_free(20000140)
pbuf_free: deallocating 20000140
pbuf_free(20001fb8)
pbuf_free: deallocating 20001fb8
pbuf_header: old 200025e0 new 200025ee (-14)
ip_input: iphdr->dest 0xffffffff netif->ip_addr 0x0 (0x0, 0x0, 0xffffffff)
ip_input: UDP packet to DHCP client port 67
ip_input: packet not for us.
pbuf_free(200025d0)
pb)=ffff
pbuf_header: old 20002c1a new 20002c22 (-8)
pbuf_free(20002be8)
pbuf_free: deallocating 20002be8
pbuf_header: old 20000150 new 2000015e (-14)
IP (len 352) is longer than pbuf (len 28), IP packet dropped.
pbuf_free(20000140)
pbuf_free: p->ref > 0:628 in file ..\..\..\..\..\..\..\lwip_lpc\lwip-1.4.0\src\core\pbuf.c
