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.

AM2432: EtherCAT with AM2432 & DP83822

Part Number: AM2432
Other Parts Discussed in Thread: DP83869, SYSCONFIG,

Tool/software:

Hi all, 

I'm currently using AM4232 ALX MCU with DP83822 PHY for EtherCAT Communication.
SDK used - ind_comms_sdk_am243x_09_02_00_08 -> ethercat_slave_demo

Test Setup,

Added CUST_PHY_DP83822.c 

CUST_PHY_DP83822.zip

In Code, I've integrated CUST_PHY_DP83822.c with CUST_PHY_Dp83869.c 
Phy got detected and configured based on IEEE IDENT


Log: (While taking the log Port 2 is connected with PC TwinCAT)

Local Implementation
Pruicss max =3 selected PRU:3
Did Map 0x30080000 len 0x2000 to 0x30080000 (dram0)
Did Map 0x30082000 len 0x2000 to 0x30082000 (dram1)
Did Map 0x300b4000 len 0x4000 to 0x300b4000 (iram0)
Did Map 0x300b8000 len 0x4000 to 0x300b8000 (iram1)
Did Map 0x30090000 len 0x10000 to 0x30090000 (shdram)
Did Map 0x300a2000 len 0x400 to 0x300a2000 (control0)
Did Map 0x300a4000 len 0x400 to 0x300a4000 (control1)
Did Map 0x300a0000 len 0x2000 to 0x300a0000 (intc)
Did Map 0x300a6000 len 0x2000 to 0x300a6000 (cfg)
Did Map 0x300a8000 len 0x2000 to 0x300a8000 (uart0)
Did Map 0x300ae000 len 0x2000 to 0x300ae000 (iep)
Did Map 0x300b0000 len 0x2000 to 0x300b0000 (ecap0)
Did Map 0x300b2000 len 0x400 to 0x300b2000 (mii_rt)
Did Map 0x300b2000 len 0x1c00 to 0x300b2000 (mdio)
Phy Reset: 0.28
Phy Reset: 0.20
pRegPerm = 0x30082000, dram1=0x30082000, offset = 0x00000000, size = 0x00001400
PRU ESC: Rev 0690 | Bld 0514 | INTC base: 0x300a0000 , id = 0x4e82a900
INTC.HIDISR addr: 0x300a0038
TxPDO created 0x1A00: 0x701609f0
EC_SLV_APP_SS_populateDescriptionObjectValues:3430 PDO Out Len: 0xa0
Phy Reset: 0.28
Phy Reset: 0.20
Phy UnReset: 0.28
Phy UnReset: 0.20
Configure Phy bits: PhyAddr:3, LinPol:HIGH, PhyAddr:1, LinPol:HIGH, (0x0)
DP83822 detected
DP83822 detected
PRU_PHY_detect:185 Phy 1 alive
PRU_PHY_detect:185 Phy 3 alive
Phy 3 : Enable AutoMDIX
Phy 3 : Restart ANEG
Phy 3: BMSR post ANEG: 7849 ANEG:NComplete Link:No
Phy 1 : Enable AutoMDIX
Phy 1 : Restart ANEG
Phy 1: BMSR post ANEG: 786d ANEG:Complete Link:Yes
PHY Disable Magnetics
PHY Enable Magnetics
Device - e0000000h / 50000004h

****EC Slave*********************************************************
Numeric Version: 0x00020001
Source Id: <d1ef1d4bb48950f43f413c583128ca745fd7dca7>
****HWAL*************************************************************
Numeric Version: 0x00020001
Friendly Version: <KB HWAL v00.02.00.01>
Source Id: <bc8219a368952975ce823b0b8d3d9662d590bdd9>
****OSAL*************************************************************
Numeric Version: 0x00010201
Friendly Version: <KB OSAL v00.01.02.01>
Source Id: <e8e43e42ad9e606fd698b4b6d43b669ef7d05f16>
*********************************************************************
State change: 0x0 -> 0x1
SSC_checkTimer:MaxD:9039790 (9)
SSC_checkTimer:MaxET:81
SSC_checkTimer:MaxD:11999545 (11)


I'm able to configure the same setup as ICSS_TCPServer (Works fine)

While trying to connect with TwinCAT I got no devices.

Can you suggest anything to check on firmware.

Regards,
D.Jenita

  • Hi Jenita,

    Log: (While taking the log Port 2 is connected with PC TwinCAT)
    • If you're using the same port for scanning the device, can you try scanning from Port 1 (left port).

    Also can you try disabling EnhancedLink feature and see if you're able to scan ?

    Regards,
    Aaron

  • Couple of additional checks to keep in mind:

    • Ensure that auto-negotiation is enabled on the PHY and the AM243x, as the PHY needs to communicate with the other end of the link (e.g., EtherCAT master or switch) to establish the link speed and duplex mode. The DP83822 PHY supports both 100BASE-TX and 1000BASE-T Ethernet speeds, but auto-negotiation must be correctly configured to establish the link.
    • Make sure that the PHY is configured in the MII mode for the AM243x. You should select the corresponding mode in SysConfig and make sure the proper pins are multiplexed for the PHY.
    • Make sure that the PHY is configured in MII mode for the AM243x. You should select the corresponding mode in SysConfig and make sure the proper pins are multiplexed for the PHY.
    • Ensure the correct PHY address is set. If using multiple PHYs, make sure they each have unique addresses. If you are using a single PHY, check that the PHY address is correctly assigned. From the logs, it looks like PHY address is correct.
    • 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 to the corresponding GPIOs or MII interface.
    •  Check if the link is up from the MDIO Link Register (0x300B240C).

    Also it would be good if you could provide the PHY Register values once the port is connected. The PHY Status register should provide the link status and whether auto-negotiation is successful.

    Regards,
    Aaron  

  • Hi Aaron, 

    If you're using the same port for scanning the device, can you try scanning from Port 1 (left port).

    I checked with both the port, just to mention the particular log is taken while connected with port 2.

    Also can you try disabling EnhancedLink feature and see if you're able to scan ?

    I'm not sure whether you mentioned this. If yes we did the below changes accordingly, still having issue

    If no, kindly let me know what else to check.

    Regards, 
    D. Jenita

  • Hi Aaron, 

    Thanks for the input.

    Ensure that auto-negotiation is enabled on the PHY and the AM243x, as the PHY needs to communicate with the other end of the link (e.g., EtherCAT master or switch) to establish the link speed and duplex mode. The DP83822 PHY supports both 100BASE-TX and 1000BASE-T Ethernet speeds, but auto-negotiation must be correctly configured to establish the link.

    I have checked this in both H/W and F/W, Auto negotiation in enabled properly
     We have set as Mode 1

    F/W - BMCR(0x0000) Bit[12] is set -> Auto negotiation enabled

    We have configured as 100BASE-TX in the code. And as per datasheet, DP83822 PHY does not support 1000BASE-T Speed, Kindly check.

    Make sure that the PHY is configured in the MII mode for the AM243x. You should select the corresponding mode in SysConfig and make sure the proper pins are multiplexed for the PHY.

    In sysconfig Tx, RX, CLK, MDIO, MDC pins were configured correctly, But I'm not using the below LATCH, SYNC pins as it was not taken and removed from sysconfig as well. Does this cause any issue

    Check if the link is up from the MDIO Link Register (0x300B240C).

    Checked this, working good

    Regards,
    D.Jenita

  • In sysconfig Tx, RX, CLK, MDIO, MDC pins were configured correctly, But I'm not using the below LATCH, SYNC pins as it was not taken and removed from sysconfig as well. Does this cause any issue

    No, this should not

  • Hi Aaron, 

    We have made the setup by removing DP83869 PHY IC from LP-AM2434 and connected DP83822 EVM. 

    pins connected with DP83822 EVM,

    RXD[0:3], RXDV, RXER, RXLINK, TXD[0:3], TXEN, MR_CLK, MT_CLK, RESET, INT pins

    Works fine with the customized phy driver DP83822.

    I have the same connections here with AM2432 but not detected in TwinCAT.

    Also I tried IO (PHY Pinmux) configurations again. [Pinmux_config(gPru_icssg1_mii_g_rt1PinCfg, PINMUX_DOMAIN_ID_MAIN);]

    Regards, 
    D.Jenita

  • Hi Jenita,

    Is it possible to share the PHY register values for both the PHYs ?

    Checked this, working good
    • I believe here the link polarity is configured correctly, that is, ACTIVE_HIGH if bit set in 0x300B240C and ACTIVE_LOW if bit unset while connecting the corresponding port to an active network.

    Regards,
    Aaron  

  • Hi Aaron, 

    No Phys connected

    I'm not getting bit unset here after disconnected from phy. 

    When PHY 1 connected

    When PHY 2 connected

    Regards,
    D.Jenita

  • Thank you for the details Jenita. From this, the MDIO Phy Address to be configured in sysconfig is 1 and 3 for ETHPHY0 and ETHPHY1 respectively. You can also try swapping the Phy Address between ETHPHY1 and ETHPHY0, that is, 1 for ETHPHY1 and for ETHPHY0.

    Also, if EnhancedLink is enabled, then configure the PHY polarity as Active Low as follows in : \examples\industrial_comms\ethercat_slave_demo\common\board\am243lp\ESL_BOARD_config.h

    Fullscreen
    1
    2
    #define ECAT_PHYPOLINVERT_IN (false)
    #define ECAT_PHYPOLINVERT_OUT (false)
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    true => Active HIGH
    false => Active LOW

    Regards,
    Aaron

  • Hi Aaron,
     

    configure the PHY polarity as Active Low

    I already tried that before that didn't works for me. But now along with those I also changed 

    Fullscreen
    1
    2
    #define ECAT_PHYUSERXLINK_IN (false)
    #define ECAT_PHYUSERXLINK_OUT (false)
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Now port 2 is up with TwinCAT. I'm having issues with port 1.

    What exactly happens by changing those two macros? Why I'm not getting port 1 up?

    Kindly guide

    Regards,
    D. Jenita

  • Hi Jenita,

    What exactly happens by changing those two macros?
    • These two macros are required for enabling/disabling Enhanced Link for the ports. In order to achieve EtherCAT fast detection requirements, this needs to be enabled.
    • Now that it is set to false, Enhanced Link feature has been disabled.

    Looks like with Enhanced Link enabled, you're not getting an active link on both the ports. Make sure RXLINK pin is connected properly for this to be enabled. 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 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.

    The link polarity needs to be configured based on the status in Reg.0x300B240C if Enhanced Link is enabled.

    Why I'm not getting port 1 up?
    • This needs to be investigated further. Will have to check the PHY register values you shared earlier for the difference between 2 ports.

    Regards,
    Aaron

  • Hi Jenita,

    Sorry for the delay due to other priorities.

    Looks like these bits are not set for the PHY1. And looking at the PHYSTS register the Link Status, Duplex status, Auto-negotiation status, Signal Detect, MDI/MDIX mode bits are all 0. You can compare the PHY register values of the non-working port and compare it with the registers in the datasheet. 

    Regards,
    Aaron