Table of Contents

Flash Memory

The camera is shipped with 64MByte flash memory. Earlier hardware revisions AA0905 and AB0905 are equipped with 32MByte. During migration from 32MB to 64MB cameras were equipped with 64MB flash memory although firmware versions could only use the lower 32MB. These cameras can be reformatted to 64MB if firmware versions 3.2.0 and later are installed. See this section on how to reformat flash from 32 to 64MB.

Partitions

The camera's flash memory (32 or 64Mbyte) is divided into several sections, called flash partitions. The partitioning is fixed and cannot be changed by the user. The partition table called FIS resides at the end of the flash and contains the actual address ranges for each individual partition. The following table lists available flash partitions:

Partition Name Address (64MB type) Address (32MB type) Description
/dev/mtd0 RedBoot 0×00000000-0×00040000 0×00000000-0×00040000 The RedBoot boot loader is flashed here (this partition is locked down).
/dev/mtd1 bootfpga 0×00080000-0×00100000 0×00080000-0×00100000 FPGA design for boot loader only (this partition is locked down).
/dev/mtd2 fpga 0×00100000-0×00180000 0×00100000-0×00180000 FPGA design for the Linux kernel, loaded during kernel startup.
/dev/mtd3 linux 0×00180000-0×00300000 0×00180000-0×00300000 The Linux kernel as compressed image.
/dev/mtd4 rfs 0×00300000-0×00700000 0×00300000-0×00700000 Compressed RAM disk for the root file sytem.
/dev/mtd5 Linux JFFS2 0×00700000-0x037c0000 0×00700000-0×01700000 Flash file system mounted under /ffx used for packages and application data.
/dev/mtd6 Linux JFFS2 user 0x037c0000-0x03fc0000 0×01700000-0x01f00000 Flash file system mounted under /ffxusr used for user level data.
/dev/mtd7 Festo Config 0 0x03fc0000-0x03fd0000 0x01f00000-0x01f40000 Basic configuration data block used for network settings and password.
/dev/mtd8 Festo Config 1 0x03fd0000-0x03fe0000 0x01f40000-0x01f80000 empty
/dev/mtd9 Festo Config 2 0x03fe0000-0x03ff0000 0x01f80000-0x01fc0000 License file storage
/dev/mtd10 FIS directory 0x03ff0000-0×04000000 0x01fc0000-0×02000000 Flash partition directory. RedBoot and Linux commonly use this directory.

You can read the partition table by looking at the kernel boot log messages (use command dmesg) or by cat /proc/mtd.

Reading from a partition

Flash partitions /dev/mtdX can be treated as normal device files, i.e. the user may open and read from a flash partition just like it were a file. If necessary, flash partition contents may also be accessed from a shell by following commands:

~ $ cat /dev/mtd7 > /tmp/mtd7.bin
~ $ dd if=/dev/mtd4 of=/tmp/somefile count=1024 bs=1024
1024+0 records in
1024+0 records out

Reading or dumping a flash partition may be useful whenever the exact contents of a partition should be backed up for later use.

Program and erase

Writing to flash partitions involves erasing and programming them. Prior to erasing flash the concerned flash sectors must be unlocked. The camera provides the tools flash_unlock and flash_eraseall to perform this tasks:

~ $ flash_unlock /dev/mtd2
~ $ flash_eraseall /dev/mtd2

To program flash partition use normal file operations (write). At shell level cp or cat could be used to program/write a flash partition:

~ $ cp /tmp/myfpgadesign.fpga /dev/mtd2
~ $ cat /tmp/myfpgadesign.fpga > /dev/mtd2

Using program/erase offers an easy possibility to exchange the contents of a whole flash partition, e.g. to perform firmware updates or to permanently change the FPGA design.

Important note: partitions /dev/mtd0 and /dev/mtd1 cannot be erased because these partions are locked down. This prevents the user from accidentially erasing the boot loader. Without bootloader the camera cannot be operated any longer and must be sent back to factory. Generally, care should be taken whenever modifying flash paratitions as this may lead to problems to successfully boot the camera. At least the user should have a backup firmware file (.sbof) that can be downloaded if something happens.