Embedded Design Handbook

ID 683689
Date 8/28/2023
Public
Document Table of Contents

5.3.4.3.4. Choosing a Boot Image

The advanced boot copier example supports up to two boot images stored in flash memory. The boot copier inspects two locations in flash memory, looking for a valid boot image at each location, then chooses one of the images to copy to RAM and execute. The two locations are predesignated as location numbers 1 and 2. To choose a boot image, the boot copier uses the following criteria, in the order in which they appear.

  • Image validity
    • If only one valid boot image is found, the boot copier boots using that image.
    • If no valid boot images are found, the boot copier waits five seconds, then jumps back to the Nios® II reset address.
  • Revision number
    • If both boot images are valid, the boot copier looks at the version number of each image.
    • The boot copier chooses the boot image with the highest version number.
  • Timestamp
    • If both boot images have the same version number, the boot copier looks at the timestamp of each image.
    • The boot copier chooses the boot image with the most recent timestamp.
  • Default
    • If both boot images have the same timestamp, the boot copier chooses the image in location number 2.