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.

TM4C1292NCPDT: TCP/UDP/ICMP Checksum offload engine stops working randomly

Part Number: TM4C1292NCPDT

Hi.

I am using TM4C1292 with LWIP.

Usually everything works fine but I have noticed that sometimes randomly web page hosted on the microcontroller strops working.

I checked the TCP packets in wireshark and noticed that TCP SYN-ACK messages sent by microcontroller has TCP header checksum field with value 0x0000. 

When everything works then there is not 0x0000 but some kind of value.

I checked that Tx descriptors 23:22 bits have value 0x3 which means that software leaves 0x0000 for checksum and checksum offload engine replaces it with correct checksum, but this does not happen.

It seems like offload engine randomly stops working.

Can someone please help me?

Thanks in advance,

Karlis

  • Hi Karlis,
    I'm not sure why the offload engine is putting out 0 as the checksum. It may be early to conclude that the checksum is the cause of the problem. It may be possible that the checksum is only the symptom of another problem that we don't know yet. Can you check a few things?

    1. If bit 16 of the TDES0 (Enhanced Transmit Descriptor0) is set? This bit indicates if a checksum error detected. If this bit is set then it may be due to any one of the following as stated in the datasheet?
    ■ For IPv4 datagrams:
    – The received Ethernet type is 0x0800, but the IP header's Version field is not equal to 0x4.
    – The IPv4 Header Length field indicates a value less than 0x5 (20 bytes).
    – The total frame length is less than the value given in the IPv4 Header Length field.
    ■ For IPv6 datagrams:
    – The Ethernet type is 0x86dd but the IP header Version field is not equal to 0x6.
    – The frame ends before the IPv6 header (40 bytes) or extension header (as given in the
    corresponding Header Length field in an extension header) is completely received.

    2. Check bit 15 of TDES0 and see if any errors set other than checksum error.
    3. Can you replicate the problem in the launchPad. I think you are using a custom board, correct?
    4. Will you have a way to manually calculate the checksum of the header. As explained in this Wireshark article, a value of 0x0000 on the checksum is valid. osqa-ask.wireshark.org/.../can-tcp-checksum-be-zero0

    5. Can you change to different Ethernet CAT5E cable and see if the problem still persists?

  • Hi Charles. Thank you for thorough answer. I will test this and report back with results.

    I just don't know how long it will take me to test this because, these failures happen really randomly and very seldom.

    Karlis

  • Hi Karlis,
    I didn't hear back from you. Is the issue resolved? I will close this thread for now. If the issue is not resolved you can reopen this thread or open a new thread if you have new questions.
  • Hi Charles. I am doing other stuff at the moment and meanwhile checking if this issue happens again(board running web page all the time with random restarts from me). In these few days I have not caught this error of no checksum.

    Anyway, I think for now we can close the thread. If I get this failure again I will use your tips. Thank you.

  • Hey, I just got the error again and checked the bits you told me to. both of them are 0.

    I was wondering if I am checking them at right place.

    I am using tiva-tm4c129.c library and I check these bits in tivaif_transmit function, but it seems like checksum offload engine would put the error bit there after this function.

     I will try to get the descriptor status in tivaif_process_transmit function now as this is the function which deals with descriptors after they have been used to send the data.

    I couldn't do that earlier because C compiler's optimization is set to High and no breakpoints could be put in this function(IDK how could anything work then if this function is not used). 

    Now I set the optimization to Low and I will wait for the error again. Now I can put breakpoint in this function and check the status there.

  • Hi. I just checked the Transmit descriptor flags after the transmission too and there no indications of checksum errors or any errors at all.
    I might implement software checksum generation for test, but I really would not like to replace checksum offload engine with software.
  • Hi Karlis,
    It is difficult to debug the problem when the problem happens only randomly after a few days. Try to change to software checksum and see if you will still encounter problems again. At least by doing so if you still experience problem with the webserver then we know that may not be related to the checksum equal to zero.