首页 > 代码库 > u-boot-2014-04 网络不通解决一例

u-boot-2014-04 网络不通解决一例

不久前我移植了u-boot-214-04到Tq2440的板子上,基本功能都有了,网卡也可以使用了。有一天打算把u-boot-2010-06也也一直到tq2440上,移植完后发现u-boot-214-04在tq2440上的网络死活不通了。

通过加打印发现,在u-boot-2014-04上使用ping命令是有如下信息:

Got ARP
packet received
Receive from protocol 0x86dd
packet received
Receive from protocol 0x86dd
packet received
Receive from protocol 0x800
Got IP
len bad 48 < 124
packet received
Receive from protocol 0x86dd
packet received
Receive from protocol 0x800
Got IP
len bad 62 < 125
packet received
Receive from protocol 0x806
Got ARP
packet received
Receive from protocol 0x86dd
packet received
Receive from protocol 0x800
Got IP
len bad 48 < 126
packet received
Receive from protocol 0x86dd
packet received
Receive from protocol 0x800
Got IP
len bad 62 < 127
packet received
Receive from protocol 0x800
Got IP
len=128, v=00
packet received
Receive from protocol 0x800
 
<style type="text/css">.csharpcode, .csharpcode pre{ font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em;}.csharpcode .lnum { color: #606060; }</style>

即收的的包格式不对,总是打印len bad,觉得不应该,用u-boot-2010-06,网络却是好的。最后发现,原来是我在移植u-boot-2014-04时使用的工具链的版本是:

gcc version 4.3.3 (Sourcery G++ Lite 2009q1-176) 

但是在移植u-boot-2010-06的时候换成了

gcc version 3.4.5

用3.4.5版本了的工具链编译最新的u-boot,会发生问题。然后我重新换成4.3.3版本的工具链,网络就正常了。

 

所以,编译最新的u-boot应该用比较新的交叉编译工具链,否则会出现很诡异的问题。