先说硬件配置:CH32V307VCT6通过RGMII与国产某千兆PHY连接;CH32V307的PB1管脚(RGMII_125IN)接的是外部独立的125M TCXO;CH32V307的时钟来自外部8M晶振;千兆PHY的时钟来自外部独立的25M晶振,与CH32V307无关。
软件部分:直接使用官网上提供的demo例程(ETH_RGMII),仅仅把发送部分的打印信息去掉了,见下图:
另外,为了便于测试,我把demo例程里的ARP包的数据改成跟我计算机相匹配。
测试结果:PHY正常自协商到千兆。从抓包数据来看,数据的发送正常,每0.8秒左右计算机就会收到CH32V307发过来的ARP报文,同时计算机及时回复了报文,见下图:
但是调试打印结果提示经常收不到计算机回复的报文,时而能收到时而收不到,见下面打印信息:
receive counter:6.
read_length:60
Received@0x200002a0
Status:0x80408302
84 c2 e4 01 02 03
e8 6a 64 53 29 a0
08 06 00 01 08 00 06 04 00 02 END!
Error:recv error frame,status:0x00408302.
Error:recv error frame,status:0x00408302.
Error:recv error frame,status:0x00408302.
receive counter:7.
read_length:60
Received@0x20001a60
Status:0x80400300
84 c2 e4 01 02 03
e8 6a 64 53 29 a0
08 06 00 01 08 00 06 04 00 02 END!
receive counter:8.
read_length:60
Received@0x20002050
Status:0x80400300
84 c2 e4 01 02 03
e8 6a 64 53 29 a0
08 06 00 01 08 00 06 04 00 02 END!
receive counter:9.
read_length:60
Received@0x200002a0
Status:0x80408302
84 c2 e4 01 02 03
e8 6a 64 53 29 a0
08 06 00 01 08 00 06 04 00 02 END!
Error:recv error frame,status:0x00408302.
receive counter:10.
read_length:60
Received@0x20000e80
Status:0x80408302
84 c2 e4 01 02 03
e8 6a 64 53 29 a0
08 06 00 01 08 00 06 04 00 02 END!
receive counter:11.
read_length:60
Received@0x20001470
Status:0x80400300
84 c2 e4 01 02 03
e8 6a 64 53 29 a0
08 06 00 01 08 00 06 04 00 02 END!
receive counter:12.
read_length:60
Received@0x20001a60
Status:0x80400300
84 c2 e4 01 02 03
e8 6a 64 53 29 a0
08 06 00 01 08 00 06 04 00 02 END!
receive counter:13.
read_length:60
Received@0x20002050
Status:0x80400300
84 c2 e4 01 02 03
e8 6a 64 53 29 a0
08 06 00 01 08 00 06 04 00 02 END!
Error:recv error frame,status:0x00408302.
receive counter:14.
read_length:60
Received@0x20000890
Status:0x80400300
84 c2 e4 01 02 03
e8 6a 64 53 29 a0
08 06 00 01 08 00 06 04 00 02 END!
receive counter:15.
read_length:60
Received@0x20000e80
Status:0x80400300
84 c2 e4 01 02 03
e8 6a 64 53 29 a0
08 06 00 01 08 00 06 04 00 02 END!
Error:recv error frame,status:0x00408302.
receive counter:16.
read_length:60
Received@0x20001a60
Status:0x80400300
84 c2 e4 01 02 03
e8 6a 64 53 29 a0
08 06 00 01 08 00 06 04 00 02 END!
Error:recv error frame,status:0x00408302.
receive counter:17.
read_length:60
Received@0x200002a0
Status:0x80400300
84 c2 e4 01 02 03
e8 6a 64 53 29 a0
08 06 00 01 08 00 06 04 00 02 END!
Error:recv error frame,status:0x00408302.
receive counter:18.
read_length:60
Received@0x20000e80
Status:0x80408302
84 c2 e4 01 02 03
e8 6a 64 53 29 a0
08 06 00 01 08 00 06 04 00 02 END!
Error:recv error frame,status:0x00408302.
这种情况有可能是什么造成的?硬件问题还是软件以太网驱动问题?