View source for Dfu-util/fr

From Openmoko

Jump to: navigation, search

You do not have permission to edit this page, for the following reasons:

  • The action you have requested is limited to users in the group: Administrators.
  • You must confirm your email address before editing pages. Please set and validate your email address through your user preferences.

You can view and copy the source of this page:

Return to Dfu-util/fr.

Personal tools


WARNING: Dfu-util ne fonctionne pas correctement sur les architectures gros-boutistes (big-endian)


WARNING: Ne mettez pas à jour U-Boot si vous n'êtes pas sûr d'en avoir besoin


NOTE: Il est nécessaire de connecter le neo directement sans utiliser de hub USB. Avec un hub des problèmes peuvent apparaître en particulier lors de la réinitialisation USB.


Objectif

dfu-util est un programme qui sert à mettre à jour les logiciels des périphériques USB à partir d'un ordinateur via le protocole USB DFU (Universal Serial Bus Device Firmware Upgrade).

Dans le cadre du projet Openmoko, on utilise ce programme pour communiquer avec notre gestionnaire de démarrage u-boot qui intègre la partie complémentaire du protocole DFU.

En utilisant dfu-util et votre smartphone, vous pouvez :

  • transférer et mettre à jour des partitions de la mémoire flash interne NAND.
  • transférer n'importe quoi vers la mémoire RAM
    • cela peut être utilisé dans le cadre de cycles de développement rapide de code bas niveau comme les noyaux sans mettre à jour la mémoire flash
  • lire les partitions de la mémoire interne NAND
    • c'est un moyen facile et efficace d'effectuer des sauvegardes complètes de votre téléphone

Code source

En environnement Debian et Ubuntu, vous aurez besoin de libusb-dev :

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

En environnement Fedora vous aurez besoin de libusb-devel et libusb-static :

yum install libusb-devel libusb-static

En environnement Gentoo vous pouvez utiliser emerge avec openmoko-dfu-util une fois que vous l'aurez autorisé dans la liste de paquets :

echo "app-mobilephone/openmoko-dfu-util       **" >> /etc/portage/package.keywords
emerge -va app-mobilephone/openmoko-dfu-util

Vous pouvez télécharger et construire la dernière version de dfu-util avec les commandes subversion suivantes :

svn co http://svn.openmoko.org/trunk/src/host/dfu-util/
cd dfu-util
./autogen.sh
./configure
make

L'exécutable généré est dfu-util/src/dfu-util.

Exécutables

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.

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

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

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.

Compiling dfu-util on Mac:

Documentation de réference

To run dfu-util, you need to have /proc/bus/usb mounted and working. The terminal command "ls /proc/bus/usb" should return something similar to, "001 002 003 004 005 devices", it shouldn't be empty. If it is empty, use this command:

sudo mount -t usbfs usbfs /proc/bus/usb

You can permanently add it in your fstab so that it automatically mounts. You can use emacs to edit you fstab using the command "sudo emacs /etc/fstab -nw" in your terminal window. Add the below line to your fstab:

usbfs   /proc/bus/usb   usbfs   defaults


Avant d'utiliser dfu-util

You'll need to boot your phone into the NAND Boot Menu:

  • Ensure your phone is connected directly to the host computer by USB (not the USB-charger! :)
  • Ensure that you execute all dfu-util commands as root
  • Power off the phone
  • Hold down AUX
  • Press POWER until the Boot Menu appears

see also Booting the Neo FreeRunner

Options en ligne de commande

--help

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 <file>
  -D --download file            Write firmware from <file> into device
  -R --reset                    Issue USB Reset signalling once we're finished

--list

Using the --list option, you can list the available DFU capable devices, their configuration, interface and altsettings. Below is an example for a current Neo1973 phone in u-boot Runtime Mode

# ./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"

Below is an example for a current Neo1973 phone in u-boot DFU Mode

# ./dfu-util --list
dfu-util - (C) 2007 by Openmoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY

Found DFU: [0x1457:0x5119] devnum=16, cfg=0, intf=0, alt=0, name="RAM 0x32000000"
Found DFU: [0x1457:0x5119] devnum=16, cfg=0, intf=0, alt=1, name="u-boot"
Found DFU: [0x1457:0x5119] devnum=16, cfg=0, intf=0, alt=2, name="u-boot_env"
Found DFU: [0x1457:0x5119] devnum=16, cfg=0, intf=0, alt=3, name="kernel"
Found DFU: [0x1457:0x5119] devnum=16, cfg=0, intf=0, alt=4, name="splash"
Found DFU: [0x1457:0x5119] devnum=16, cfg=0, intf=0, alt=5, name="rootfs"

This shows you six interfaces, all in configuration 0 and interface 0, with altsetting 0...5, for RAM and each partition.

--device

You can specify the USB Vendor and Product ID of the device you want to program:

dfu-util --device 0x1457:0x5119

If you only have one standards-compliant DFU device attached to your PC, this is optional. However, as soon as you have multiple DFU devices, dfu-util will detect this and abort, asking you to specify which device it shall use.

--transfer-size

Specifies the size of each individual USB transfer. If you don't use it, the maximum possible size for your combination of host operating system and USB device is chosen (for optimal performance).

--download

download the given file into the device.

--upload

upload from the DFU device into the given file[name].

NOTE: Upload support is currently broken - #676


Commandes fréquemment utilisées

Pour l'instant, il n'y a pas de manuel à proprement parler. Mais vous pouvez utiliser les quelques exemples suivants :

Mettre à jour le rootfs

dfu-util -a rootfs -R -D /path/to/openmoko-devel-image.jffs2

Mettre à jour le noyau

dfu-util -a kernel -R -D /path/to/uImage

Mettre à jour le gestionnaire de démarrage

dfu-util -a u-boot -R -D /path/to/u-boot.bin

Mettre à jour l'image affichée au démarrage

dfu-util -a u-splash -R -D /path/to/splash.gz

see also Configuring_the_boot_splash_screens

Copier un noyau dans la RAM

dfu-util -a 0 -R -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


Notes de mise à jour

If during flashing of an image using dfu-util you're consistently getting an error -110 message, check that the size of the destination NAND partition is big enough to hold the image. For example the kernel partition is only 2 MB big by default and a kernel with debugging info compiled-in can often exceed this. It's possible to change the partition layout to enlarge a given partition and shrink other partitions but you have to remember to reflash all partitions whose start offset has changed afterwards. To adjust partitions layout use the mtdparts u-boot command.

If in turn you're facing errors in seemingly random places during the flashing of images, most likely the USB hub or cable through which your Neo1973 is connected, is of too poor quality. It is recommended that you always connect the phone directly to the host when using dfu-util.

If dfu-util reports a message like the following, before it starts flashing:
Resetting USB...
not at least 2 device changes found ?!?
Lost device after RESET?
retry the command - it should work on a second run.

If dfu-util complains about not being able to program the device while in runtime mode, do the following: while in the boot menu, remove the usb cable and insert it again. Depending on the version of uBoot it should display somewhere in the menu that it is now in DFU mode. Now dfu-util should be able to continue.

If dfu-util is too slow on Windows, that's a known bug. A suggestion is to run Linux on a virtual box. An full root image 97MB that is 776Mbit, the USB 1.1 on the Neo FreeRunner is capable of either 1.5 Mbit/s (Low-Speed) and 12 Mbit/s (Full-Speed). So flashing it should take less than 9 minutes with low speed and a bit more than a minute with full-speed. Plus transfer overhead, plus decompression on the Neo side.

Voir aussi