View source for Flashing the Neo FreeRunner

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:

Template used on this page:

Return to Flashing the Neo FreeRunner.

Personal tools

Openmoko regularly releases updated versions of the Openmoko root filesystem, the kernel, and the U-Boot as binary images. These may be programmed into the Flash memory of Neo FreeRunner. You can use the USB cable and Openmoko provided tool to flash Neo FreeRunner.

NOTE: The Openmoko software team builds images daily. If you want to use the latest images, you can download the image from the daily build, but we recommend you use the most stable image from http://downloads.openmoko.org/releases/Freerunner/. Images here have been tested by the test team.


Overview

All the components of the software in the FreeRunner are bundled together into binary images.

The bootloader is a small program that runs first when the FreeRunner is powered on or reset. The kernel is the central component in the Linux operating system. The root filesystem contains all the files that make up the commands and applications that you can run.

On a desktop computer when you want to replace the operating system, you would boot it from a CD-ROM drive, then copy files from the CD to the internal hard drive.

The FreeRunner does not have a CD-ROM drive but it does have two kinds of internal program storage: NOR flash and NAND flash. The NOR flash is small and stores only a special boot program used when you need to re-write the contents of the NAND flash. NAND flash acts more like a hard drive.

The NAND Flash is divided into 3 partitions so that you can flash each component separately. For example if you are trying to install a better kernel, you only have to follow the steps to flash the kernel image.

The FreeRunner can also boot from an image in its micro SD card but that option is not covered here. See Booting from SD for more information.

Before you start: Erasing the root filesystem or flashing the uboot are radical measures. Take the time to ponder the necessity. Sometimes problems can be fixed by updating only the kernel.

The steps to reflash NAND are

  1. Collect everything you need together on your desktop computer. This includes the dfu-util program and the images you will load into the FreeRunner and a USB cable.
  2. Boot the FreeRunner from NOR Flash.
  3. Connect the FreeRunner to the desktop computer via the USB cable.
  4. Use dfu-util to backup the current contents of the FreeRunner.
  5. Use dfu-util to copy the images from the desktop into the FreeRunner.
  6. Boot the FreeRunner from NAND Flash to use the new image(s).

Collect the things you need

Download the DFU-util program

There are versions of dfu-util for both Linux and Windows. It works the same way on both platforms.

Linux You can download the flashing tool for a GNU/Linux host from: http://downloads.openmoko.org/releases/Freerunner/dfu-util

Make sure it is executable by setting the permissions with this command: chmod a+x dfu-util

Windows You can download the flashing tool for a Windows host from: http://projects.openmoko.org/frs/?group_id=166&release_id=162

See additional installation instructions for Windows at Dfu-util-windows

Download the image files that you will need

Exactly what files you need depends on what you are trying to install. Here are some pages you can refer to for more information.

Edit request -- Some comments on why you'd want to replace each component could go here. For example you probably don't want to replace the bootloader unless there are bug fixes you really need.

Bootloader

Kernel You can download kernels from http://downloads.openmoko.org/releases/Freerunner/

You can download the standard Openmoko root filesystem from http://downloads.openmoko.org/releases/Freerunner/ or you can see more options at Distributions and Latest_Images

If you download a Qtopia image, you will get a tarball file containing both the Qtopia root filesystem and a matching kernel. You can unpack them with the tar command, for example: tar xzvf qtopia.tgz

If you download an FSO image, the file system will be in a jffs2 'summary' file.

Boot the FreeRunner from NOR Flash

Booting from NOR Flash

The Neo FreeRunner needs to be at the NOR uBoot menu for flashing. For more information on booting, see booting the Neo Freerunner (in short: press and hold aux down and then press power button).

Log into the NOR uBoot menu and just stay there, do not select or enter any item in menu. Now you will be able to flash, make backups of your Freerunner or query the Freerunner with dfu-util.

Once the FreeRunner is at the NOR boot menu, you can connect your Neo to the GNU/Linux or Windows host via USB cable.


Do a backup

If you have a working image that you're happy with but want to try something different, you should probably do a Pre-Flash Backup, although it looks like the method on that page may not entirely work.

Is this still true? 7/31/08??

Using dfu-util

dfu-util can be used to read flash memory, write memory, and get information from the device.

This is the general command format to write an image file to a (predefined) "partition name" (referred to as altsetting in dfu-util help/manual) :

dfu-util -a altsetting -R -D file name

where:
-a altsetting : Specify the altsetting of the DFU interface by name or by number
-R  : Issue USB Reset signalling once we're finished
-D file name : Write firmware from file name into device

On Linux, you run dfu-util from a command shell prompt. If you have not put it somewhere on your command path you probably need to prefix it with a "./" like this ./dfu-util. On some systems you need to be root before this will work and on Ubuntu you must preface the command with "sudo" or you will get the following error: "Cannot claim interface: could not claim interface 2: Operation not permitted"

On Windows, you need to open a command window and run from a command line. Use Start-Run Program and type "cmd" to open a Window.

Flashing the Kernel

The command format is

dfu-util -a kernel -R -D kernel filename

When flashing succeeds the following will be shown:

status(0) = No error condition is present
Done!

Flashing the Root Filesystem

Caveat -- do you really need to do this? You will be losing any changes you have made, such as settings for networking. If you have added packages they will be gone and you will have to re-install them.

The root filesystem has to be an image in jffs2 format. If the file you downloaded is zipped or compressed (has a .gz or .zip extension) you have to uncompress it first.

The command format is

dfu-util -a rootfs -R -D rootfs_filename.jffs2

where rootfs_filename.jffs2 is the name of the file containing the root filesystem.

When flashing succeeds the following will be shown:

status(0) = No error condition is present
Done!

Flashing the boot loader

Caveat - Do you really need to do this?

The boot loader (U-boot) file should have a .bin extension. As with the root filesystem, if the file you downloaded is zipped or compressed (has a .gz or .zip extension) you have to uncompress it first.

The command format is

dfu-util -a u-boot -R -D uboot.bin

where uboot.bin is the name of the boot loader binary image file.

Reboot the FreeRunner

You should now be able to boot into the new images.