Embedded Design Handbook

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

5.2.4.5.2. Application

In the Nios® II SBT window, select either:
  • File > New > Nios® II Application to develop a Nios® II application.

    or

  • File > New > Nios® II Application and BSP from Template to create a template to use for the Nios® II application.

BSP Editor Settings

You must edit the BSP editor settings according to the selected Nios® II processor boot options.
  1. In the Nios® II SBT tool, right click on your BSP project in the Project Explorer window. Select Nios® II > BSP Editor... to open the Nios® II BSP Editor.
  2. In Nios® II BSP Editor, expand into Advanced.hal.linker under Settings.

Table 42.  BSP Editor Settings
BSP Editor Setting: Settings Advanced.hal.linker

All settings are left unchecked.

BSP Editor Setting: Linker Script

All Linker Sections are set to OCRAM or External RAM.

  1. Make sure all settings are left unchecked.
    Figure 159. Advanced.hal.linker Settings
  2. Click on the Linker Script tab in the Nios® II BSP Editor.
  3. Set all the Linker Section Name list to the On-chip Memory (OCRAM) or external RAM.
    Figure 160. Linker Region Settings
  4. Click Generate. Make sure the BSP generation is successful.
  5. Click Exit to close the BSP editor.
  6. Build the project to generate the ELF file.

HEX File Generation

A HEX file must be generated from the ELF file so that the HEX file can be used in generating the JIC file and program to the flash devices.

  1. Launch Nios® II Command Shell.
  2. For Nios® II processor application copied from QSPI flash to RAM using boot copier, use the following command line to convert the ELF to HEX for your application.
    alt-file-convert -I elf32-littlenios2 -O hex--input=<ELF filename>.elf --output=<HEX filename>.hex --base=<address of GSFI AVL MEM> --end=<address of GSFI AVL MEM> --reset=<reset vector> --out-data-width=8 --boot=<Quartus installation directory>/nios2eds/components/altera_nios2/boot_loader_cfi.srec
  3. The command will create one HEX file (<output HEX filename>.hex).