AM2432: No communication EtherCAT with AM2432 and custom PHY dp83822

Part Number: AM2432
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hi team,

I'm developed AM2432 custom board using  ind_comms_sdk_am243x_09_02_00_15,

I used ether phy dp83822, but no link with EtherCAT master established.

I made driver CUST_PHY_dp83822.c using CUST_PHY_dp83826b.c as a reference.

And I success to read and write PHY register.

I confirmed that  auto negotiation process not completed and link no established, by BMSR.

Next, I checked MDIO register value, I found it no value in MDIO_ALIVE_REG (0x300B2408).

(My phy address are 0 and 1)

Please some advice to link up EtherCAT.

Best regard,

Oyama

  • Hi,

    Have you enabled Enhanced Link in your application? If yes, can you try disabling it and try scanning.

    Regards,
    Aaron

  • Also share the PHY register dumps from (0 to 0x1F) for both ports.

  • HI, Aaron and Pratheesh,

    Have you enabled Enhanced Link in your application? If yes, can you try disabling it and try scanning.

    I made the following changes, is this correct? The link is still not established.

    Fullscreen
    1
    2
    3
    4
    #define ECAT_PHYPOLINVERT_IN (false)
    #define ECAT_PHYPOLINVERT_OUT (false)
    #define ECAT_PHYUSERXLINK_IN (false)
    #define ECAT_PHYUSERXLINK_OUT (false)
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    share the PHY register dumps from (0 to 0x1F) for both ports.

    After above change I read bellow.

    phy0(connect to master) phy1(no connect)

    BMCR

    (0x00)  3100 (0x00)  3100
    BMSR (0x01)  7849 (0x01)  7849
    PHYIDR1 (0x02)  2000 (0x02)  2000
    PHYIDR2 (0x03)  a240 (0x03)  a240
    ANAR (0x04)  01e1 (0x04)  01e1
    ANLPAR (0x05)  0000 (0x05)  0000
    ANER (0x06)  0004 (0x06)  0004
    ANNPTR (0x07)  2001 (0x07)  2001
    ANLNPTR (0x08)  0000 (0x08)  0000
    CR1 (0x09)  0000 (0x09)  0000
    CR2 (0x0a)  0122 (0x0a)  0122
    CR3 (0x0b)  1000 (0x0b)  1000
    (0x0c)  0000 (0x0c)  0000
    REGCR (0x0d)  0000 (0x0d)  0000
    ADDAR (0x0e)  0000 (0x0e)  0000
    FLDS (0x0f)  0000 (0x0f)  0000
    PHYSTS (0x10)  4082 (0x10)  4082
    PHYSCR (0x11)  010a (0x11)  010a
    MISR1 (0x12)  40fc (0x12)  00fc
    MISR2 (0x13)  08ff (0x13)  08ff
    FCSCR (0x14)  0000 (0x14)  0000
    RECR (0x15)  0000 (0x15)  0000
    BISCR (0x16)  0100 (0x16)  0100
    RCSR (0x17)  0043 (0x17)  0043
    LEDCR (0x18)  0400 (0x18)  0400
    PHYCR (0x19)  8020 (0x19)  8021
    10BTSCR (0x1a)  0000 (0x1a)  0000
    BICSR1 (0x1b)  007d (0x1b)  007d
    BICSR2 (0x1c)  05ee (0x1c)  05ee
    (0x1d)  0000 (0x1d)  0000
    CDCR (0x1e)  0102 (0x1e)  0102
    PHYRCR (0x1f)  0000 (0x1f)  0000

    Best regard,

    Oyama

  • From the PHY register values, looks like link is down and no signal detected. Additionally, from the MDIO_CONTROL_REG, it shows the MDIO state machine is in IDLE state and disabled.

    To check on this further, can you provide the values in PRU_MDIO_MDIO Registers (0x300B2400 to 0x300B2484) ?

    Also, have you connected the ports to an active network while capturing the above values, or are the ports disconnected ?

    Regards,
    Aaron

  • Hi Aarom,

    The phy0 was connected to active master device while capturing.

    The phy1 was disconnected.  

    Upon further investigation, I found that phy0 was transitioning every few seconds between two states as shown in the table below.

    However, the master device can't scan device, and CPU register value remains the same shown in below screen shot.

     

    state0 state1
    BMCR (0x00)  3100 (0x00)  3100
    BMSR (0x01)  7849 (0x01)  786d
    PHYIDR1 (0x02)  2000 (0x02)  2000
    PHYIDR2 (0x03)  a240 (0x03)  a240
    ANAR (0x04)  01e1 (0x04)  01e1
    ANLPAR (0x05)  0000 (0x05)  0081
    ANER (0x06)  0014 (0x06)  0004
    ANNPTR (0x07)  2001 (0x07)  2001
    ANLNPTR (0x08)  0000 (0x08)  0000
    CR1 (0x09)  0000 (0x09)  0000
    CR2 (0x0a)  0122 (0x0a)  0122
    CR3 (0x0b)  1000 (0x0b)  1000
    (0x0c)  0000 (0x0c)  0000
    REGCR (0x0d)  0000 (0x0d)  0000
    ADDAR (0x0e)  0000 (0x0e)  0000
    FLDS (0x0f)  0000 (0x0f)  0000
    PHYSTS (0x10)  5892 (0x10)  0095
    PHYSCR (0x11)  010a (0x11)  010a
    MISR1 (0x12)  40fc (0x12)  64fc
    MISR2 (0x13)  0aff (0x13)  08ff
    FCSCR (0x14)  0000 (0x14)  0000
    RECR (0x15)  0000 (0x15)  0000
    BISCR (0x16)  0100 (0x16)  0100
    RCSR (0x17)  0043 (0x17)  0043
    LEDCR (0x18)  0400 (0x18)  0400
    PHYCR (0x19)  8020 (0x19)  8c20
    10BTSCR (0x1a)  0010 (0x1a)  0000
    BICSR1 (0x1b)  007d (0x1b)  007d
    BICSR2 (0x1c)  05ee (0x1c)  05ee
    (0x1d)  0000 (0x1d)  0000
    CDCR (0x1e)  009e (0x1e)  0102
    PHYRCR (0x1f)  0000 (0x1f)  0000

    Best regard,

    Oyama

  • Hi,

    From the PHY registers you shared, I see that Auto-negotiation is enabled, Extended Full-Duplex is enabled, Odd Nibble Detection is enabled. This follows the EtherCAT requirements.

    I'll review in detail the PHY and MDIO registers and see for any possible issues/misconfigurations.

    Upon further investigation, I found that phy0 was transitioning every few seconds between two states as shown in the table below.

    A couple of things to check on:

    • Are you invoking PHY_softwareRestart API in your application? If yes, you can try bypassing the reset?
  • Hi Aarom,

    If yes, you can try bypassing the reset?

    Sorry I don't really understand it, is this all I need to change like below? 

    Fullscreen
    1
    2
    3
    4
    5
    void CUST_PHY_DP83822_softwareRestart(void* pAppCtxt_p, void* pStackCtxt_p)
    {
    OSALUNREF_PARM(pAppCtxt_p);
    OSALUNREF_PARM(pStackCtxt_p);
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    or disable this CB function? 

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    void EC_SLV_APP_SS_registerStacklessBoardFunctions(EC_SLV_APP_SS_Application_t *pAppInstance_p)
    {
    if (!pAppInstance_p)
    {
    goto Exit;
    }
    ESL_BOARD_OS_registerPhys(pAppInstance_p->ptEcSlvApi, pAppInstance_p->selectedPruInstance);
    CUST_PHY_CBregisterLibDetect(CUST_PHY_detect, pAppInstance_p);
    //CUST_PHY_CBregisterReset(EC_SLV_APP_SS_boardPhyReset, pAppInstance_p);
    Exit:
    return;
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    On my board, there is no software reset gpio pin, only hardware reset pin now.

    It is need to software restart phy after Auto negotiation setting?

    Best regard,

    Oyama

  • Hi,

    I'll discuss this with the expert internally and get back to you.

    Regards,
    Aaron

  • Hi Tomoya,

    additionally to setting ECAT_PHYUSERXLINK_IN and ECAT_PHYUSERXLINK_OUT to false, please comment out the content of the function body of CUST_PHY_DP83822_enableFastLinkDownDet().

    Best regards

    Andreas

  • Hi Andreas,

    comment out the content of the function body of CUST_PHY_DP83822_enableFastLinkDownDet()

    I tried it but it didn't work.

    Best regard,

    Oyama

  • Sorry, overlooked this yesterday. Please re-include the CUST_PHY_CBregisterReset() function and remove the softwareRestart function by setting pPhyLibDesc_p->softwareRestart = NULL (in CUST_PHY_dp83822.c) to bypass the reset.

    Best regards

    Andreas

  • Hi Andreas,

    Thanks, I confirmed that the link is always up. (BMSR = 786d)

    But, it is unable to scan this device from master device.

    I checked register below, MII link is no established.

    And I also checked waveforms MII0_RXD0, and MII0_TXD0, after scan from master.

    I confirmed MII0_RXD0 waveform, but I didn't see MII0_TXD0 waveform.

    Best regard,

    Oyama

  • From the MDIO memory dump, looks like MDIO_ALIVE_REG is still not set which implies the PHY is not connected successfully (even though BMSR shows valid link established).

    Make sure the following are handled:

    • PHY is configured in MII mode for the AM243x. You should select the corresponding mode in SysConfig and make sure the proper pins are muxed for the PHY.
    • In SysConfig, ensure the Ethernet interface pins are correctly configured for the DP83822 PHY. You must ensure that the TX/RX lines, MDC/MDIO lines, and CLK pins are correctly assigned.
    • Enable Extended Full-Duplex, enable Odd Nibble Detection - (These looks to be taken care as bit2 and bit5 in CR2 is set)
  • Hi Andreas,

    On my board, LED_0 pin of dp83822 is not connected to MII0_RXLINK pin of AM2432,

    is it necessary to MII link and, is it related to MDIO_ALIVE_REG value?

       

    Best regard,

    Oyama

  • MII0_RXLINK is required for Cable Redundancy support. 

    PHY link loss reaction time (link loss to link signal / LED output change) has to be faster than 15 us to Enable redundancy operation and Enhanced Link using RXLINK takes care of this timing constraint (Refer to Testing Cable Redundancy for the test scenario).

    If Enhanced Link is disabled, the MDIO state machine-based detection is implemented, which is slow due to a serial link for messaging from the MDIO controller to the PHYs, which typically takes from 200 to 250 µs. MLINK/mii_rxlink detection occurs as fast as the PHY can toggle the link and typically within 10 µs.

    Absence of this pin shouldn't be a blocker for EtherCAT functionality. Even without RXLINK, EtherCAT communication should work as expected.

    Also regarding the MDIO configuration, are you enabling MDIO Manual Mode from the sysconfig? If yes, can you disable that and see if you see MDIO registers getting loaded ?

    Also, are you using ICSSG0 or ICSSG1 instance ? 

     Regards,
    Aaron

  • Hi Andreas,

    I'm using ICSSG1.

    I understand about  RXLINK. but after disable MDIO Manual Mode, EtherCAT application is stacked.

    Is it need additional configuration?

    Best regard,

    Oyama

  • Hi,

    I understand about  RXLINK. but after disable MDIO Manual Mode, EtherCAT application is stacked.

    • When MDIO Manual Mode is disabled, make sure the alive register bits are set (0x300B2408). When MDIO Manual Mode is enabled, the alive register are emulated at offset 0x30080000 + 0x10E40 + 0x08 which is to be monitored for alive register and link register.
    • Additionally, make sure bit6 is set and bit7 is cleared for 0x300B2484 and 0x300B248C Registers and bit0-4 has the correct PHY addresses.
      •    

    Regards,
    Aaron

  • Hi Aaron,

    I modified ESL_BOARD_config.h, 

    Fullscreen
    1
    2
    3
    4
    5
    6
    #define ECAT_PHYADDR_IN (0u)
    #define ECAT_PHYADDR_OUT (1u)
    #define ECAT_PHYPOLINVERT_IN (true)
    #define ECAT_PHYPOLINVERT_OUT (true)
    #define ECAT_PHYUSERXLINK_IN (false)
    #define ECAT_PHYUSERXLINK_OUT (false)
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    pPhyLibDesc_p->softwareRestart to NULL, disabled  MDIO Manual Mode, and RXLINK pin.

    This confirmed that BMSR = 786d, MDIO_REGS_ALIVE_REG = 3, 0x300B2484 = 0x40 and 0x300B248C=0x41.

    But after scanning, no packets were sent from there.

    In my opinion, PRU is not able to catch MII rx signal. (I confirmed MII rx waveform.)

    Is there anything else I should check?

    Best regard,

    Oyama

  • Additionally, MDIO_LINK_REG register (0x300B240C) was transitioning every few seconds between 0 and 1.