Skip to main content
Visitor II
November 8, 2021
Question

Ethernet not performing hardware CRC on STM32F765

  • November 8, 2021
  • 4 replies
  • 1766 views

I'm bringing up an Ethernet project with the latest FreeRTOS+TCP and SPL ported from the F407.

I've got it sending packets but the responses to the ICMP when I ping the device come across in wireshark as having invalid CRCs of all zeros (see wireshark attached). Checking the Status word of the DMATxDesc before we set the own bit shows the CIC bits as 11 to have the hardware perform all the checksums.

Any recommendations as to what the problem may be and how to resolve?

0693W00000GWq4NQAT.png0693W00000GWq4DQAT.png

    This topic has been closed for replies.

    4 replies

    Graduate II
    November 8, 2021

    >>Ethernet not performing hardware CRC on STM32F765

    The Ethernet one (802.3), or the TCP/IP layer one

    Check the Errata

    LMore.5Author
    Visitor II
    November 9, 2021

    Thanks,

    The errata mentions an issue with IPv6 packet checksums, but we're not supporting IPv6 at this time and using IPv4.

    Checksum is the IP layer checksum. Header checksum is there (as shown in the attached image).

    My checksum setting is 0b11, so according to the reference manual RM0410 Rev 4 section 42.6.7 Tx DMA configuration:

    11: IP Header checksum and payload checksum calculation and insertion are enabled, and
    pseudo-header checksum is calculated in hardware.

    My understanding is this should calculate both sets of checksums and insert them in the packet before sending.

    Super User
    November 9, 2021

    This is third, transport level (here: ICMP header - okay, ICMP is that "intermediate" level, not transport; but from "header layering" perspective it's en par with TCP/UDP) checksum.

    RM says that it won't be calculated (while IP header checksum will be) if there's not enough space in FIFO; that would imply some heavy traffic.

    So, what were the conditions of the test, exactly? Do you stress-test the application? Do *all* ICMP messages fail in this way, or only some?

    JW

    LMore.5Author
    Visitor II
    November 9, 2021

    Really light traffic: Only my computer and the device connected via an ethernet cable. Still trying to get things up so haven't started stress testing yet. All of the ICMP Ping messages I try to send from my computer fail this way.

    I changed our stack to not use the HW checksum and calculate everything in software and I can communicate now. Ideally we'd use the hardware checksum.

    Super User
    November 10, 2021

    Read the checksum-offload narrative in RM and try to go through all the registers which may appear to be relevant. Try to change the payload size and alignment of the packet in memory. Check if size set to transfer packet through DMA matches size in header(s). Check if the ICMP checksum is set to 0 before calculation.

    JW

    Visitor II
    December 5, 2022

    @LMore.5​ 

    Have you found a solution?

    Super User
    December 6, 2022