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
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.
#define ECAT_PHYPOLINVERT_IN (false) #define ECAT_PHYPOLINVERT_OUT (false) #define ECAT_PHYUSERXLINK_IN (false) #define ECAT_PHYUSERXLINK_OUT (false)
share the PHY register dumps from (0 to 0x1F) for both ports.
After above change I read bellow.
|
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.
|
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:
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?
void CUST_PHY_DP83822_softwareRestart(void* pAppCtxt_p, void* pStackCtxt_p) { OSALUNREF_PARM(pAppCtxt_p); OSALUNREF_PARM(pStackCtxt_p); }
or disable this CB function?
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; }
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:
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.
Regards,
Aaron
Hi Aaron,
I modified ESL_BOARD_config.h,
#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)
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.