GD32F4XX ENET 工程 配置以太网PHY RMII 模式后,启动直接进入死循环,如下函数中enet_software_reset 返回ERROR :
static void enet_mac_dma_config(void)
{
ErrStatus reval_state = ERROR;
/* enable ethernet clock */
rcu_periph_clock_enable(RCU_ENET);
rcu_periph_clock_enable(RCU_ENETTX);
rcu_periph_clock_enable(RCU_ENETRX);
/* reset ethernet on AHB bus */
enet_deinit();
reval_state = enet_software_reset();
if(ERROR == reval_state){
while(1){
}
}
/* configure the parameters which are usually less cared for enet initialization */
// enet_initpara_config(HALFDUPLEX_OPTION, ENET_CARRIERSENSE_ENABLE|ENET_RECEIVEOWN_ENABLE|ENET_RETRYTRANSMISSION_DISABLE|ENET_BACKOFFLIMIT_10|ENET_DEFERRALCHECK_DISABLE);
// enet_initpara_config(DMA_OPTION, ENET_FLUSH_RXFRAME_ENABLE|ENET_SECONDFRAME_OPT_ENABLE|ENET_NORMAL_DESCRIPTOR);
#ifdef CHECKSUM_BY_HARDWARE
enet_init_status = enet_init(ENET_100M_FULLDUPLEX, ENET_AUTOCHECKSUM_DROP_FAILFRAMES, ENET_BROADCAST_FRAMES_PASS);
#else
enet_init_status = enet_init(ENET_AUTO_NEGOTIATION, ENET_NO_AUTOCHECKSUM, ENET_BROADCAST_FRAMES_PASS);
#endif /* CHECKSUM_BY_HARDWARE */
}
实测 PHY RMII REF 有50M 时钟输出;且网口连接电脑 能够LINK 成功;
|