我正在使用GMAC MDIO读取外部phy的寄存器,通过逻辑分析仪能够看到已经读取成功,但是Gmac_Ip_MDIORead读取的值始终为0, Base->MAC_MDIO_DATA也始终为0。应该怎么才能都回来正确的值呢?
uint16 rmii_sel = 0;
uint16 phy_reg_val0, phy_reg_val1;
uint16 phy_addr;
Gmac_Ip_EnableMDIO(CFG_PHY_CTRL_IDX, FALSE, 160000000UL);
/* Search for the PHY address */
for (phy_addr = 0U; phy_addr < 32U; ++phy_addr)
{
Gmac_Ip_MDIORead(CFG_PHY_CTRL_IDX, 1, 2U, &phy_reg_val0, 100U);
Gmac_Ip_MDIORead(CFG_PHY_CTRL_IDX, 1, 3U, &phy_reg_val1, 100U);
Solved! Go to Solution.
Hi,
do you have MDIO pin properly configured as Input/output with both input and output buffer enabled?
BR, Petr
Hi,
do you have MDIO pin properly configured as Input/output with both input and output buffer enabled?
BR, Petr