Chapter 4. Updating RedBoot

Introduction

RedBoot normally runs from flash or ROM (in both cases, it is termed a ROM-startup configuration of RedBoot). In the case of flash, it is possible to update RedBoot, that is, replace it with a newer version, in situ. This process is complicated by the fact that RedBoot is running from the very flash which is being updated. The following is an outline of the steps needed for updating RedBoot:

In order to execute this process, two versions of RedBoot are required; one which runs from flash, and a separate one which runs solely from RAM. Both of these images are typically provided as part of the RedBoot package, but they may also be rebuilt from source using the instructions provided for the platform.

On some platforms, RedBoot runs in a ROMRAM-startup configuration: RedBoot is stored in the flash or ROM, but when the board is reset, it is copied to RAM and executes from there. For these platforms where RedBoot is in flash, the update in-situ process is simplified since the ROMRAM-startup configuration of RedBoot can update the flash content. The update procedure becomes:

  • Start ROMRAM RedBoot, running from RAM.

  • Update the primary RedBoot flash image.

  • Reboot; run the new ROMRAM RedBoot from ram.

In order to execute this process, only one version of RedBoot is required; a ROMRAM-startup configuration. This image is typically provided as part of the RedBoot package, but it may also be rebuilt from source using the instructions provided for the platform.

The following is a more detailed look at these steps. For this process, it is assumed that the target is connected to a host system and that there is some sort of serial connection used for the RedBoot CLI. For platforms with a ROMRAM-startup configuration of RedBoot, skip to the Section called Update the primary RedBoot flash image.

Update the primary RedBoot flash image

At this point, a version of RedBoot is running on the target, in RAM.

Using the load command, download the new flash based version from the host.

Since the flash version is designed to load and run from flash, the image must be relocated into some suitable, available, RAM location. The details of this are target platform specific (found in the target appendix), but the command will look something like this:
RedBoot> load redboot_ROM.srec -b <flash source>
This command loads the flash image into RAM at flash_source, using the TFTP protocol via a network connection. Other options are available, refer to the command section on load for more details.

Once the image is loaded into RAM, it must be placed into flash using the FIS commands. Some platforms support locking (write protecting) certain regions of the flash, while others do not. If your platform does not support the lock/unlock commands, simply ignore these steps. Again, the details of these commands (in particular the numeric values) differ on each target platform, but the ideas are the same:
RedBoot> fis unlock -f <flash addr> -l <flash length>
RedBoot> fis create RedBoot -f <flash addr> -b <flash source> -l <flash length>
         -s <data length>  
RedBoot> fis lock -f <flash addr> -l <flash addr>