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.

RTOS/AM3359: EtherCAT Slave PHY issue

Part Number: AM3359
Other Parts Discussed in Thread: TLK110, , AMIC110

Tool/software: TI-RTOS

Hello,

We have the custom board with TLK110 as well as with DP83848 PHY.  The board with TLK works fine where as the board with DP83848 does not work. We have the following configuration: 

Configuration used:

  • processor_sdk_rtos_am335x_3_03_00_04
  • pdk_am335x_1_0_6
  • PRU-ICSS-EtherCAT_Slave_01.00.03.01
  • Code Composer Studio 7.1.0

 

The list of changes we have tried   

 

Please find the details in attached file

  1. PHY Changes
  • Comment all PHY register access except 0x2
  • PHY address as 1 (port:- 1/IN) and 3 (port:-2/OUT)
  • Enhanced link detection enabled

 

S.No

Register Address

Bit Number

Value

Purpose

Remarks

Change in BE SW for DP83848

1

0x19

bit 15

"1"

Enable PHY Auto MDIX

HW Strap available in BE V1 for enabling the Auto MDIX

Comment this in SW

2

0x17

all bits

"0"

Turning OFF RMII mode

HW Strap available in BE V1 for enable MII mode / disable RMII mode

Comment this in SW

3

0x2

all bits

Read only

Checking whether this is equal to "0x2000"

same as TLK110

no change in SW

4

0xA

bit 5

"1"

Force 100base-TX Full duplex mode

Not available in DP83848

Comment this in SW

5

0xA

bit 1

"1"

ODD Nible Detection disable

Not required / not available

Comment this in SW

6

0x19

bit 5

'0''

LED Mode 3

Not required

Comment this in SW

7

0x19

bit 6

'1''

LED Mode 3

Not required

Comment this in SW

8

0x18

bit 9

'0''

LED Flashing Speed

Not required

Comment this in SW

9

0x18

bit 10

'1''

LED Flashing Speed

Not required

Comment this in SW

10

0xB

bit 0

'1''

Fast link down mode - Signal / Energy loss

Not available in DP83848

Comment this in SW

11

0xB

bit 3

'1''

Fast link down mode - RX error count

Not available in DP83848

Comment this in SW

12

0x9

bit 15

"1"

SW Strap configuration done

Not available in DP83848

Comment this in SW

 

We believe this has to do with the link detection, and we have gone through the following but still that dint help.

 

One more weird behaviour seen is that if the ethernet cable is connected first to OUT port and then to IN port the communication happens on IN port subsequently. Does this indicate something for the above issue ? Or can you please help understand this behaviour ? And also help DP83848 work ? 

Best Regards,

Mohit

  • The RTOS team have been notified. They will respond here.
  • Hi Mohit

    I understand that you have made some updates based upon the inputs from the Phy team.
    What are issues that you are seeing with these updates?
    What is the software configuration that you are using?

    David
  • Hi Mohit,

    Can you send the schematic? The DP83848 and TLK110 have bootstaps. I would need to review the schematic to be sure the PHY is strapping to the correct configuration.
    Are you seeing Port 0 and Port 1 linking?
    What are registers 0x0h to 0x1Fh reading when you have the configuration file commented out?

    Thank you,
    Ross
  • Hello David/Ross,

    So we have two custom boards:

    1. with TLK110 PHY chip and

    2. with DP83848 PHY chip

    The PSDK and PRU Industrial config is

    Configuration 1:

    • processor_sdk_rtos_am335x_3_03_00_04

    • pdk_am335x_1_0_6

    • PRU-ICSS-EtherCAT_Slave_01.00.03.01

    • ethercat_slave_full_AM335x_arm project

    • Code Composer Studio 7.1.0

    Configuration 2:

    • processor_sdk_rtos_am335x_4_00_00_04

    • pdk_am335x_1_0_7

    • PRU-ICSS-EtherCAT_Slave_01.00.04.02

    • ethercat_slave_full_AM335x_arm project

    • Code Composer Studio 7.1.0

    We have tested the above configurations on custom board with TLK110 PHY chip and ethercat communication works fine.

    The other board where the only difference is PHY chip i.e. DP83848, it is not working. The ethercat communication is not established with the TwinCAT(or any other ethercat master).

    Based on the inputs from other e2e forums we tried the following on the 2nd custom board(DP83848):

    1.  in tiescbsp.c, bsp_init(), before calling bsp_pruss_mdio_init(), we updated the following

    mdioParamsInit.enhancedlink_enable = TIESC_MDIO_RX_LINK_DISABLE;

    2. We compared the registers between TLK110 and DP83848. Based on the above analysis, we commented the code where TLK registers were getting written by the sample application code.

    After this, the value of PHY registers are:

    PHY Register Address Value for PHY_ADD-1(IN PORT) Value for PHY_ADD-3(OUT PORT)
    0 0x3100 (Hex) 0x3100 (Hex)
    1 0x786D (Hex) 0x7849 (Hex)
    2 0x2000 (Hex) 0x2000 (Hex)
    3 0x5C90 (Hex) 0x5C90 (Hex)
    4 0x01E1 (Hex) 0x01E1 (Hex)
    5 0xCDE1 (Hex) 0x0000 (Hex)
    6 0x000D (Hex) 0x0004 (Hex)
    7 0x2801 (Hex) 0x2001 (Hex)
    10 0x0615 (Hex) 0x0000 (Hex)
    11 0x0000 (Hex) 0x0000 (Hex)
    12 0x0000 (Hex) 0x0000 (Hex)
    13 0x0000 (Hex) 0x0000 (Hex)
    14 0x0000 (Hex) 0x0000 (Hex)
    15 0x0000 (Hex) 0x0000 (Hex)
    16 0x0100 (Hex) 0x0100 (Hex)
    17 0x0001 (Hex) 0x0001 (Hex)
    18 0x0000 (Hex) 0x0000 (Hex)
    19 0x8021 (Hex) 0x8023 (Hex)
    1A 0x0804 (Hex) 0x0804 (Hex)
    1B 0x0000 (Hex) 0x0000 (Hex)
    1C 0x0000 (Hex) 0x0000 (Hex)
    1D 0x6011 (Hex) 0x6011 (Hex)

    regards

    Mohit

  • Hi Mohit

    The MDIO MDIO ALIVE and LINK registers are valuable to use when assessing EtherCAT status

    The MDIO is described in Section 14.3.8 MDIO of the AM335x TRM http://www.ti.com/lit/pdf/spruh73

    The PRU-ICSS MDIO register set starts at @ 0x4a33_2400

     

    The MDIO Alive register is updated by the MII Management I/F module if the PHY acknowledged the read

    of the generic status register. In addition, any PHY register read transactions initiated by the host also

    cause the MDIOAlive register to be updated.

     

    ALIVE bits will be set for corresponding PHY addresses  

    The MDIO PHY alive status register (MDIOALIVE) can be read in polling fashion until a PHY connected to the system responded, and the MDIO PHY link status register (MDIOLINK) can determine whether this PHY already has a link

     

    Verify that the appropriate PHY addresses are being set in the MDIO user PHY select register (MDIOUSERPHYSELn),

     

    Link polarity is of importance for EtherCAT if enhanced link detection is enabled, this can be disabled during MDIO init via DISABLE macro instead of ENABLE. This is defined in tiescbsp.h  and  tiescbsp.c.

     

    The best way is to check this using MDIO link register and inserting ethernet cable from PC to DUT port and observing any change. If link register is zero with – no ports connected both links will be active HIGH. If port0 link connected and up, port0 is active LOW and you need to adjust this in link polarity field during mdio init.

     

     The MDIO is initialized by bsp_pruss_mdio_init . This API is documented in http://processors.wiki.ti.com/index.php/PRU_ICSS_EtherCAT_firmware_API_guide#bsp_pruss_mdio_init

     

    David

  • Hello David,

    The correct PHY addresses are getting set in MDIOUSERPHYSELn

    We are using PHY addresses 1 and 3.

    Here I am attaching the screenshot of MDIO registers when port 0 (having PHY address 1) is connected to Ethercat Master. We have disabled the enhanced link using the macro of tiescbsp.h

    regards

    Mohit

  • Mohit
    It looks like you are paralleling what we would see on the ICE with Enhanced Link Detection disabled.
    Let me quickly confirm with our team.
    David

  • Mohit

    They confirmed this is correct.

    Are you still seeing :
    One more weird behavior seen is that if the Ethernet cable is connected first to OUT port and then to IN port the communication happens on IN port subsequently. Does this indicate something for the above issue ?

    If so does changing file
    {InstallDirectory}\PRU-ICSS-EtherCAT_Slave_01.00.04.02\protocols\ethercat_slave\ecat_appl\EcatStack\tieschw.c
    by
    Commenting out Line 190 #ifdef iceAMIC11x
    Commenting out Line 206 #endif
    to enable the workaround for *PORT 0* detection issue change the behavior?


    David
  • Hello David,
    Yes the behavior is similar to what we are observing in custom board (AM3359 + DP83848 PHY) after disabling enhanced link detection.
    After enabling the code of “workaround for *PORT 0* detection issue with AMIC110" in our build, the communication is working on PORT 0.

    • Can you please explain us about the workaround added for AMIC110?
    • Is the workaround specific to DP PHY chip because we see the same issue with AM3359?
    • Why is it called a workaround? Is there a plan to release a new version of DP PHY where this will be fixed?
    • Is there anything else to consider for DP PHY chip which was observed during the above workaround?

    regards
    Mohit
  • Hi Mohit

    Thank you for confirming.
    We encountered this on the AMIC110 when using this with the DP83822 Phy. Our initial assessment was that this was related to the 300 MHz speed of the AMIC110 and not the DP83822 Phy. The reason that this is called a workaround is that this fix was uncovered as released quickly to resolve this issue while further evaluation is being done on the AMC110 and DP83822 Phy combination.
    Your findings are good feedback for this investigation and will help to uncover the root case and best overall solution.
    There are no other issues that are known for the DP83822 phy .

    David
  • Mohit

    Have you encountered any other issues?

    David
  • Hello David,
    As of now, with the workaround of port 0 detection, it is working.
    But do let us know if you get more clarity about this workaround/issue. So when we have a proper solution, we will have to update the PRU firmware or the PHY chip version accordingly.

    Thanks
    Mohit
  • Hello Mohit

    Thank you. I will update you as soon as we know more..

    David