Nios® V Processor Software Developer Handbook

ID 743810
Date 10/02/2023
Public

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

Document Table of Contents

4.2.3.4. Changing the Linker Section Mapping

If the default section mappings created by the default Tcl script do not meet your needs, you can use a Tcl command to override the section mappings selectively.

To map the .stack and .heap sections into a memory region named ram_0, use the following command:

When creating a new BSP:
niosv-bsp –-create –-qsys=<Platform Designer system> --type=hal 
--cmd=”add_section_mapping <.stack or .heap> ram_0” settings.bsp

When updating an existing BSP:

niosv-bsp –-update --cmd=”add_section_mapping <.stack or .heap> ram0” settings.bsp

The other section mappings (for example, .text) are still mapped to the default linker memory region.

If you update your BSP, the default Tcl script overrides your section mappings for .stack and .heap because they are default sections. To prevent your section mappings from being changed, provide niosv-bsp --update with the add_section_mapping command line options.

Intel recommends using the --cmd=add_section_mapping approach when updating your BSP because it allows the default Tcl script to update the default sections mapping if memories are added, removed, renamed, or resized.