Embedded Design Handbook

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

5.3.9.1. Overview

Two different methods are available to implement an externally controlled boot of a Nios® II system.

  • The external processor unpacks the Nios® II boot image and writes the executable application code to Nios® II program memory.
  • The external processor only copies the boot image to RAM. The Nios® II processor takes over from there and unpacks the boot image itself.

The latter method, letting the Nios® II processor unpack and load the application from the boot image, is similar to the process of running a normal boot copier on the Nios® II processor. The only difference is that instead of a flash programmer placing the boot image in flash memory, an external processor copies the boot image to RAM. After the external processor releases the Nios® II processor from reset, everything happens just as if the Nios® II processor were booting from flash memory.

This section focuses on the first method, in which the external processor unpacks the Nios® II boot image, copies the application code to Nios® II program memory, and then directs the Nios® II processor to the application's entry point.

One common requirement, regardless of external boot method, is that you must prevent the Nios® II processor from executing any code in the memory space being written by the external processor during the copying and unpacking processes.

Otherwise, you may encounter race condition and data corruption problems. The process described in this section prevents the Nios® II processor from executing code by holding it in reset while the application code is copied to Nios® II program memory. After the application code is copied, the Nios® II processor is released from reset to execute the application.