lwip

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

lwip

1,013 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by slavka012 on Tue Sep 17 10:19:04 MST 2013
I'm running lwip1.4.1 on lpc1788 and I'm having multiple issues. As I fix one, another appears....

Attached is a wireshark trace of the access to a single file. It is sort of working, but I have questions.

1. Why all of my packets have "Frame check sequence incorrect"? The incoming frames appear not to have that field. LWIP explicitly tells that it does not deal with ethernet CRC, which should be calculated in HW. However, it seems that EMAC on LPC1788 can only do that for short frames, under 60 bytes. Then it should be done in driver? Then how come there is no one else having this issue?

2. Why do I get so many duplicates and retransmissions? When I access an html file that has about 10 images in it, the number of duplicates grows exponentionally and seem to swamp the server.

3. This log is received when server is connected to a router (pc is wireless). When I connect server directly to a PC I don't see that many dups and retransmissions.

Any help would be greatly appreciated. If you need additional details I will provide.

Thanks,

Original Attachment has been moved to: lpc1788.zip

Labels (1)
0 Kudos
2 Replies

795 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by slavka012 on Wed Sep 18 21:00:47 MST 2013
Somebody please give me some advice!

It does not happen if I connect device directly to a PC with a network cable. Everything is fine. But if I go through router, the device tries to send two SYN-ACK in response to the very first SYN from a client.

What is this, some kind of bug in my EMAC driver?

Here is a debug printout from a console:
lpc_low_level_input: Packet received: 0xa0096afc, size 66 (index=1)
lpc_rxqueue_pbuf: pbuf packet queued: 0xa00952ac (free desc=0)
TCP connection request 3048 -> 80.
tcp_enqueue_flags: queueing 6510:6511 (0x12)
tcp_output()
tcp_output_segment: rtseq 6510
tcp_output_segment: 6510:6510
lpc_low_level_output: pbuf packet(0xa0083f30) sent, chain#=0, size = 42 (index=1)
lpc_tx_reclaim_st: Freeing packet 0xa0083f20 (index 1)
lpc_low_level_input: Packet received: 0xa00964e8, size 66 (index=2)
lpc_rxqueue_pbuf: pbuf packet queued: 0xa0096afc (free desc=0)
tcp_output()
tcp_output_segment: rtseq 6510
tcp_output_segment: 6510:6510


So, looking at this log, what do I see? SYN arrives, we respond with SYN-ACK, but when the client sends its ACK, we transmit a packet already transmitted before. Where is the problem?

Seeing that I don't get any responses here, is there a more appropriate forum to ask this question?
0 Kudos

795 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by slavka012 on Tue Sep 17 18:51:38 MST 2013
I was able to get rid of FCS error messages by change MAC2 register initialization from

LPC_EMAC->MAC2 = EMAC_MAC2_CRC_EN | EMAC_MAC2_PAD_EN |EMAC_MAC2_VLAN_PAD_EN;

to

LPC_EMAC->MAC2 = EMAC_MAC2_CRC_EN | EMAC_MAC2_PAD_EN;

But I still have a lot of duplicates.
0 Kudos