Embedded Design Handbook

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

5.2.3.4.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

  1. Open the Nios® II SBT tool and create the Nios® II processor HAL BSP based on the .sopinfo created from Platform Designer generation.
  2. Right-click on the BSP that you have created and select Nios II > BSP Editor.
  3. Configure the Settings.Advanced.hal.linker and the Linker Section mappings in the BSP Editor based on your boot options. Refer to the table below.
    Table 35.  BSP Editor Mappings
    Boot Option BSP Editor: Linker Script Settings.Advanced.hal.linker
    Nios II processor application is copied from EPCQ flash to RAM using boot copier Make sure all Linker Sections are set to OCRAM/External RAM. Make sure all settings are left unchecked.
    Figure 102. Settings.Advanced.hal Linker for Boot Copier Method
    Figure 103. Linker Section Mappings for Boot Copier Method
  4. Click Generate. Make sure the BSP generation is successful.
  5. Click Exit to close the BSP editor.

HEX File Generation

  1. Point your application to the BSP location that you have created in the previous section.
  2. Once the application development finishes, right-click on the project in Project Explorer and select Build Project. A *.elf file is created under the project folder.
  3. Next, generate the HEX file using the mem_init_generate utility. Right-click on the project in Project Explorer and select Make Targets > Build. The Make Targets window opens as shown below.
    Figure 104. Make Targets Window
  4. Select mem_init_generate and click Build. Make sure epcq_controller_0.hex is created under the mem_init folder.