中级会员
 
- 积分
- 366
- 金钱
- 366
- 注册时间
- 2017-4-11
- 在线时间
- 33 小时
|
30金钱
本帖最后由 其木王王子 于 2020-9-25 10:03 编辑
用STM32F407VE + (REALTEK PHY)RTL8201F 使用RMII接口调试 以太网。目前情况是:1. 和PHY能够通过SMI通讯,读写PHY内部寄存器值;
2. PHY 外部无源晶振25M能够正常启振,示波器查看是有40ns的正弦波,经过PHY内部倍频出来的50M也有20ns的周期。
3.LINK 绿色灯亮
问题是:
在 Ethernet Software reset 时, Wait for software reset 一直超时HAL_TIMEOUT。 晶振都有了,为啥还是超时??
板子是自己组的人画的,一次性做了10片,PHY芯片是贴片的。
- /* Ethernet Software reset */
- /* Set the SWR bit: resets all MAC subsystem internal registers and logic */
- /* After reset all the registers holds their respective reset values */
- (heth->Instance)->DMABMR |= ETH_DMABMR_SR;
-
- /* Get tick */
- tickstart = HAL_GetTick();
-
- /* Wait for software reset */
- while (((heth->Instance)->DMABMR & ETH_DMABMR_SR) != (uint32_t)RESET)
- {
- /* Check for the Timeout */
- if((HAL_GetTick() - tickstart ) > ETH_TIMEOUT_SWRESET)
- {
- heth->State= HAL_ETH_STATE_TIMEOUT;
-
- /* Process Unlocked */
- __HAL_UNLOCK(heth);
-
- /* Note: The SWR is not performed if the ETH_RX_CLK or the ETH_TX_CLK are
- not available, please check your external PHY or the IO configuration */
- return HAL_TIMEOUT;
- }
- }
复制代码
|
最佳答案
查看完整内容[请看2#楼]
调了3天半。 结果发现是 RMII 模式下的CRS/CRS_DV引脚与MCU的功能引脚错误。
只能改用MII模式。
|