免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2761 | 回复: 0
打印 上一主题 下一主题

dfu-util [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-05-12 21:49 |只看该作者 |倒序浏览
(转载请保留作者信息和文章出处) 本文差不多算是翻译,英文原版请看
http://wiki.openmoko.org/wiki/Dfu-util
   
dfu-util是pc host端 usb dfu (usb device firmware upgrade)协议的实现,用这个程序可以和openmoko的uboot通信,这个uboot似乎被添加了一些东西,实现了手机端的usb dfu协议。
    用这个dfu-util可以:
    1、可以在手机上的nand flash划分分区
    2、传输任何东西到neo1973的ram中,尤其在底层代码的开发阶段,这个功能特别好用
    3、读取当前nand flash的分区,这样可以很方便的备份整个系统
dfu-util的源代码树在
http://svn.openmoko.org/trunk/src/host/dfu-util
编译之:./autogen.sh
       chmod +x configure.ac
       ./configure.ac
       make
       make install 搞定

在编译他之前,需要安装libusb-dev autogen pkg-config,预编译好的二进制文件在
http://downloads.openmoko.org/snapshots/2007.11/images/neo1973/
macos用户编译请参照
http://wiki.openmoko.org/wiki/Dfu-util

要使用dfu-util,需要挂载/proc/bus/usb目录,如果此目录无效(即/proc/bus/usb目录为空),请
添加 usbfs   /proc/bus/usb   usbfs   defaults到/etc/fstab中

dfu-util - (C) 2007 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY
Usage: dfu-util [options] ...
  -h --help                     Print this help message
  -V --version                  Print the version number
  -l --list                     List the currently attached DFU capable USB devices
  -d --device vendor:product    Specify Vendor/Product ID of DFU device
  -c --cfg config_nr            Specify the Configuration of DFU device
  -i --intf intf_nr             Specify the DFU Interface number
  -a --alt alt_nr               Specify the Altseting of the DFU Interface
  -t --transfer-size            Specify the number of bytes per USB Transfer
  -U --upload file              Read firmware from device into
  -D --download file            Write firmware from  into dfu-util - (C) 2007 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY
Usage: dfu-util [options] ...
  -h --help                     Print this help message
  -V --version                  Print the version number
  -l --list                     List the currently attached DFU capable USB devices
  -d --device vendor:product    Specify Vendor/Product ID of DFU device
  -c --cfg config_nr            Specify the Configuration of DFU device
  -i --intf intf_nr             Specify the DFU Interface number
  -a --alt alt_nr               Specify the Altseting of the DFU Interface
  -t --transfer-size            Specify the number of bytes per USB Transfer
  -U --upload file              Read firmware from device into
  -D --download file            Write firmware from  into device
  -R --reset                    Issue USB Reset signalling once we're finished
device
  -R --reset                    Issue USB Reset signalling once we're finished
使用dfu-util --list可以列出目前连接的dfu设备,和其相关信息,以下是一个例子# ./dfu-util --list
dfu-util - (C) 2007 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY
Found DFU Runtime: [0x1457:0x5119] devnum=0, cfg=0, intf=2, alt=0, name="USB Device Firmware Upgrade"
dfu-util  --device  0x1457:0x5119
指定设备的usb制造商和产品id,如果有多于一个的dfu设备连接到你的pc host,那么用这个参数来指定使用哪一个设备就很有必要了

dfu-util   --transfer-size
这个参数的意义我也没有理解,哪位好心人知道的,请给我留言

dfu-util   --download  将指定的文件下载到设备上

dfu-util   --upload  将设备上指定的文件上传到pc (此参数可能目前无法使用,大家可以自行尝试一下看看,好使了没有)
===================几个例子
刷rootfs:  dfu-util -a rootfs -R -D /path/to/openmoko-devel-image.jffs2
刷内核:    dfu-util -a kernel -R -D /path/to/uImage
刷bootloader: dfu-util -a u-boot -R -D /path/to/u-boot.bin
将一个内核复制到neo的ram中:
dfu-util -a 0 -R -D /path/to/uImage ,完成之后,内核就会处于neo的ram的启动地址0x32000000
处。但是注意的是,通过此方法,无法将大于2m的文件传输到ram中。


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/12679/showart_685721.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP