Nios® II Software Developer Handbook

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

5.10.4. Run from Initialized Memory Configuration

The reset address points to the beginning of the application in memory (no boot loader). The reset memory must have its contents initialized before the processor comes out of reset. The initialization might be implemented by using a non-volatile reset memory (for example, flash, ROM, initialized FPGA RAM) or by an external master (for example, another processor) that writes the reset memory. The HAL C run-time startup code (crt0) initializes the instruction cache, uses alt_load() to copy select sections to their VMAs, and then jumps to _start. For each associated section (.rwdata, .rodata, .exceptions), Boolean settings control this behavior. The default Tcl scripts set these to default values as described in the "Boot Loader-Dependent Settings" table (Table 4–11 on page 4–36).

alt_load() must copy the .rwdata section (either to another RAM or to a reserved area in the same RAM as the .text RAM) if .rwdata needs to be correct after multiple resets.

This boot configuration has the following characteristics:

  • alt_load() called
  • Code at reset in executable file

The default Tcl script chooses this configuration when the reset and .text memory are the same.

In this boot configuration, when the processor core resets, by default the .rwdata section is not reinitialized. Reinitialization would normally be done by a boot loader. However, this configuration has no boot loader, because the software is running out of memory that is assumed to be preinitialized before startup.

If your software has a .rwdata section that must be reinitialized at processor reset, turn on the hal.linker.enable_alt_load_copy_rwdata setting in the BSP.