Hello kind people.
My W5500 works in MACRAW mode . My program needs to send EtherCAT packet every 4ms in hard realtime environment. I am doing the following steps in the 4ms timer:
- read S0_TX_WR;
- write Socket 0 Transimit Data;
- update S0_TX_WR;
- write S0_CR_SEND to S0_CR which starts the transmitting;
- wait until S0_CR is 0;
- wait until S0_IR S0_IR_SENDOK is set;
- clear S0_IR_SENDOK ;
- wait until S0_TX_RD is equal to the value written to S0_TX_WR in step 3.
I capture the network flow using Wireshark running on a high performance desktop PC. The results shows that some times W5500 does NOT starts to transmit packet fast enough when S0_CR_SEND is written. In the worst case the packet is sent after 18ms on the wire together with its following packets. My Servo Driver device also alarms PDO timeouts. So i am pretty sure that the packet is delayed on the wire.
But the datasheet says: SEND command transmits the saved data from the current Sn_TX_RD to the Sn_TX_WR in the Socket n TX Buffer. After transmitting the saved data, the SEND command increases theSn_TX_RD as same as the Sn_TX_WR.
How could this happen? Multiple packets sent in one cycle. Wireshare capture is filtered with frame.time_delta > 0.005 to show the bad packets.