1.6.2 Multi Application Image Memory Map

Overview

A multi image bootloader is very similar to a single image bootloader. Instead of supporting a single application image, the device's application space is broken into multiple equal-sized sections, each having a separate image as shown below. This is very useful in overcoming the main disadvantage of a single application image where any new download over-writes the application image before the downloaded code is verified.

In the above memory map example, two different application image spaces are defined, each of them taking 1/2 of the total application space. Of the two images above, the first image is always the executable image. This is the only application that is actually executed. The next application image is the download image. This is where a new image is downloaded to and verified. Once the image is verified, it can be copied over the execution image. This process prevents the corruption of the single application that can occur with a single application image.

The user can also create up to 4 application spaces and define which of the application spaces will be used for downloading any new application. This would allow the user to also have a factory reset version that could be run if the other images were ever corrupted. However, as mentioned above, the first application image will always be the execution image.

Note: if you are creating multiple application spaces, it would reduce the size of each application space.

Configuring the Bootloader to use Multiple Application Images.  

The bootloader configuration screen is shown below for the Multiple Partition Configuration Screen. In this example two partitions were selected and the download partition was changed to IMAGE_1. This will allow the bootloader to download new images to the second partition. Once the new downloaded firmware has been verified, it can be copied over to the Execution Partition. This greatly reduces the chance that the Execution Image will be corrupted during the firmware update process.

Partition Sizes  

The size of each partition is now half the size of the total application memory space. Also notice that in this example there is a unused section at the end. This is because the number of pages of flash not used by the bootloader and available to the application images is odd. Since each application image size needs to be the same, the odd page needs to be left out. The size of the executable application image is limited to to just half of the total flash memory not being used by the bootloader because we now have two application partitions.