Nios® V Processor Software Developer Handbook

ID 743810
Date 2/14/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

6.13.5. Boot Modes

The processor’s boot memory is the memory that contains the reset vector. This device might be an external flash, or it might be an on-chip RAM. Regardless of the nature of the boot memory, HAL-based systems are constructed so that all program and data sections are initially stored in it.

The HAL provides a small boot loader program that copies these sections to their run time locations at boot time. You can specify run time locations for program and data memory by manipulating BSP settings.

If the runtime location of the .text section is outside of the boot memory, the Nios® V processor tools places a boot loader at the reset address. This bootloader is responsible for loading all program and data sections before the call to _start. When booting from a GSFI flash device, this loader function is provided by the hardware.

However, if the runtime location of the .text section is in the boot memory, the system does not need a separate loader. Instead the _reset entry point in the HAL executable program is called directly. The function _reset initializes the instruction cache and then calls _start. This initialization sequence lets you develop applications that boot and execute directly from flash memory.

When running in this mode, the HAL executable program must take responsibility for loading any sections that require loading to RAM. The .rwdata, .rodata, and .exceptions sections are loaded before the call to alt_main(), as required.

This loading is performed by the function alt_load(). To load these functions and data into memory manually; and to load any additional sections, use the alt_load_section() function.

For more information about alt_load_section(), refer to the HAL API Reference chapter.