Freerunner

来自个人维基
2015年5月6日 (三) 20:43Hovercool讨论 | 贡献的版本

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航搜索

目录

一、安装dfu-util

http://wiki.openmoko.org/wiki/Dfu-util

(一)ubuntu可用apt-get命令直接安装(版本较老)

(二)下载源码自己编译(版本较新)

编译dfu-util时提示:

kaigo@kaigo-desktop:~/WD/fr/tools/dfu-util-0.7$ ./autogen.sh 
./autogen.sh: 2: autoreconf: not found

解决:

$:sudo apt-get install autoconf

或者按照openmoko wiki提示,直接安装下面这个软件(推荐):

$:sudo apt-get install libusb-dev autogen pkg-config autotools-dev autoconf automake 

(三)安装windows驱动

windows驱动(使用虚拟机也是必不可少的)见 http://wiki.openmoko.org/wiki/Dfu-util-windows 中 Preparing to use dfu-util 一节里面推荐了 Jungo(需付费)或用LibUSB-Win32为fr生成驱动文件:

 Vendor ID  Product ID  Description
 0x1d50     0x5119      USB Device


二、flashing freerunner

官方资料:

http://wiki.openmoko.org/wiki/Flashing_the_Neo_FreeRunner

(一)、下载img

如Om2009: http://downloads.openmoko.org/distro/testing/NeoFreerunner/

(二)、烧写img

1、按住AUX,再按住power直到出现uboot的菜单

2、连接usb线

3、执行烧写命令

 # Flash u-boot
 dfu-util -a u-boot -R -D /path/to/u-boot_image
 # Flash the kernel
 dfu-util -a kernel -R -D /path/to/uImage.bin
 # Flash the rootfs
 dfu-util -a rootfs -R -D /path/to/rootfs.jffs2

(三)、相关错误

在虚拟机(xp下用virtualbox安装ubuntu)和windows运行:

$dfu-util -a kernel -R -D uImage.bin

出错:

Resetting USB...
not at least 2 device changes found ?!?
Lost device after RESET?

http://wiki.openmoko.org/wiki/Manuals/Dfu-util中Troubleshooting notes一节列出了这类错误,让我们尝试重新插拔一下usb线,但尝试没有效果
后切换到ubuntu系统(如果没记错的话,应该就是切换了下系统:d),再运行上述命令:

$dfu-util -a kernel -R -D uImage.bin

提示错误:

 
dfu-util - (C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY

dfu-util does currently only support DFU version 1.0

Opening DFU USB device... ID 1d50:5119
Claiming USB DFU Runtime Interface...
Cannot claim interface 2: could not claim interface 2: Operation not permitted

最后一句让我怀疑是不是权限问题,以root执行:

$ sudo dfu-util -a kernel -R -D uImage.bin

还是提示出错:

 
dfu-util - (C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY

dfu-util does currently only support DFU version 1.0

Opening DFU USB device... ID 1d50:5119
Claiming USB DFU Runtime Interface...
Cannot set alt interface: could not set alt intf 2/0: Protocol error

就在这里卡了很久,在google搜索"could not set alt intf 2/0"发现这好像是libusb库里面的提示,由于当前dfu-util是使用apt-get直接安装的,难道是关联库有问题??

于是再回到 Dfu-util的页面,尝试编译使用上一节的方式重新编译dfu-util的源代码:

dfu-util-0.7$ ./autogen.sh

提示:

Can't exec "libtoolize": 没有那个文件或目录 at /usr/bin/autoreconf line 196.
Use of uninitialized value in pattern match (m//) at /usr/bin/autoreconf line 196.
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
...

于是安装:

$:sudo apt-get install libtool

再进行flashing, ok:

$ sudo dfu-util -a kernel -R -D uImage.bin
dfu-util - (C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY

dfu-util does currently only support DFU version 1.0

Opening DFU USB device... ID 1d50:5119
Claiming USB DFU Runtime Interface...
Determining device status: state = appIDLE, status = 0
Device really in Runtime Mode, send DFU detach request...
Resetting USB...
Opening USB Device...
Found Runtime: [0x1d50:0x5119] devnum=76, cfg=0, intf=0, alt=3, name="kernel"
Claiming USB DFU Interface...
Setting Alternate Setting #3 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Device returned transfer size 4096
bytes_per_hash=40078
Copying data from PC to DFU device
Starting download: [##################################################] finished!
state(2) = dfuIDLE, status(0) = No error condition is present
Done!