Dfu-util

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(Purpose)
(Mac: linkchg)
 
(143 intermediate revisions by 61 users not shown)
Line 1: Line 1:
== Purpose ==
+
{{Languages|Dfu-util}}
  
 
dfu-util is a program that implements the Host (PC) side of the [[USB DFU]] (Universal Serial Bus Device Firmware Upgrade) protocol.
 
dfu-util is a program that implements the Host (PC) side of the [[USB DFU]] (Universal Serial Bus Device Firmware Upgrade) protocol.
  
In the OpenMoko project, we use this program to communicate with our specially enhanced [[u-boot]] boot loader, which implements the DFU device side.
+
In the Openmoko project, we use this program to communicate with our specially enhanced [[U-Boot]], which implements the DFU device side.
  
Using dfu-util and your Neo1973, you can
+
Using dfu-util and your smartphone, you can
* transfer and flash partitions to [[NAND Flash]], such as
+
* transfer and flash [[Partitions|partitions]] in internal [[NAND Flash]].
** The Linux [[kernel]]
+
* transfer anything into RAM
** The root file system partition
+
** The splash screen partition
+
** The u-boot environment
+
** Last, but not least: The [[u-boot]] bootloader itself.
+
* transfer anything into Neo1973 RAM
+
 
** this can be used for fast development cycles of low-level code such as kernels without flashing them
 
** this can be used for fast development cycles of low-level code such as kernels without flashing them
* read out the current NAND partitions
+
* read out the current internal NAND [[Partitions|partitions]]
 
** this is an easy and efficient way of doing full backups of your phone
 
** this is an easy and efficient way of doing full backups of your phone
  
 
== Source Code ==
 
== Source Code ==
 +
Dfu-util is currently maintained at http://dfu-util.gnumonks.org/.
  
dfu-util can be found at http://svn.openmoko.org/trunk/src/host/dfu-util/
+
On Debian and Ubuntu, you'll need libusb-dev:
 +
sudo apt-get install libusb-dev autogen pkg-config autotools-dev autoconf automake
  
Binary packages will be made available as part of the regular [[OpenMoko]] builds
+
On Fedora you'll need libusb-devel and libusb-static:
 +
yum install libusb-devel libusb-static
  
== Phrasebook ==
+
On Gentoo you can:
 +
emerge -va openmoko-dfu-util
  
There's no full-fledged manual yet.  Instead, some examples:
+
You can check out and build the latest version of dfu-util using the following git command:<br>
 +
git clone git://git.openezx.org/dfu-util.git
 +
<br>
 +
cd dfu-util<br>
 +
./autogen.sh<br>
 +
./configure<br>
 +
make
  
=== Flashing the kernel ===
+
The resulting binary is dfu-util/src/dfu-util.
  
dfu-util -a 3 -t 4093 -D /path/to/uImage
+
== Binaries ==
  
=== Flashing the bootloader ===
+
Binary packages will be [http://downloads.openmoko.org/distro/releases/Om2008.9/dfu-util made available] as part of the regular Openmoko builds. Currently, there is a dfu-util for Linux/i386.
  
dfu-util -a 1 -t 4093 -D /path/to/u-boot.bin
+
You need to make the downloaded file (dfu-util) executable with:
 +
<pre>
 +
chmod +x dfu-util
 +
</pre>
 +
you can then run it with
 +
<pre>
 +
./dfu-util
 +
</pre>
 +
see below for full instructions.
  
=== Copying a kernel into RAM ===
+
=== Debian ===
 +
[http://packages.debian.org/dfu-util dfu-util 0.0+r4880-1 is packaged] for Debian ''>= lenny'', so can be installed with: <tt>apt-get install dfu-util</tt>
  
dfu-util -a 0 -t 4093 -D /path/to/uImage
+
=== Ubuntu ===
 +
[http://packages.ubuntu.com/dfu-util dfu-util 0.0+r4067-3.1 is packaged] for Ubuntu ''>= intrepid (8.10)'', so can be installed with: <tt>apt-get install dfu-util</tt>
  
Once this has finished, the kernel will be available at the default load address of 0x32000000 in Neo1973 RAM.
+
=== Slackware ===
 +
[http://downloads.sourceforge.net/slackfr-packs/dfu-util-svn4686-i686-1cfdev12.1.tgz dfu-util is packaged] for '''Slackware''' (12.1), so can be installed with: <tt>pkgtool</tt>
  
{{note|You cannot transfer more than 2MB of data into RAM using this method}}
+
A newer SlackBuild is also available on [http://slackbuilds.org/repository/13.1/system/dfu-util/ slackbuilds.org]
 +
 
 +
=== Arch Linux ===
 +
[http://aur.archlinux.org/packages.php?ID=21385 dfu-util is packaged] for Arch Linux, so can be installed with makepkg
 +
 
 +
=== openSuSE ===
 +
The links below install rpm packaged dfu-util in (open)SuSE :
 +
 
 +
[http://software.opensuse.org/ymp/home:worldcitizen/SLE_10/dfu-util.ymp 1-Click Install for SLE 10]
 +
 
 +
[http://software.opensuse.org/ymp/home:worldcitizen/SLE_11/dfu-util.ymp 1-Click Install for SLE 11]
 +
 
 +
[http://software.opensuse.org/ymp/home:worldcitizen/openSUSE_10.3/dfu-util.ymp 1-Click Install for openSuSE 10.3]
 +
 
 +
[http://software.opensuse.org/ymp/home:worldcitizen/openSUSE_11.0/dfu-util.ymp 1-Click Install for openSuSE 11.0]
 +
 
 +
[http://software.opensuse.org/ymp/home:worldcitizen/openSUSE_11.1/dfu-util.ymp 1-Click Install for openSuSE 11.1]
 +
 
 +
[http://software.opensuse.org/ymp/home:worldcitizen/openSUSE_Factory/dfu-util.ymp 1-Click Install for openSuSE Factory]
 +
 
 +
=== CentOS ===
 +
[http://download.opensuse.org/repositories/home:/worldcitizen/CentOS_5/ Centos 5]
 +
 
 +
=== Fedora ===
 +
[http://download.opensuse.org/repositories/home:/worldcitizen/Fedora_10/ Fedora 9]
 +
 
 +
[http://download.opensuse.org/repositories/home:/worldcitizen/Fedora_10/ Fedora 10]
 +
 
 +
=== Mandriva ===
 +
[http://download.opensuse.org/repositories/home:/worldcitizen/Mandriva_2008/ Mandriva 2008]
 +
 
 +
[http://download.opensuse.org/repositories/home:/worldcitizen/Mandriva_2009/ Mandriva 2009]
 +
 
 +
=== RHEL ===
 +
[http://download.opensuse.org/repositories/home:/worldcitizen/RHEL_5/ RHEL 5]
 +
 
 +
=== Gentoo ===
 +
DFU-Util is in the main tree under the name [http://packages.gentoo.org/package/app-mobilephone/openmoko-dfu-util openmoko-dfu-util].
 +
 
 +
=== Windows ===
 +
Currently, there is a largely untested binary for Win32 (see [[Dfu-util-windows]]). Windows users can refer to [[No_Linux]] for a more tested approach.
 +
 
 +
=== Mac ===
 +
Compiling dfu-util on Mac:
 +
* http://lists.openmoko.org/pipermail/community/2007-July/008438.html
 +
* [[User:SNMoore]]
 +
* [[MacOS_X#Flashing_to_your_device]]
 +
* [[Openmoko Flasher]] has a precompiled binary in the App bundle
 +
 
 +
== Manual ==
 +
 
 +
See [[Manuals/Dfu-util]]
 +
 
 +
== See also ==
 +
*[[Flashing the Neo 1973]]
 +
*[[Flashing the Neo FreeRunner]]
 +
 
 +
[[Category:Flashing Openmoko]]

Latest revision as of 19:24, 13 February 2012


dfu-util is a program that implements the Host (PC) side of the USB DFU (Universal Serial Bus Device Firmware Upgrade) protocol.

In the Openmoko project, we use this program to communicate with our specially enhanced U-Boot, which implements the DFU device side.

Using dfu-util and your smartphone, you can

  • transfer and flash partitions in internal NAND Flash.
  • transfer anything into RAM
    • this can be used for fast development cycles of low-level code such as kernels without flashing them
  • read out the current internal NAND partitions
    • this is an easy and efficient way of doing full backups of your phone

Contents

[edit] Source Code

Dfu-util is currently maintained at http://dfu-util.gnumonks.org/.

On Debian and Ubuntu, you'll need libusb-dev: sudo apt-get install libusb-dev autogen pkg-config autotools-dev autoconf automake

On Fedora you'll need libusb-devel and libusb-static: yum install libusb-devel libusb-static

On Gentoo you can: emerge -va openmoko-dfu-util

You can check out and build the latest version of dfu-util using the following git command:
git clone git://git.openezx.org/dfu-util.git
cd dfu-util
./autogen.sh
./configure
make

The resulting binary is dfu-util/src/dfu-util.

[edit] Binaries

Binary packages will be made available as part of the regular Openmoko builds. Currently, there is a dfu-util for Linux/i386.

You need to make the downloaded file (dfu-util) executable with:

chmod +x dfu-util

you can then run it with

./dfu-util

see below for full instructions.

[edit] Debian

dfu-util 0.0+r4880-1 is packaged for Debian >= lenny, so can be installed with: apt-get install dfu-util

[edit] Ubuntu

dfu-util 0.0+r4067-3.1 is packaged for Ubuntu >= intrepid (8.10), so can be installed with: apt-get install dfu-util

[edit] Slackware

dfu-util is packaged for Slackware (12.1), so can be installed with: pkgtool

A newer SlackBuild is also available on slackbuilds.org

[edit] Arch Linux

dfu-util is packaged for Arch Linux, so can be installed with makepkg

[edit] openSuSE

The links below install rpm packaged dfu-util in (open)SuSE :

1-Click Install for SLE 10

1-Click Install for SLE 11

1-Click Install for openSuSE 10.3

1-Click Install for openSuSE 11.0

1-Click Install for openSuSE 11.1

1-Click Install for openSuSE Factory

[edit] CentOS

Centos 5

[edit] Fedora

Fedora 9

Fedora 10

[edit] Mandriva

Mandriva 2008

Mandriva 2009

[edit] RHEL

RHEL 5

[edit] Gentoo

DFU-Util is in the main tree under the name openmoko-dfu-util.

[edit] Windows

Currently, there is a largely untested binary for Win32 (see Dfu-util-windows). Windows users can refer to No_Linux for a more tested approach.

[edit] Mac

Compiling dfu-util on Mac:

[edit] Manual

See Manuals/Dfu-util

[edit] See also

Personal tools

Purpose

dfu-util is a program that implements the Host (PC) side of the USB DFU (Universal Serial Bus Device Firmware Upgrade) protocol.

In the OpenMoko project, we use this program to communicate with our specially enhanced u-boot boot loader, which implements the DFU device side.

Using dfu-util and your Neo1973, you can

  • transfer and flash partitions to NAND Flash, such as
    • The Linux kernel
    • The root file system partition
    • The splash screen partition
    • The u-boot environment
    • Last, but not least: The u-boot bootloader itself.
  • transfer anything into Neo1973 RAM
    • this can be used for fast development cycles of low-level code such as kernels without flashing them
  • read out the current NAND partitions
    • this is an easy and efficient way of doing full backups of your phone

Source Code

dfu-util can be found at http://svn.openmoko.org/trunk/src/host/dfu-util/

Binary packages will be made available as part of the regular OpenMoko builds

Phrasebook

There's no full-fledged manual yet. Instead, some examples:

Flashing the kernel

dfu-util -a 3 -t 4093 -D /path/to/uImage

Flashing the bootloader

dfu-util -a 1 -t 4093 -D /path/to/u-boot.bin

Copying a kernel into RAM

dfu-util -a 0 -t 4093 -D /path/to/uImage

Once this has finished, the kernel will be available at the default load address of 0x32000000 in Neo1973 RAM.

NOTE: You cannot transfer more than 2MB of data into RAM using this method