[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Need support on TCP/IP packet transmission

From: praveenkumar raavi
Subject: Re: [lwip-users] Need support on TCP/IP packet transmission
Date: Thu, 20 Feb 2020 19:53:55 +0530


Any update on my query...


On Thu, 13 Feb 2020, 09:54 praveenkumar raavi, <address@hidden> wrote:

Hi Everyone,


we are using LWIP 2.0.3 for one of our project to establish the TCP connection from ECU and Atmel micro.
We got the LWIP from Atmel itself and I have modified little to support VLAN data receive and transmit.


But now we are seeing some issue during data transmission.
When the ECU goes to sleep, it cut down the Ethernet link and when it wakes up it will establish the Ethernet connection.
But here when the ECU wakes up the communication is not going well from our LWIP stack. We are seeing multiple re transmissions which are causing issues in data transmission.

So we planned to reinitialize the LWIP stack after ECU goes to sleep.
But when I do shut down the connection, the connection is not closing as there is no FIN request response from ECU and its getting stuck in tcp_slow timer.
Also I have seen new behavior like when i received new frame on TCP, I am trying to ACK back using ACK now function(pcb->prio = TCP_PRIO_MAX; tcp_send_empty_ack(pcb);  tcp_output(pcb);), but I am seeing the ACK packet transmitted after my data packet is been transferred.
This I didn't understand like why the ACK packet is transferred after data packet? this is also one of the reason for us to see communication failure.

I am attaching the images for our communication issues.
     ECU IP :
If you see LWIP_TCP_DataSentoutFirst.JPG, the data is send first and ACK is sent after that even though the ACK transmission is initiated first with priority level set to MAX.

Please let us know how to solve this issue.


I am adding following steps during lwip init.

TCPIP_STACK_INTERFACE_0_init(st_ETH_ConfigStruct.u8_SourceMacAddress, Src_IP, gw);         




etharp_add_static_entry(&Dest_IP, (struct eth_addr *)&st_ETH_ConfigStruct.u8_DestMacAddress[0]);

pcb_tcp = tcp_new();

error = tcp_bind(pcb_tcp, &address, st_ETH_ConfigStruct.u16_SourcePortNum);

pcb_tcp = tcp_listen(pcb_tcp);

tcp_accept(pcb_tcp, Etherdo_connected);


After link established, below functions are used to do data transfer.





This is how I initialized LWIP stack and transmitting data over ethernet. Here I have used static MAC address as we should connect to particular MAC address.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]