GD32F450ZGT6:
PC1:MDC
PA2:MDIO
PA1:RMII_CLK
PA7:RMII_CRS_DV
PC4:RMII_RXD0
PC5:RMII_RXD1
PB11:RMII_TXEN
PB12:RMII_TXD0
PB13:RMII_TXD1
PB15:RMII_nINT
MCU和YT8522H共用25Mhz有源晶振
软件:
"gd32fxx_enet.h"增加
#define YT8522 2
#define PHY_TYPE YT8522
//增加YT8522类型
#elif(PHY_TYPE == YT8522)
#define PHY_SpecificFunReg 16U /*!< specific function control register /
#define PHY_SR 17U /!< tranceiver status register /
#define PHY_SPEED_STATUS ((uint16_t)0x4000) /!< configured information of speed: 10Mbit/s /
#define PHY_DUPLEX_STATUS ((uint16_t)0x2000) /!< configured information of duplex: full-duplex */
enet_init()函数内做如下修改
/* configure the communication speed of MAC following the auto-negotiation result */
if((phy_value & PHY_SPEED_STATUS)==0) { //2024/12/12
media_temp |= ENET_SPEEDMODE_10M;
} else {
media_temp |= ENET_SPEEDMODE_100M;
}
做上述修改后,初始化成功