Nios® II Software Developer Handbook

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

5.8.5.1. Boot Loader Dependent Settings

The script examines the .text section mapping and the Nios® II reset slave port. If the .text section is mapped to the same memory as the Nios® II reset slave port and the reset slave port is a flash memory device, the script assumes that a boot loader is being used. You can override this behavior by passing the enable_bootloader option to the default Tcl script.

If a boot loader is enabled, the assumption is that the boot loader is located at the reset address and handles the copying of sections on reset. If there is no boot loader, the BSP might need to provide code to handle these functions. You can use the alt_load() function to implement a boot loader.

Table 24.  Boot Loader-Dependent Settings
Setting name5 Value When Boot Loader Enabled Value When Boot Loader Disabled
hal.linker.allow_code_at_reset 0
hal.linker.enable_alt_load_copy_rodata 0 if .rodata memory different than .text memory and .rodata memory is volatile; 0 otherwise
hal.linker.enable_alt_load_copy_rwdata 0 if .rwdata memory different than .text memory; 0 otherwise
hal.linker.enable_alt_load_copy_exceptions 0 if .exceptions memory different than .text memory and .exceptions memory is volatile; 0 otherwise
5 For more information about the settings in this table, refer to the Nios® II Software Build Tools Reference section.