This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

NDK: Sendto() looses UDP packets

Hi...

I have problems with sending UDP packets from my c6678 EVM to a Host PC! I send out 20-40 UDP packets in a for loop and sendto() returns no error. But when I look at my wireshark session on the PC, I observe that many packets do not appear... I verify that with a sequence number. All UDP packets have the same size, 1028Bytes payload.

When I insert a for (i=0; i< 50000; i++); loop after each packet, everything works fine, and no packet gets lost! This fix is enough for the moment, but is not a solution for the future, because my throughput gets very bad, and I have to fulfill some realtime conditions. Anyone who can help me with this??

My NDK and MCSDK Versions:

ndk_2_21_01_38

mcsdk_2_01_01_04

P.S.: I DON'T want to hear, that I should better use TCP/IP instead of UDP! I know the benefits of TCP/IP over UDP, but our host software is programmed to receive UDP packets! THX!

  • Philipp,

    The first thing which you should be checking is whether C6678 sent all packets out or not. That can be checked by checking the ethernet statistics registers inside C6678. Check the statistics at Ethernet switch sub-system inside C6678 at Port 1/2 (whichever the port you are using). You can verify whether the number of TXGOODFRAMES at Port 1/2 matches with the packets sent or not. If it matches then packets are being sent from C6678 and they are getting dropped at the input side of the PC. Before reading the statistics at Port1/2, you need to enable statistics at those ports. Port 1/2 transmit statistics can be enabled by setting the P1/2_STAT_EN bit in the STAT_PORT_EN register inside Ethernet sub-system. User can use the 2045.cpsw_stats_print.gelabove attached GEL file to read/dump the statistics at Port 1/2.

    If packets are getting dropped at the Ethernet Switch sub-system Port1/2 then we need to check the statistics for packets at Port0 to see if Port0 is dropping any packets or not. Port 0 receive statistics can be enabled by setting the P0A_STAT_EN bit in the STAT_PORT_EN register inside Ethernet sub-system. User can use the same attached GEL file to read/dump the statistics at Port 0.

    Regards,

    Bhavin