在stm32f107vc+DM9161AEP下应用Rt-Thread0.3.1,没有ping通,请朋友们帮忙看看哪里错了(
板子的配置为STM32F107VC+DM9161AEP在不用操作系统时可以调通,从其串口中也可以打印出DM9161的状态。ETH_ReadPHYRegister 0:0x3100
ETH_ReadPHYRegister 16:0x514
ETH_ReadPHYRegister 1:0x784D
ETH_ReadPHYRegister 1:0x786D
ETH_Mode ETH_Mode_FullDuplex
ETH_Speed ETH_Speed_100M
ETH_ReadPHYRegister(0,0):0x3100
ETH_ReadPHYRegister(0,1):0x786D
ETH_ReadPHYRegister(0,2):0x181
ETH_ReadPHYRegister(0,3):0xB8A0
ETH_ReadPHYRegister(0,4):0x1E1
ETH_ReadPHYRegister(0,5):0x45E1
ETH_ReadPHYRegister(0,6):0x3
ETH_ReadPHYRegister(0,17):0x8208
==>ETH_Speed_100M!
ETH_ReadPHYRegister(0,17):0x8208
==>ETH_Mode_FullDuplex!
ETH_ReadPHYRegister(0,1):0x786D
ETH_ReadPHYRegister(0,2):0x181
ETH_ReadPHYRegister(0,3):0xB8A0
ETH_ReadPHYRegister(0,4):0x1E1
ETH_ReadPHYRegister(0,5):0x45E1
ETH_ReadPHYRegister(0,6):0x1
ETH_ReadPHYRegister(0,17):0x8208
==>ETH_Speed_100M!
ETH_ReadPHYRegister(0,17):0x8208
一共读了两次ETH的状态,一次为LWIP_INIT()之前,一次为LWIP_INIT()之后。两次寄存器的区别仅仅在于ETH_ReadPHYRegister(0,6):0x3和ETH_ReadPHYRegister(0,6):0x1;
我在手册上查了,
1位为A new link code word page received. This bit will be automatically cleared when the register (register 6) is read by management。
当在rt-thread中应用时,其串口打印的dm9161寄存器状态如下:
\ | /
- RT - Thread Operating System
/ | \ 0.3.1 build Nov 28 2011
2006 - 2010 Copyright by rt-thread team
sdcard init failed
rtc is not configured
please configure with set_date and set_time
File System initialzation failed!
ETH_ReadPHYRegister(0,0):0x3100
ETH_ReadPHYRegister(0,1):0x786D
ETH_ReadPHYRegister(0,2):0x181
ETH_ReadPHYRegister(0,3):0xB8A0
ETH_ReadPHYRegister(0,4):0x1E1
ETH_ReadPHYRegister(0,5):0x45E1
ETH_ReadPHYRegister(0,6):0x3
ETH_ReadPHYRegister(0,17):0x8208
==>ETH_Speed_100M!
ETH_ReadPHYRegister(0,17):0x8208
==>ETH_Mode_FullDuplex!
ETH_ReadPHYRegister(0,0):0x3100
ETH_ReadPHYRegister(0,1):0x786D
ETH_ReadPHYRegister(0,2):0x181
ETH_ReadPHYRegister(0,3):0xB8A0
ETH_ReadPHYRegister(0,4):0x1E1
ETH_ReadPHYRegister(0,5):0x45E1
ETH_ReadPHYRegister(0,6):0x3
ETH_ReadPHYRegister(0,17):0x8208
==>ETH_Speed_100M!
ETH_ReadPHYRegister(0,17):0x8208
==>ETH_Mode_FullDuplex!TCP/IP initialized!
finsh>>
不用操作系统的时候可以ping通,现在ping不通。另外我上传了我的代码,请朋友们有时间用我看看。谢谢
传了一下午都没传成功附件,我QQ:370999235.
可以跟我QQ联系,共同探讨问题。 擦 标题Rt-Threadk1.3.1,真是猛料,版本更新真是神速! 一不小心写错了,一楼的朋友莫笑啊 默认情况下PHY并不需要配置就可以工作(默认PHY是自动协商的)
而现在的网络多是100M交换机,因此默认配置为100全双工就不用管PHY.
因各种板子太多,PHY的地址也不一样。
因此RT-Thread的SVN中的代码正考虑把PHY部分拿掉。这样拿到手不同的板子也比较容易调通。
当然,实际项目中还是要处理线路插拔及速率和双工状态的改变。
页:
[1]