运行一二天后就ping不通了,怎么跟踪解决?
使用lwip,硬件是28j60。我使用finsh shell查看的信息有:finsh>>list_mem()
total memory: 47808
used memory : 36992
maximum allocated memory: 41476
0, 0x00000000
内存没有异常。
finsh>>show_reg()
0, 0x00000000
finsh>>enc28j60()
-- enc28j60 registers:
HwRevID: 0x06
Cntrl: ECON1 ECON2 ESTATEIREIE
0x000x800x010x000x00
MAC: MACON1 MACON3 MACON4
0x00 0x00 0x00
Rx : ERXSTERXNDERXWRPT ERXRDPT ERXFCON EPKTCNT MAMXFL
0x05fa 0x1fff 0x00000x05fa0xa1 0x00 0x0600
Tx : ETXSTETXNDMACLCON1 MACLCON2 MAPHSUP
0x2c00 0x0000 0x0f 0x37 0x10
0, 0x00000000
finsh>>list_thread()
threadpristatus sp stack size max used left tickerror
-------- ---- ------- ---------- ---------- ---------- ---------- ---
c_webnet 0x15 suspend 0x00000118 0x00000400 0x000001b8 0x00000003 000
wb_gui 0x19 ready 0x000000d8 0x00001000 0x000003f0 0x00000009 000
rtgui 0x0f suspend 0x000000e8 0x00000400 0x000000e8 0x00000004 000
tcpip 0x0c suspend 0x000000d0 0x00000400 0x00000218 0x0000000e 000
etx 0x0f suspend 0x00000090 0x00000200 0x000000a0 0x00000003 000
erx 0x0f suspend 0x00000090 0x00000200 0x000000f0 0x0000000b 000
tidle 0x1f ready 0x00000058 0x00000100 0x00000060 0x0000001e 000
tshell 0x14 ready 0x000001a0 0x00000800 0x00000320 0x00000009 000
led 0x14 suspend 0x00000078 0x00000200 0x00000078 0x00000005 000
0, 0x00000000
除啦这样查看,还有什么命令可以看到故障吗? 重新复位后正常,总不能一两天都插着仿真器吧! 重点检查ENC28J60的发送阻塞,以防止发送失败后死锁。
即检查 etx 线程是因什么原因挂起,list_sem()等。 finsh>>list_thread()
threadpristatus sp stack size max used left tickerror
-------- ---- ------- ---------- ---------- ---------- ---------- ---
wb_gui 0x19 ready 0x000000d8 0x00001000 0x000003f0 0x00000003 000
rtgui 0x0f suspend 0x000000e8 0x00000400 0x000000e8 0x00000005 000
tcpip 0x0c suspend 0x000000d0 0x00000400 0x00000198 0x00000012 000
etx 0x0f suspend 0x00000090 0x00000200 0x00000090 0x0000000f 000
erx 0x0f suspend 0x00000090 0x00000200 0x000000c0 0x0000000b 000
tidle 0x1f ready 0x00000058 0x00000100 0x00000060 0x00000001 000
tshell 0x14 ready 0x00000088 0x00000800 0x000002f0 0x00000009 000
led 0x14 suspend 0x00000078 0x00000200 0x00000078 0x00000005 000
0, 0x00000000
finsh>>list_sem()
semaphore v suspend thread
----------- --------------
topwin 001 0
spi2lock? 001 0
sem1 001 0
sem0 001 0
e0 000 0
lock 001 0
shrx 000 0
sdlock 001 0
heap 001 0
0, 0x00000000
finsh>> finsh>>list_timer()
timer periodic timeout flag
-------- ---------- ---------- -----------
rtgui 0x00000064 0x00000000 deactivated
rtgui 0x00000064 0x00000000 deactivated
rtgui 0x00000064 0x00000000 deactivated
rtgui 0x00000064 0x00000000 deactivated
rtgui 0x00000032 0x001a7c7e activated
rtgui 0x00000002 0x001a7c7a activated
wb_gui 0x00000000 0x00000000 deactivated
rtgui 0x00000000 0x00000000 deactivated
touch 0x0000000c 0x00000000 deactivated
tcpip 0x00000064 0x001a7cd4 activated
etx 0x00000000 0x00000000 deactivated
erx 0x00000000 0x00000000 deactivated
tidle 0x00000000 0x00000000 deactivated
tshell 0x00000064 0x001a547f deactivated
led 0x00000032 0x001a7c80 activated
current tick:0x001a7c7d
0, 0x00000000 查ENC28J60寄存器
我前段时间调试rtt+lwip+dm9000aep也是,网线直连电脑连续半个月也不会有问题,一旦放到局域网里面,过不了几个小时就收不到数据,后来查dm9000的寄存器发现每次卡死时都是收到多播包时,查了好久才发现是局域网里偶尔会有些特殊的多播包,遇到这个包就卡死了,到现在也没有完美解决。 aozima 发表于 2013-3-25 11:10 static/image/common/back.gif
重点检查ENC28J60的发送阻塞,以防止发送失败后死锁。
即检查 etx 线程是因什么原因挂起,list_sem()等。 ...
finsh>>list_thread()
threadpristatus sp stack size max used left tickerror
-------- ---- ------- ---------- ---------- ---------- ---------- ---
wb_gui 0x19 ready 0x000000d8 0x00001000 0x000003f0 0x00000003 000
rtgui 0x0f suspend 0x000000e8 0x00000400 0x000000e8 0x00000005 000
tcpip 0x0c suspend 0x000000d0 0x00000400 0x00000198 0x00000011 000
etx 0x0f suspend 0x00000090 0x00000200 0x00000090 0x00000008 000
erx 0x0f suspend 0x00000090 0x00000200 0x000000c0 0x00000007 000
tidle 0x1f ready 0x00000040 0x00000100 0x00000060 0x00000009 000
tshell 0x14 ready 0x00000088 0x00000800 0x000002f0 0x00000005 000
led 0x14 suspend 0x00000078 0x00000200 0x00000078 0x00000005 000
0, 0x00000000
finsh>>
以上是正常情况下,etx也是挂起的。 本帖最后由 林州 于 2013-3-25 17:27 编辑
正常情况如下:
finsh>>enc28j60()
-- enc28j60 registers:
HwRevID: 0x06
Cntrl: ECON1 ECON2 ESTATEIREIE
0x040x800x010x000xc8
finsh>>enc28j60()
-- enc28j60 registers:
HwRevID: 0x06
Cntrl: ECON1 ECON2 ESTATEIREIE
0x00 0x80 0x01 0x00 0x00 故障时寄存器被修改了,正在找为什么?
本帖最后由 林州 于 2013-3-26 09:43 编辑
不通时MAC: MACON1 MACON3 MACON4
0x00 0x00 0x00 这3个寄存器只在初始化时进行了操作,为什么会运行中变成0呢!是不是我的28j60硬件坏了?如果拔掉网线运行,这个故障率会提高不少。求解?(用的RT-thread的28j60驱动程序) jlink
查看,根本不进入中断。这咋回事,寄存器为什么置0呢 问题应该是这样的,28j60用杜邦线供电,接触可能不好,只要拿手晃几下就会出现上面的情况,这次我拿胶枪把线直接粘到板子上了,再运行几天试试。 因为ENC28J60是电平中断,而STM32只支持边沿中断,那么当某次中断错过了,就再也进不了中断了。
当实际项目中有这种情况时,软件上面要做规避。 打胶会好些,但不能保证不会死锁。
页:
[1]