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.

DP83867IR: AM64x EVM RX CRC, rxAlignCodeErrors RGMII

Part Number: DP83867IR
Other Parts Discussed in Thread: DP83869

Hello Experts,

I am working on AM64x EVM with mcu_plus_sdk_am64x_08_00_00_21 FreeRTOS.

EVM is sending/receiving Multicast packets to/from Linux PC and realizes that TX and RX CRC error occurs.

It is confirmed by CPSW3G MAC statistics:

rxGoodFrames :83
rxMcastFrames :83
rxCrcErrors :1
rxAlignCodeErrors :23
txGoodFrames :740
txMcastFrames :735
portMaskDrop :24
aleUnknownMcast :9
aleUnknownMcastBcnt :802

 

At the PC side, by checking $ethtool -S the CRC error I can see TX CRC error occur (~50% CRC error)..

I tried to set txDelayInPs = 1250U,  instead of 1500U like in the gEnetCpbBoard_dp83867PhyCfg and TX CRC problem solved.

However, I tried all value of rxDelayInPs from 0.25 to 4.00 nsec, but RX CRC and rxAlignCodeErrors are still there.

I paste the dp83867IR PHY registesr here for your reference:

PHY 0: BMCR = 0x1140
PHY 0: BMSR = 0x796d
PHY 0: PHYIDR1 = 0x2000
PHY 0: PHYIDR2 = 0xa231
PHY 0: ANAR = 0x01e1
PHY 0: ANLPAR = 0xcde1
PHY 0: ANER = 0x006d
PHY 0: ANNPTR = 0x2001
PHY 0: ANNPRR = 0x4006
PHY 0: CFG1 = 0x0200
PHY 0: STS1 = 0x3800
PHY 0: 1KSCR = 0x3000
PHY 0: PHYCR = 0x5048
PHY 0: PHYSTS = 0xac02
PHY 0: MICR = 0x0000
PHY 0: ISR = 0x0000
PHY 0: CFG2 = 0x29c7
PHY 0: RECR = 0x0019
PHY 0: BISCR = 0x0000
PHY 0: STS2 = 0x0040
PHY 0: LEDCR1 = 0x5160
PHY 0: LEDCR2 = 0x4444
PHY 0: LEDCR3 = 0x0002
PHY 0: CFG3 = 0x0202
PHY 0: CTRL = 0x0000
PHY 0: RGMIICTL = 0x00d3
PHY 0: FLDTHRCFG = 0x0221
PHY 0: VTMCFG = 0x2050
PHY 0: STRAPSTS2 = 0x0100
PHY 0: RGMIIDCTL = 0x0057 //txDelayInPs=1500, rxDelayInPs=2000
PHY 0: LOOPCR = 0xe721
PHY 0: DSPFFECFG = 0x0e81
PHY 0: IOMUXCFG = 0x0c1f
PHY 0: GPIOMUXCTRL = 0x0006

Could you please support me?

Best regards,

Nam

  • Hi Nam,

    To confirm this is a PHY issue, is it possible to try connecting a DP83867EVM to the PC and see if the PHY EVM can communicate with the PC?

    Can we try some loopback tests to check to see on which interface the errors occur?

    • Use PC to generate packets, set PHY for reverse loopback, packets will be sent back to PC, check for errors to determine if Copper interface is faulty.
    • Use MAC to generate packets, set PHY for digital loopback, packets will be sent back to MAC, check for errors to determine if MAC interface is faulty.

    Thank you,

    Nikhil

    All information in this correspondence and in any related correspondence is provided “as is” and “with all faults”, and it is subject to TI’s Important Notice (http://www.ti.com/corp/docs/legal/important-notice.shtml).

  • Hi Nam,

    To confirm this is a PHY issue, is it possible to try connecting a DP83867EVM to the PC and see if the PHY EVM can communicate with the PC?

    Can we try some loopback tests to check to see on which interface the errors occur?

    • Use PC to generate packets, set PHY for reverse loopback, packets will be sent back to PC, check for errors to determine if Copper interface is faulty.
    • Use MAC to generate packets, set PHY for digital loopback, packets will be sent back to MAC, check for errors to determine if MAC interface is faulty.

    Thank you,

    Nikhil

    All information in this correspondence and in any related correspondence is provided “as is” and “with all faults”, and it is subject to TI’s Important Notice (http://www.ti.com/corp/docs/legal/important-notice.shtml).

  • Hi Nikhil,

    I appreciate your quick response!

    Use MAC to generate packets, set PHY for digital loopback, packets will be sent back to MAC, check for errors to determine if MAC interface is faulty.

    I did this TX loopback test before and here was result:

    Table 1: Did not modify tx/rxDelayInPs and enabled Near-End Loopback

    txDelayInPs rxDelayInPs Result
    PCS Loopback 1500U 2000U MAC: rxAlignCodeErrors and rxCrcErrors
    Digital Loopback 1500U 2000U MAC: rxAlignCodeErrors and rxCrcErrors

    Table 2: Modified txDelayInPs and enabled Near-End Loopback

    txDelayInPs rxDelayInPs Result
    PCS Loopback 1250U 2000U MAC: No error
    Digital Loopback 1250U 2000U MAC: rxAlignCodeError and rxCrcErrors

    I think the problem could be at Signal Process block that is at Figure 10. Block Diagram, Near-End Loopback Mode in: https://www.ti.com/lit/an/snla246a/snla246a.pdf?ts=1632270840270

    Moreover, I used the Linux SD card image and did the same test and did not see such issue. So I think HW or cable is not a problem.

    Please advise me what I can check next.

    Use PC to generate packets, set PHY for reverse loopback, packets will be sent back to PC, check for errors to determine if Copper interface is faulty.

    Do you still need this result?

    Best regards,

    Nam

  • I'm pretty sure this is an issue with the MCU+ SDK.

    We came across this recently, too, although on the ICSSG ethernet ports which use the DP83869. The MCU+ SDK driver for the DP83867 (which is used for the DP83869 as well in SDK 08.00) writes DP83869_VTMCFG and DP83869_DSPFFECFG - two registers that are undocumented for the DP83869 and only got added to the DP83867 datasheets in the latest revision.

    The MCU+ SDK writes DP83869_DSPFFECFG to 0x281 (#define DSPFFECFG_FFEEQ_SHORTCABLE). The meaning of this register is basically still undocumented, the DP83867 datasheet Rev. F only says "Certain applications may need this register to be configured to 0x0E81 to improve Short Cable performance. Changing this register to 0x0E81, will not effect Long Cable performance.". (makes you wonder what the draw-back of writing 0xe81 is, but that's another issue...)

    We removed both writes, to VTMCFG and DSPFFECFG from the driver in the MCU+ SDK, and that solved the CRC errors for us.

    Please note that I'm not TI, so you might want to wait for an official answer.

    Regards,

    Dominic

  • Hi Dominic,

    Thank you very much for your information. 

    I also just found out the cause of this by comparing with the register when running EVM on Linux.

    I think there is a bug, the idleCntThresh is always set to 0.

    Adding gEnetCpbBoard_dp83867PhyCfg.idleCntThresh        = 5U will fix the issue.

    Best regards,

    Nam

  • Hi Dominic and Nam,

    Thanks for your collaboration and I'm glad that we have come to a working solution for both of your cases. For this case with the idleCntThresh error, was a TI driver used?

    Thank you,

    Nikhil

    All information in this correspondence and in any related correspondence is provided “as is” and “with all faults”, and it is subject to TI’s Important Notice (http://www.ti.com/corp/docs/legal/important-notice.shtml).

  • Hi Nikhil,

    Yes, I think it is a bug in TI driver. Please look at my patch below.
    Also setting txDelayInPs = 1250U is expected? In the FreeRTOS driver code, it is 1500U but in Linux driver is 2000U. 

    Do you know why Linux has different delay?

    diff --git a/source/networking/enet/utils/enet_board_am64x_am243x_evm.c b/source/networking/enet/utils/enet_board_am64x_am243x_evm.c
    index f30ff1f..e33e09a 100644
    --- a/source/networking/enet/utils/enet_board_am64x_am243x_evm.c
    +++ b/source/networking/enet/utils/enet_board_am64x_am243x_evm.c
    @@ -86,10 +86,11 @@ static const Dp83867_Cfg gEnetCpbBoard_dp83867PhyCfg =
     {
         .txClkShiftEn         = true,
         .rxClkShiftEn         = true,
    -    .txDelayInPs          = 1500U,  /* 2.00 ns */
    +    .txDelayInPs          = 1250U,  /* N.B. 1.25ns AM64x EVM work fine, otherwise TX CRC error */
         .rxDelayInPs          = 2000U,  /* 2.00 ns */
         .txFifoDepth          = 4U,
         .impedanceInMilliOhms = 35000,  /* 35 ohms */
    +    .idleCntThresh        = 5U, /* N.B. Missing set this cause RX CRC error */
         .gpio0Mode            = DP83867_GPIO0_LED3,
         .gpio1Mode            = DP83867_GPIO1_COL, /* Unused */
         .ledMode              =
    

    Best regards,

    Nam

  • Hi Nam,

    We are looking into this issue and will have additional feedback by Monday latest.

    Thank you,

    Nikhil

    All information in this correspondence and in any related correspondence is provided “as is” and “with all faults”, and it is subject to TI’s Important Notice (http://www.ti.com/corp/docs/legal/important-notice.shtml).

  • Hi Nam,

    Apologies for the delay. Could you kindly confirm where you received this driver? Was it from the AM64x software page? Do you have the link?

    Thank you,

    Nikhil

    All information in this correspondence and in any related correspondence is provided “as is” and “with all faults”, and it is subject to TI’s Important Notice (http://www.ti.com/corp/docs/legal/important-notice.shtml).

  • Hi Nikhil,

    I downloaded from this link: https://www.ti.com/tool/PROCESSOR-SDK-AM64X

    MCU-PLUS-SDK-AM64X  MCU+ SDK RTOS/NO-RTOS for AM64x

    Best regards,

    Nam

  • Hi Nikhil,

    Do you have official fixes on this issue?

    Best regards,

    Nam

  • Hi Nam,

    Yes, these fixes would be part of MCU+ SDK 8.1 release (Oct end 2021). Appreciate sharing the suggestions on fixes with us. This is very helpful.

    Regards,

    Prasad

  • Btw, Domininc,

    We removed both writes, to VTMCFG and DSPFFECFG from the driver in the MCU+ SDK, and that solved the CRC errors for us.

    Understand this register is not documented in DP83869 DM but I have confirmed it's presence with PHY team.

    Now, removing these two writes helped you because in current driver we are writing value 0 which is incorrect. So by removing the writes you actually kept the default value of 0x5 intact (writing which helped Nam).

    Anyway, I will work with PHY team to get PHY data sheet updated to include missing register details.

    Regards,

    Prasad

  • Hello Prasad,

    yeah, it would be great if you could get this sorted out.

    We already figured that the DP83869 had the same registers, thanks for your confirmation.

    We understand the issue about VTMCFG, where the MCU+ code merely missed to properly initialize a value that is later written to the register, and it turned out that writing this register with the default of 5 / not writing it made our CRC errors go away.

    I'm more puzzled about the DSPFFECFG register, and why the MCU+ code unconditionally writes it with the "short cable" value. The datasheets says that writing this value will "not effect Long Cable performance", but I'm having trouble accepting that there's a non-default setting that has no drawbacks at all, and just improves one condition.

    Regards,

    Dominic

  • Hi Dominic,

    Sorry but I don't have answer here. We had received these settings from PHY team to fix CRC errors when short cable (<1m) is connected.

    They would would add details about this in their next DM revision.

    Regards,

    Prasad

  • Okay, little bit scrambling through mails, I get below information why DSPFFECFG is required -

    Tweak for PHY DSP timing loop to lock. With short cable line conditions are really good and algorithm requires ISI (Inter symbol interference) to lock. This setting helps to inject this scenario.

    With short cables < 5m connected between DP83867 PHYs - we were seeing 1-3 errors per 1 million packets. This change fully eliminates all errors seen upto now.