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.

ethercat slave get stuck in a loop

Other Parts Discussed in Thread: AM3359, TLK110, AM3357

We have designed a board based on BeagleBone Black and AM3359 ICE. The board should be able to run Linux as a EtherCAT master, should also run TI's realtime system as a EtherCAT slave (with a GPIO pin pull high/low).


While testing sdk/examples/ethercat_slave + HW_init() (a function copied from sdk/protocols/ethecat_slave), the program get stuck in function bsp_pruss_mdio_phy_read(). It can not leave the following loop:

bsp_pruss_mdioreg_write((0x80000000 | (phyaddr << 16) | (regoffset << 21)), ICSS_MDIO_USRACCESS0);

do {

            u32regval = bsp_pruss_mdioreg_read(ICSS_MDIO_USRACCESS0);

}while (u32regval&0x80000000);


Because we do not have code of pruss, we do not understand what u32regval&0x80000000 means.

Can anyone tell me what does u32regval&0x80000000 mean?

  • Hello,

    This issue comes up if the PHY is not properly reset, or the PHY configuration is wrong.

    The API bsp_pruss_mdioreg_write writes to the MDIO registers, you can get the details in TRM. Here it reads the MDIOUSERACCESS0 Register and waits to check if the 31st bit(GO) is cleared

    Regards,
    Vinesh
  • Hi,
    1) Where can we find more descriptions for PRU-ICSS MDIO registers?
    2) When our system(AM3357) is booting, the TLK110 is in RMII mode. If we want to communicate with PHY using PR1_MDIO_MDCLK/PR1_MDIO_DATA, does the TLK110 should be in MII mode?
  • Hi,

    1)The MDIO registers are standard and you can find the definitions in TRM-CPSW section(Ethernet-Subsystem->Ethernet Subsystem Registers->MDIO Registers)

    2)RMII/MII mode shouldn't really have an impact on MDIO operations. Have you configured the PHY addresses correctly?(You can check the MDIOALIVE[0x4a332400 + 0x8] or MDIOLINK[0x4a332400 + 0xc] registers)

    Note that for EtherCAT slave implementation(using PRUSS), supports only MII mode.

    Regards,
    Vinesh