Embedded Design Handbook

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

5.2.5.1.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.
  3. Enable allow_code_at_reset and leave others unchecked to make sure the application starts at address 0x00.
    Figure 174. Advanced.hal.linker Settings
  4. Click on the Linker Script tab in the Nios® II BSP Editor.
  5. Set all the Linker Section Regions to the On-chip Memory (OCRAM).
    Figure 175. Linker Region Settings

HEX File Generation

  1. In the Nios® II SBT tool, right click on your project in the Project Explorer window.
  2. Click Make Targets -> Build…, the Make Targets dialog box appears. You can also press shift + F9 to trigger the Make Target dialog box.
  3. Select mem_init_generate.
  4. Click Build to generate the HEX file.
    Figure 176. Selecting mem_init_generate in Make Targets
  5. The “mem_init_generate” macro will create <on_chip_ram.hex>.
    Note:
    • The mem_init_generate target also generates a Intel® Quartus® Prime IP file (meminit.qip). Intel® Quartus® Prime software will refer to the meminit.qip for the location of the initialization files.
    • All these files can be found under the "<project_folder>/software/<application_name>/mem_init" folder.
  6. Recompile your project in Intel® Quartus® Prime software to include the software data (.HEX) into the SOF file.