About WRTnode :) RT5350 vs MT7620

看来最近开源硬件确实挺火,深圳的创客们搞出来个WRTnode,基本理念和我不谋而合。我们用的都是OpenWrt系统,这样软件都可以共用。
其实我开始时也想用MT7620做设计,但是我最后由于以下几点原因否决了。
1.成本高,芯片是RT5350的一倍多,内存芯片价格也略高。
我希望做开源的东西,能以最低的门槛,做最大众化的东西。记得十年前,我上大学时从淘宝买到一块60块钱的二手8051实验板时的快乐,希望这样的快乐能更多的传递下去。
2.用的是DDR2,线很难布。
DDR2的频率比较高(>200MHz),MT7620在内存和芯片间需要匹配阻抗。这样就导致了板子不能做的小,而且由于阻抗的存在,成本也会难以控制。WRTnode做到了40×30,虽然没有VoCore小,但我相信这基本是MT7620的极限了,而VoCore则不然,如果舍得成本,换成BGA封装的SDRAM内存,体积和功耗还可以进一步减小。
3.多余的性能性价比不高。
多余的CPU性能比较鸡肋,360MHz足够处理应用,580MHz实际性能比它快不了多少,基本可以说360MHz干不了的580MHz也干不了。
DDR2速度没有用处,瓶颈在总线速度上,不能完全发挥DDR2的速度。

WRTnode的优势:
1. 功耗低,MT7620运行电流是140mA左右,RT5350是200mA,同时带来的好处是发热大大减小。我粗略计算一下,考虑到多种因素,MT7620比RT5350节能20%~30%.
2. 速度快,MT7620的CPU可以运行在580MHz, RT5350是360MHz。
3. 支持内存大,MT7620的DDR2单片最小都是64MB,而SDRAM最大只有32MB,64MB还得接两片。
4. 双天线设计,这个真的很好,可以发挥出802n的最大威力,必须赞。

VoCore的优势:
1. 价格便宜,成本只有MT7620解决方案的1/2到1/3.
2. 体积小,体积只有WRTnode的三分之一,WRTnode核心板5×4.5=22.5平方厘米,VoCore是2.4×2.45=5.88平方厘米.
3. 容易扩展,GPIO多,导出了RT5350所有的GPIO,一共22个,还有JTAG,USB,I2C,I2S,PCM,网线,串口,一个都不少.
4. 支持多种电源电压,用3.3V~6V供电都可以,可以方便的使用锂电池供电不需要转换.

WRTnode设计上值得我学习的:
1. 导出了SPI的接口。
这个设计我没有考虑到,有这个接口确实很方便,省了60块买flash刷写夹具的钱。
这个是夹具链接,给他们做个广告http://item.taobao.com/item.htm?spm=a230r.1.14.1.6HxkOH&id=36799806985&_u=f40cgkm9c63
2. 接口都是2mm的插孔
我做出了24mm的半孔版后,觉得半孔虽然减小了很大的体积(0.5平方厘米),但是焊接,接插都很不方便,很容易把半孔铜皮弄坏。2mm的插孔只要插上标准的杜邦线就行了,适合做实验。在下一版我会改进,使用完整插孔,由于板子面积有限,使用标准间距1.27mm,做下来的板子应该是990milx990mil(25.146mm)=6.33平方厘米

WRTnode我要吐槽的:
1. 导出的网线太多了。
这是做智能设备控制又不是做路由,把5个网线接口都导出来,至少两个口基本一辈子都不会用到。平空增加布线复杂度。这样可能会不得不在中间电源层布线,而这样的布线会对信号层有很大干扰,特别是DDR2本来就是高频,网线口的速度也是100MHz以上的,这样的板子可能会不稳定。我在做5350的时候虽然最高只有166MHz也是小心翼翼的,绝不敢在电源层走线(别看VoCore小,只在top和bottom走线),高频尽量3W实在不行2W。串扰模拟时按1GHz,3.3V得出最大串扰电压<100mV,应该还算稳定。
2. 买不到……
这板子想搞个研究下,可惜哪都没卖的,是卖的太好么……郁闷,不过淘宝上其他的MT7620的开发板倒是很多。

最后,好久没有写中文博客,多说一句:
我坚信,不远的未来我们只需要通用的硬件,而功能都由软件实现。VoCore就是为了实践此而诞生的。

Wifi is not working on two of my boards 5(final)

That problem is confirmed, it is caused by “factory setting” area(0x00040000-0x00050000).

I get the bug flash and normal flash, compare the two, get the following result.

BUG BOARD:
< 00040000  FF FF FF FF FF FF FF FF  FF FF FF FF FF FF FF FF
< 00040020  FF FF FF FF FF FF FF FF  FF FF FF FF FF FF FF FF
< 00040030  FF FF FF FF FF FF FF FF  FF FF FF FF FF FF FF FF
< 00040040  FF FF FF FF FF FF FF FF  FF FF FF FF FF FF FF FF
< 00040050  FF FF FF FF FF FF FF FF  FF FF FF FF FF FF FF FF
< 00040070  FF FF FF FF FF FF FF FF  FF FF FF FF FF FF FF FF
< 000400D0  FF FF FF FF FF FF FF FF  FF FF FF FF FF FF FF FF
< 000400E0  FF FF FF FF FF FF FF FF  FF FF FF FF FF FF FF FF 
< 00040120  FF FF FF FF FF FF FF FF  FF FF FF FF FF FF FF FF 
NORMAL BOARD:
> 00040000  50 53 00 01 00 0C 43 30  50 C8 FF FF FF FF FF FF  
> 00040020  FF FF FF FF FF FF FF FF  00 0C 43 30 50 77 00 0C  
> 00040030  43 30 50 66 11 FF 24 28  FF FF 2B 01 55 77 A8 AA  
> 00040040  8C 88 FF FF 0C 00 00 00  00 00 00 00 00 00 FF FF  
> 00040050  FF FF 0A 0A 0A 0A 0A 0A  0A 0A 0A 0A 0A 0A 0B 0B  
> 00040070  FF FF FF FF FF FF 03 80  FF FF FF FF FF FF FF FF   
> 000400D0  FF FF FF FF FF FF FF FF  FF FF FF FF FF FF 66 66  
> 000400E0  CC AA 88 66 CC AA 88 66  CC AA 88 66 CC AA 88 66   
> 00040120  81 09 1C 13 4F 15 4F 15  03 1D 07 1D FF FF FF FF

I guess this data(about 512 bytes) should be same data format in EEPROM. The bug one can not load mac address because in this area it is all invalid/empty(0xFF).

I am right again:

this is EEPROM from RT5350 official SDK.(0xFF lines deleted, 512bytes)

ADDRESS   +0 +1 +2 +3 +4 +5 +6 +7  +8 +9 +A +B +C +D +E +F
00000000  50 53 00 01 00 0C 43 30  50 58 FF FF FF FF FF FF
00000020  FF FF FF FF FF FF FF FF  00 0C 43 30 50 77 00 0C
00000030  43 30 50 66 11 FF 24 28  FF FF 2B 01 55 77 A8 AA
00000040  8C 88 FF FF 0C 00 00 00  00 00 00 00 00 00 FF FF
00000050  FF FF 0A 0A 0A 0A 0A 0A  0A 0A 0A 0A 0A 0A 0B 0B
00000070  FF FF FF FF FF FF 03 80  FF FF FF FF FF FF FF FF 
000000D0  FF FF FF FF FF FF FF FF  FF FF FF FF FF FF 66 66
000000E0  CC AA 88 66 CC AA 88 66  CC AA 88 66 CC AA 88 66
00000120  03 09 1C 13 4F 15 4F 15  03 1D 07 1D FF FF FF FF

This is another EEPROM in SDK.

ADDRESS   +0 +1 +2 +3 +4 +5 +6 +7  +8 +9 +A +B +C +D +E +F
00000000  50 53 00 01 00 0C 43 30  50 58 FF FF FF FF FF FF 
00000020  FF FF FF FF FF FF FF FF  00 0C 43 30 50 77 00 0C 
00000030  43 30 50 66 11 FF 24 30  FF FF 2B 01 55 77 A8 AA 
00000040  8C 88 FF FF 0C 00 00 00  00 00 00 00 00 00 FF FF 
00000050  FF FF 0A 0A 0A 0A 0A 0A  0A 0A 0A 0A 0A 0A 0B 0B
00000070  FF FF FF FF FF FF 03 80  FF FF FF FF FF FF FF FF
000000D0  FF FF FF FF FF FF FF FF  FF FF FF FF FF FF 66 66
000000E0  CC AA 88 66 CC AA 88 66  CC AA 88 66 CC AA 88 66
00000120  03 09 1C 13 4F 15 4F 15  03 1D 07 1D FF FF FF FF

So, the factory setting is necessary and important, looks like some driver are reading that when the board boot up.

After copy 512 bytes data to its location at flash 0x00040000, everything works again. 😀

Wifi is not working on two of my boards 4

I find the problem…That is system problem.

After I update openwrt back to old version, all my five bug boards work well. T-T, spend me a lot of time to catch that bug.

That is why my first board work. I think after I copy openwrt to my first board I just run “git pull & make”…

But on the log, both of them are OpenWrt R39957. So it is not version problem. HWAddr is load from FLASH factory area, maybe it is that problem. If I erase the flash, all data will set to 0xFFFFFFFF, same as the wrong HWAddr FF:FF:FF:FF:FF:FF. Just a guess, need time to check.

VoCore Output Interface

VoCore v0.3~v0.4:

Screen Shot 2014-04-03 at 17.59.06

TOP (from left to right)
PN03: +3.3V~+6.0V(USB +5.0V or Li-Battery 3.7V), POWER
PN04: GND, POWER
PN05: B11, JTAG_TDO, GPIO
PN06: A11, JTAG_TRST_N, GPIO
PN07: A12, JTAG_TCLK, GPIO
PN08: A13, JTAG_TMS, GPIO
PN09: B12, GPIO0
PN10: A14, JTAG_TDI, GPIO
PN11: B13, I2C_SD, GPIO
PN12: B14, I2C_SCLK, GPIO
 

LEFT (from top to bottom)
PN23: +1.8V, OUTPUT POWER, max 600mA
PN22: J4, DCD_N, UARTFULL, GPIO
PN21: K4, CTS_N, UARTFULL, GPIO
PN20: K3, EPHY_LED0, GPIO, GPIO
PN19: K2, TXD, UARTFULL, GPIO
PN18: L1, EPHY_LED1, GPIO
PN17: L3, DSR_N, UARTFULL
PN16: L4, EPHY_LED2, GPIO
PN15: M1, EPHY_LED3, GPIO
PN14: M3, RIN, UARTFULL, GPIO
PN13: M4, EPHY_LED4, GPIO
 

BOTTOM (from left to right)
PN24: N2, TXD2, UARTLITE, GPIO
PN25: P2, RTS_N, UARTFULL, GPIO
PN26: N3, RXD, UARTFULL, GPIO
PN27: P3, RXD2, UARTLITE, GPIO
PN28: N4, DTR_N, UARTFULL, GPIO
PN29: N5, EPHY_TXN_P0
PN30: P5, EPHY_TXP_P0
PN31: M5, EPHY_RXP_P0
PN32: L5, EPHY_RXN_P0
PN33: P9, EPHY_RXP_P4
PN34: L9, EPHY_TXP_P4
PN35: N9, EPHY_RXN_P4
PN36: M9, EPHY_TXN_P4
PN37: GND, POWER
PN38: GND, POWER
PN39: N12, UPHY0_PADM, USB
PN40: P12, UPHY0_PADP, USB
PN41: +3.3V, POWER
PN42: +3.3V, POWER

Power must connect to PN03/PN41&PN42. PN03 input voltage is +3.3V~6.0V, PN41/PN42 is 3.3V. If PN03 is connected, PN41/PN42 is able to output +3.3V power, current is about 500mA(3.3V->PN03), 750mA(5.0V->PN03).

New simple file transfer application for LAN

I find it is very tedious when I  send file from my pc to my board.

The shortest command is scp, but it is not short.

I have to write something like this:

scp 192.168.x.x:someplace/somefile ./somefile

then, input password every time.

I hate that, it is a waste of time.

Another problem is it is hard to transfer file from my windows pc to that board or my linux pc… Best way is to use ftp, but on my board the memory is limited and precious, ftpd will take a lot of memory and never return them. I need some cross platform tools.

So after some struggle, I write a simple application. I called it “wolf”. 🙂 And its real name is vof.

To send one file, it is easy to use:

vof ./somefile

it will show four number code, such as “1234”.
and to get this file, just call this command on the other pc:

vof 1234

then the file is copied into that position through local network safely.

source code: http://vonger.cn/upload/vof.c
linux(x86): http://vonger.cn/upload/vof.unx
linux(mips):http://vonger.cn/upload/vof.voc
macos(x86):http://vonger.cn/upload/vof.mac
windows(x86):http://vonger.cn/upload/vof.exe

memory check:
macos: 308KB
windows: 1.6M
linux(x86): 0.2M
linux(mips): 116KB(without upx compress: 88KB)

openwrt do not support get memory usage, just used a trick, run vof, then call “free” or “cat /proc/meminfo”, kill vof then call “free” again, one is 10888KB, one is 11004KB, so vof takes about 116KB.

 

Clock test: which C clock is the fastest?

In one of my application it gets timer a lot of times, so I must make sure which timer is faster.

I tested three common timer functions:
gettimeofday() (in windows we use GetLocalTime())
clock() (in windows we use GetTickCount())
time()

I tested them under unix/linux, each function called 1e6(1M or 1000k) times.

Result on my unix computer:

test_gettimeofday()  42.40ms
test_clock()        344.27ms
test_time()         183.65ms

Result on my Linux VPS:

test_gettimeofday() 190.00ms
test_clock()        320.00ms
test_time()         160.00ms

Result on my VoCore v0.3 (RT5350F MIPS 360MHz) board: ( it is slow 😀 )

test_gettimeofday() 1370.00ms
test_clock()        1800.00ms
test_time()         520.00ms

On my board, time() win, that is out of my expectation. OpenWrt are using uLibC but not glibC whose time() is calling gettimeofday(). uLibC must be using some other way.

But for average result, looks like gettimeofday() is the winner 🙂

source code download link: http://vonger.cn/upload/clock.c

 

Client mode(station mode) for VoCore

Test the two bug boards is so boring… No good news. After that I decide to test some new feature: client mode.

It is easy to setup OpenWrt to client mode. It connected to my home router VongerWifi.

We need to change two files.

One is /etc/config/wireless:

config wifi-device 'radio0'
        option type 'mac80211'
        option channel 'auto'
        option hwmode '11ng'
        option path '10180000.wmac'
        list ht_capab 'GF'
        list ht_capab 'SHORT-GI-20'
        list ht_capab 'SHORT-GI-40'
        list ht_capab 'RX-STBC1'
        option htmode 'HT20'

config wifi-iface
        option device 'radio0'
        option network 'wwan'
        option mode 'sta'
        option ssid 'VongerWifi'
        option encryption 'psk2'
        option key 'passwordforwifi'

add two line after /etc/config/network to enable get ip address from your home router.

config interface wwan
        option proto 'dhcp'

restart network by this script.

/etc/init.d/network restart
wifi up

Now the board shows this:

[  555.840000] wlan0: deauthenticating from 0c:82:68:24:84:86 by local choice (reason=3)
[  556.740000] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  558.510000] wlan0: authenticate with 0c:82:68:24:84:86
[  558.550000] wlan0: send auth to 0c:82:68:24:84:86 (try 1/3)
[  558.560000] wlan0: authenticated
[  558.580000] wlan0: associate with 0c:82:68:24:84:86 (try 1/3)
[  558.590000] wlan0: RX AssocResp from 0c:82:68:24:84:86 (capab=0x431 status=0 aid=4)
[  558.610000] wlan0: associated
[  558.610000] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

The client mode is working now.

root@OpenWrt:/etc/config# ping -c5 vonger.cn
PING vonger.cn (209.148.85.252): 56 data bytes
64 bytes from 209.148.85.252: seq=0 ttl=46 time=347.934 ms
64 bytes from 209.148.85.252: seq=1 ttl=46 time=347.951 ms
64 bytes from 209.148.85.252: seq=2 ttl=46 time=352.602 ms
64 bytes from 209.148.85.252: seq=3 ttl=46 time=259.923 ms
64 bytes from 209.148.85.252: seq=4 ttl=46 time=269.081 ms
--- vonger.cn ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 259.923/315.498/352.602 ms

Addition:

I find I can not ping from my board to my computer, and my computer can not ping board. That is not firewall problem. I find that is route problem.

root@OpenWrt:/etc/config# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         OpenWrt.lan     0.0.0.0         UG    0      0        0 wlan0
192.168.1.0     *               255.255.255.0   U     0      0        0 br-lan
192.168.1.0     *               255.255.255.0   U     0      0        0 wlan0

There should be a default gateway to 192.168.1.1 which is my router.

route add 192.168.1.0 gw 192.168.1.1

After this, it still does not work.
use ifconfig, I find the problem, br-lan already take 192.168.1.1. Just turn off it.

ifconfig br-lan down

Now, my computer is able to ping the VoCore board and VoCore board is able to ping the computer. Everything works great.

Wifi is not working on two of my boards 3

I have some tests on the bug boards today.

Address can not be assigned because of HWAddr is not correct. HWAddr is hardware mac address.

root@OpenWrt:/# ifconfig -a
br-lan Link encap:Ethernet HWaddr 46:9B:94:0A:E6:71 
 inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
 inet6 addr: fe80::449b:94ff:fe0a:e671/64 Scope:Link
 inet6 addr: fd79:c06e:e417::1/60 Scope:Global
 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:0 
 RX bytes:0 (0.0 B) TX bytes:1268 (1.2 KiB)
eth0 Link encap:Ethernet HWaddr FF:FF:FF:FF:FF:FF 
 BROADCAST MULTICAST MTU:1500 Metric:1
 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:1000 
 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
 Interrupt:5
eth0.1 Link encap:Ethernet HWaddr FF:FF:FF:FF:FF:FF 
 BROADCAST MULTICAST MTU:1500 Metric:1
 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:0 
 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
eth0.2 Link encap:Ethernet HWaddr FF:FF:FF:FF:FF:FF 
 BROADCAST MULTICAST MTU:1500 Metric:1
 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:0 
 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback 
 inet addr:127.0.0.1 Mask:255.0.0.0
 inet6 addr: ::1/128 Scope:Host
 UP LOOPBACK RUNNING MTU:65536 Metric:1
 RX packets:146 errors:0 dropped:0 overruns:0 frame:0
 TX packets:146 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:0 
 RX bytes:9888 (9.6 KiB) TX bytes:9888 (9.6 KiB)
wlan0 Link encap:Ethernet HWaddr 46:9B:94:0A:E6:71 
 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:1000 
 RX bytes:0 (0.0 B) TX bytes:1540 (1.5 KiB)

It is FF:FF:FF:FF:FF:FF

eth0 Link encap:Ethernet HWaddr FF:FF:FF:FF:FF:FF

Use ifconfig to setup that address and bring up eth0 success.

ifconfig eth0 hw ether 46:9B:94:0A:E6:71
ifconfig eth0 192.168.1.100 netmask 255.255.255.0 up
ifconfig eth0.1 hw ether 46:9B:94:0A:E6:71
ifconfig eth0.1 192.168.1.101 netmask 255.255.255.0 up
ifconfig eth0.2 hw ether 46:9B:94:0A:E6:71
ifconfig eth0.2 192.168.1.102 netmask 255.255.255.0 up

And now in ifconfig ethernets are all up.

ifconfig wlan0 192.168.1.103 netmask 255.255.255.0

setup ip for wlan0.

root@OpenWrt:/# ifconfig
br-lan Link encap:Ethernet HWaddr 46:9B:94:0A:E6:71 
 inet6 addr: fe80::449b:94ff:fe0a:e671/64 Scope:Link
 inet6 addr: fd79:c06e:e417::1/60 Scope:Global
 UP BROADCAST MULTICAST MTU:1500 Metric:1
 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:0 
 RX bytes:0 (0.0 B) TX bytes:1458 (1.4 KiB)
eth0 Link encap:Ethernet HWaddr 46:9B:94:0A:E6:71 
 inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
 inet6 addr: fe80::449b:94ff:fe0a:e671/64 Scope:Link
 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 TX packets:46 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:1000 
 RX bytes:0 (0.0 B) TX bytes:15958 (15.5 KiB)
 Interrupt:5
eth0.1 Link encap:Ethernet HWaddr 46:9B:94:0A:E6:71 
 inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:0 
 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
eth0.2 Link encap:Ethernet HWaddr 46:9B:94:0A:E6:71 
 inet addr:192.168.1.102 Bcast:192.168.1.255 Mask:255.255.255.0
 inet6 addr: fe80::449b:94ff:fe0a:e671/64 Scope:Link
 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 TX packets:42 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:0 
 RX bytes:0 (0.0 B) TX bytes:15342 (14.9 KiB)
lo Link encap:Local Loopback 
 inet addr:127.0.0.1 Mask:255.0.0.0
 inet6 addr: ::1/128 Scope:Host
 UP LOOPBACK RUNNING MTU:65536 Metric:1
 RX packets:4468 errors:0 dropped:0 overruns:0 frame:0
 TX packets:4468 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:0 
 RX bytes:303744 (296.6 KiB) TX bytes:303744 (296.6 KiB)
wlan0 Link encap:Ethernet HWaddr 46:9B:94:0A:E6:71 
 inet addr:192.168.1.103 Bcast:192.168.1.255 Mask:255.255.255.0
 UP BROADCAST MULTICAST MTU:1500 Metric:1
 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:1000 
 RX bytes:0 (0.0 B) TX bytes:1748 (1.7 KiB)

Now the ifconfig result is same as the normal one. But iw dev wlan0 scan has nothing returned, wireless module still dose not work.

Another try is to call:

/etc/init.d/firewall stop
/etc/init.d/firewall disable

firewall is stopped, still dose not work.

 

This bug is not easy to locate now. I guess this must have some connection with hardware, now I have to check the ethernet driver to see what will cause it failed to start. Lucky me still have one board work. It will be a long way to find out the problem.

Wifi is not working on two of my boards 2

After get out that RT5350F from the board, I find the solder is normal. Every ball touched its pad, so this might not be solder problem.

I have to check software again. Get boot log from normal board and the bug board again, compare the two.

 

normal one:

U-Boot 1.1.3 (Nov 26 2013 - 19:17:30)
Board: Ralink APSoC DRAM: 32 MB
relocate_code Pointer at: 81fb4000
******************************
Software System Reset Occurred
******************************
spi_wait_nsec: 42 
spi device id: ef 40 17 0 0 (40170000)
find flash: W25Q64BV
raspi_read: from:30000 len:1000 
.*** Warning - bad CRC, using default environment
============================================ 
Ralink UBoot Version: 4.0.0.0
-------------------------------------------- 
ASIC 5350_MP (Port5<->None)
DRAM_CONF_FROM: Boot-Strapping 
DRAM_TYPE: SDRAM 
DRAM_SIZE: 256 Mbits
DRAM_WIDTH: 16 bits
DRAM_TOTAL_WIDTH: 16 bits
TOTAL_MEMORY_SIZE: 32 MBytes
Flash component: SPI Flash
Date:Nov 26 2013 Time:19:17:30
============================================ 
icache: sets:256, ways:4, linesz:32 ,total:32768
dcache: sets:128, ways:4, linesz:32 ,total:16384
##### The CPU freq = 360 MHZ #### 
 estimate memory size =32 Mbytes
Please choose the operation: 
 1: Load system code to SDRAM via TFTP. 
 2: Load system code then write to Flash via TFTP. 
 3: Boot system code via Flash (default).
 4: Entr boot command line interface.
 7: Load Boot Loader code then write to Flash via Serial. 
 9: Load Boot Loader code then write to Flash via TFTP. 
 4 
You choosed 3
0 

3: System Boot system code via Flash.
## Booting image at bc050000 ...
raspi_read: from:50000 len:40 
. Image Name: MIPS OpenWrt Linux-3.10.32
 Created: 2014-03-20 13:56:37 UTC
 Image Type: MIPS Linux Kernel Image (lzma compressed)
 Data Size: 981825 Bytes = 958.8 kB
 Load Address: 80000000
 Entry Point: 80000000
raspi_read: from:50040 len:efb41 
............... Verifying Checksum ... OK
 Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80000000) ...
## Giving linux memsize in MB, 32
Starting kernel ...
[ 0.000000] Linux version 3.10.32 (vonger@debian) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.01 r39957) ) #3 Thu Mar 20 21:56:24 HKT 2014
[ 0.000000] SoC Type: Ralink RT5350 id:1 rev:3
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU revision is: 0001964c (MIPS 24KEc)
[ 0.000000] MIPS: machine is VoCore v0.3
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 02000000 @ 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x00000000-0x01ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x00000000-0x01ffffff]
[ 0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[ 0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128
[ 0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[ 0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Writing ErrCtl register=0007a400
[ 0.000000] Readback ErrCtl register=0007a400
[ 0.000000] Memory: 29356k/32768k available (2132k kernel code, 3412k reserved, 544k data, 200k init, 0k highmem)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS:256
[ 0.000000] CPU Clock: 360MHz
[ 0.000000] Calibrating delay loop... 239.61 BogoMIPS (lpj=1198080)
[ 0.070000] pid_max: default: 32768 minimum: 301
[ 0.070000] Mount-cache hash table entries: 512
[ 0.080000] pinctrl core: initialized pinctrl subsystem
[ 0.090000] NET: Registered protocol family 16
[ 0.130000] bio: create slab <bio-0> at 0
[ 0.140000] rt2880_gpio 10000600.gpio: registering 24 gpios
[ 0.150000] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[ 0.160000] Switching to clocksource MIPS
[ 0.170000] NET: Registered protocol family 2
[ 0.180000] TCP established hash table entries: 512 (order: 0, 4096 bytes)
[ 0.200000] TCP bind hash table entries: 512 (order: -1, 2048 bytes)
[ 0.210000] TCP: Hash tables configured (established 512 bind 512)
[ 0.220000] TCP: reno registered
[ 0.230000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.240000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.250000] NET: Registered protocol family 1
[ 0.260000] rt-timer 10000100.timer: maximum frequncy is 7324Hz
[ 0.310000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.330000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.350000] msgmni has been set to 57
[ 0.360000] io scheduler noop registered
[ 0.360000] io scheduler deadline registered (default)
[ 0.380000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[ 0.390000] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20) is a 16550A
[ 0.410000] console [ttyS0] enabled, bootconsole disabled
[ 0.410000] console [ttyS0] enabled, bootconsole disabled
[ 0.440000] m25p80 spi32766.0: found s25fl064k, expected gd25q64
[ 0.450000] m25p80 spi32766.0: s25fl064k (8192 Kbytes)
[ 0.460000] 4 ofpart partitions found on MTD device spi32766.0
[ 0.470000] Creating 4 MTD partitions on "spi32766.0":
[ 0.480000] 0x000000000000-0x000000030000 : "u-boot"
[ 0.500000] 0x000000030000-0x000000040000 : "u-boot-env"
[ 0.510000] 0x000000040000-0x000000050000 : "factory"
[ 0.530000] 0x000000050000-0x000000800000 : "firmware"
[ 0.540000] 0x00000013fb81-0x000000800000 : "rootfs"
[ 0.550000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[ 0.580000] mtd: device 4 (rootfs) set to be root filesystem
[ 0.590000] mtd: partition "rootfs_data" created automatically, ofs=0x360000, len=0x4a0000
[ 0.610000] 0x000000360000-0x000000800000 : "rootfs_data"
[ 0.630000] eth0: done loading
[ 0.640000] rt3xxx-usbphy ubsphy.3: loaded
[ 0.650000] rt2880_wdt 10000120.watchdog: Initialized
[ 0.660000] TCP: cubic registered
[ 0.670000] NET: Registered protocol family 17
[ 0.680000] 8021q: 802.1Q VLAN Support v1.8
[ 0.710000] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
[ 0.720000] Freeing unused kernel memory: 200K (8029e000 - 802d0000)
procd: Console is alive
procd: - watchdog -
procd: - preinit -
[ 7.100000] rt305x-esw 10110000.esw: link changed 0x00
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[ 8.220000] usbcore: registered new interface driver usbfs
[ 8.230000] usbcore: registered new interface driver hub
[ 8.240000] usbcore: registered new device driver usb
[ 8.260000] dwc_otg: version 2.72a 24-JUN-2008
jffs2 is ready
[ 10.910000] jffs2: notice: (260) jffs2_build_xattr_subsystem: complete building xattr subsystem, 1 of xdatum (0 unchecked, 0 orphan) and 11 of xref (0 dead, 0 orphan) found.
switching to jffs2
procd: - early -
procd: - watchdog -
procd: - ubus -
procd: - init -
Please press Enter to activate this console.
[ 14.730000] NET: Registered protocol family 10
[ 14.750000] l2tp_core: L2TP core driver, V2.0
[ 14.760000] l2tp_netlink: L2TP netlink interface
[ 14.780000] nf_conntrack version 0.5.0 (461 buckets, 1844 max)
[ 14.810000] ip6_tables: (C) 2000-2006 Netfilter Core Team
[ 14.850000] Loading modules backported from Linux version master-2014-01-23-0-g62c147d
[ 14.860000] Backport generated by backports.git backports-20140124-0-g1256d3e
[ 14.890000] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 14.960000] xt_time: kernel timezone is -0000
[ 15.020000] cfg80211: Calling CRDA to update world regulatory domain
[ 15.040000] cfg80211: World regulatory domain updated:
[ 15.050000] cfg80211: DFS Master region: unset
[ 15.050000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[ 15.070000] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 15.090000] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 15.100000] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[ 15.120000] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz), (300 mBi, 2000 mBm)
[ 15.130000] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (300 mBi, 2000 mBm)
[ 15.150000] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm)
[ 15.260000] PPP generic driver version 2.4.2
[ 15.280000] NET: Registered protocol family 24
[ 15.330000] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 5350, rev 0500 detected
[ 15.350000] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 5350 detected
procd: - init complete -
[ 29.350000] device eth0.1 entered promiscuous mode
[ 29.360000] device eth0 entered promiscuous mode
[ 29.380000] br-lan: port 1(eth0.1) entered forwarding state
[ 29.390000] br-lan: port 1(eth0.1) entered forwarding state
[ 30.470000] IPv6: ADDRCONF(NETDEV_CHANGE): eth0.1: link becomes ready
[ 31.390000] br-lan: port 1(eth0.1) entered forwarding state
[ 32.790000] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 32.800000] device wlan0 entered promiscuous mode
[ 32.840000] br-lan: port 2(wlan0) entered forwarding state
[ 32.850000] br-lan: port 2(wlan0) entered forwarding state
[ 32.860000] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 34.850000] br-lan: port 2(wlan0) entered forwarding state

 

bug one:

U-Boot 1.1.3 (Feb 15 2014 - 15:46:39)
Board: Ralink APSoC DRAM: 32 MB
relocate_code Pointer at: 81fb4000
******************************
Software System Reset Occurred
******************************
spi_wait_nsec: 42 
spi device id: ef 40 17 0 0 (40170000)
find flash: W25Q64BV
raspi_read: from:30000 len:1000 
.*** Warning - bad CRC, using default environment
============================================ 
Ralink UBoot Version: 4.0.0.0
-------------------------------------------- 
ASIC 5350_MP (Port5<->None)
DRAM_CONF_FROM: Boot-Strapping 
DRAM_TYPE: SDRAM 
DRAM_SIZE: 256 Mbits
DRAM_WIDTH: 16 bits
DRAM_TOTAL_WIDTH: 16 bits
TOTAL_MEMORY_SIZE: 32 MBytes
Flash component: SPI Flash
Date:Feb 15 2014 Time:15:46:39
============================================ 
icache: sets:256, ways:4, linesz:32 ,total:32768
dcache: sets:128, ways:4, linesz:32 ,total:16384
##### The CPU freq = 360 MHZ #### 
 estimate memory size =32 Mbytes
Please choose the operation: 
 1: Load system code to SDRAM via TFTP. 
 2: Load system code then write to Flash via TFTP. 
 3: Boot system code via Flash (default).
 4: Entr boot command line interface.
 7: Load Boot Loader code then write to Flash via Serial. 
 9: Load Boot Loader code then write to Flash via TFTP. 
 3 
You choosed 3
0 

3: System Boot system code via Flash.
## Booting image at bc050000 ...
raspi_read: from:50000 len:40 
. Image Name: MIPS OpenWrt Linux-3.10.32
 Created: 2014-03-20 9:29:45 UTC
 Image Type: MIPS Linux Kernel Image (lzma compressed)
 Data Size: 981903 Bytes = 958.9 kB
 Load Address: 80000000
 Entry Point: 80000000
raspi_read: from:50040 len:efb8f 
............... Verifying Checksum ... OK
 Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80000000) ...
## Giving linux memsize in MB, 32
Starting kernel ...
[ 0.000000] Linux version 3.10.32 (vonger@debian) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.01 r39957) ) #1 Thu Mar 20 17:27:09 HKT 2014
[ 0.000000] SoC Type: Ralink RT5350 id:1 rev:3
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU revision is: 0001964c (MIPS 24KEc)
[ 0.000000] MIPS: machine is Poray X8
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 02000000 @ 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x00000000-0x01ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x00000000-0x01ffffff]
[ 0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[ 0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128
[ 0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[ 0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Writing ErrCtl register=0003afe0
[ 0.000000] Readback ErrCtl register=0003afe0
[ 0.000000] Memory: 29352k/32768k available (2132k kernel code, 3416k reserved, 544k data, 200k init, 0k highmem)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS:256
[ 0.000000] CPU Clock: 360MHz
[ 0.000000] Calibrating delay loop... 239.61 BogoMIPS (lpj=1198080)
[ 0.070000] pid_max: default: 32768 minimum: 301
[ 0.070000] Mount-cache hash table entries: 512
[ 0.080000] pinctrl core: initialized pinctrl subsystem
[ 0.090000] NET: Registered protocol family 16
[ 0.140000] bio: create slab <bio-0> at 0
[ 0.150000] rt2880_gpio 10000600.gpio: registering 24 gpios
[ 0.160000] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[ 0.170000] Switching to clocksource MIPS
[ 0.180000] NET: Registered protocol family 2
[ 0.190000] TCP established hash table entries: 512 (order: 0, 4096 bytes)
[ 0.210000] TCP bind hash table entries: 512 (order: -1, 2048 bytes)
[ 0.220000] TCP: Hash tables configured (established 512 bind 512)
[ 0.230000] TCP: reno registered
[ 0.240000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.250000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.260000] NET: Registered protocol family 1
[ 0.270000] rt-timer 10000100.timer: maximum frequncy is 7324Hz
[ 0.320000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.330000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.360000] msgmni has been set to 57
[ 0.370000] io scheduler noop registered
[ 0.370000] io scheduler deadline registered (default)
[ 0.390000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[ 0.400000] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20) is a 16550A
[ 0.420000] console [ttyS0] enabled, bootconsole disabled
[ 0.420000] console [ttyS0] enabled, bootconsole disabled
[ 0.450000] m25p80 spi32766.0: found s25fl064k, expected gd25q64
[ 0.460000] m25p80 spi32766.0: s25fl064k (8192 Kbytes)
[ 0.470000] 4 ofpart partitions found on MTD device spi32766.0
[ 0.480000] Creating 4 MTD partitions on "spi32766.0":
[ 0.490000] 0x000000000000-0x000000030000 : "u-boot"
[ 0.510000] 0x000000030000-0x000000040000 : "u-boot-env"
[ 0.520000] 0x000000040000-0x000000050000 : "factory"
[ 0.540000] 0x000000050000-0x000000800000 : "firmware"
[ 0.550000] 0x00000013fbcf-0x000000800000 : "rootfs"
[ 0.560000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[ 0.590000] mtd: device 4 (rootfs) set to be root filesystem
[ 0.600000] mtd: partition "rootfs_data" created automatically, ofs=0x360000, len=0x4a0000
[ 0.620000] 0x000000360000-0x000000800000 : "rootfs_data"
[ 0.640000] eth0: done loading
[ 0.650000] rt3xxx-usbphy ubsphy.3: loaded
[ 0.660000] rt2880_wdt 10000120.watchdog: Initialized
[ 0.670000] TCP: cubic registered
[ 0.680000] NET: Registered protocol family 17
[ 0.690000] 8021q: 802.1Q VLAN Support v1.8
[ 0.720000] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
[ 0.730000] Freeing unused kernel memory: 200K (8029e000 - 802d0000)
procd: Console is alive
procd: - watchdog -
procd: - preinit -
[ 8.180000] rt305x-esw 10110000.esw: link changed 0x00
[ 8.210000] usbcore: registered new interface driver usbfs
[ 8.230000] usbcore: registered new interface driver hub
[ 8.250000] usbcore: registered new device driver usb
ifconfig: SIOCSIFFLAGS: Cannot assign requested address
[ 8.270000] dwc_otg: version 2.72a 24-JUN-2008
[ 8.290000] leds-gpio gpio-leds.4: pins are not configured from the driver
sendto(): Network is unreachable
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
jffs2 is ready
[ 11.900000] jffs2: notice: (278) jffs2_build_xattr_subsystem: complete building xattr subsystem, 1 of xdatum (0 unchecked, 0 orphan) and 11 of xref (0 dead, 0 orphan) found.
switching to jffs2
ifconfig: SIOCSIFFLAGS: Cannot assign requested address
procd: - early -
procd: - watchdog -
procd: - ubus -
procd: - init -
Please press Enter to activate this console.
[ 15.690000] NET: Registered protocol family 10
[ 15.710000] l2tp_core: L2TP core driver, V2.0
[ 15.720000] l2tp_netlink: L2TP netlink interface
[ 15.740000] nf_conntrack version 0.5.0 (461 buckets, 1844 max)
[ 15.760000] ip6_tables: (C) 2000-2006 Netfilter Core Team
[ 15.800000] Loading modules backported from Linux version master-2014-01-23-0-g62c147d
[ 15.820000] Backport generated by backports.git backports-20140124-0-g1256d3e
[ 15.840000] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 15.920000] xt_time: kernel timezone is -0000
[ 15.970000] cfg80211: Calling CRDA to update world regulatory domain
[ 15.980000] cfg80211: World regulatory domain updated:
[ 15.990000] cfg80211: DFS Master region: unset
[ 16.000000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[ 16.020000] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 16.030000] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 16.050000] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[ 16.060000] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz), (300 mBi, 2000 mBm)
[ 16.080000] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (300 mBi, 2000 mBm)
[ 16.100000] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm)
[ 16.210000] PPP generic driver version 2.4.2
[ 16.220000] NET: Registered protocol family 24
[ 16.290000] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 5350, rev 0500 detected
[ 16.300000] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 5350 detected
procd: - init complete -
[ 30.220000] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[ 33.170000] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 33.180000] device wlan0 entered promiscuous mode
[ 33.220000] br-lan: port 1(wlan0) entered forwarding state
[ 33.230000] br-lan: port 1(wlan0) entered forwarding state
[ 33.240000] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 33.260000] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[ 35.230000] br-lan: port 1(wlan0) entered forwarding state

Here is that problem:

ifconfig: SIOCSIFFLAGS: Cannot assign requested address

eth0, eth0.1, eth0.2 can not bring up because of  “can not assign requested address”.