A newer version of this document is available. Customers should click here to go to the newest version.
1. About the Nios® V Embedded Processor
2. Nios® V Processor Hardware System Design with Intel® Quartus® Prime Software and Platform Designer
3. Nios® V Processor Software System Design
4. Nios® V Processor Configuration and Booting Solutions
5. Nios® V Processor - Using the MicroC/TCP-IP Stack
6. Nios® V Processor Debugging, Verifying, and Simulating
7. Nios® V Processor — Remote System Update
8. Nios® V Processor — Using Custom Instruction
9. Nios® V Embedded Processor Design Handbook Archives
10. Document Revision History for the Nios® V Embedded Processor Design Handbook
4.1. Introduction
4.2. Linking Applications
4.3. Nios® V Processor Booting Methods
4.4. Introduction to Nios® V Processor Booting Methods
4.5. Nios® V Processor Booting from Configuration QSPI Flash
4.6. Nios® V Processor Booting from On-Chip Memory (OCRAM)
4.7. Nios® V Processor Booting from Tightly Coupled Memory (TCM)
4.8. Summary of Nios® V Processor Vector Configuration and BSP Settings
4.5.2.1.1. Hardware Design Flow
4.5.2.1.2. Software Design Flow
4.5.2.1.3. Software Design Flow (SDM Bootloader Project)
4.5.2.1.4. Software Design Flow (User Application Project)
Creating the User Application BSP Project
Configure BSP Editor and Generate the BSP Project
Creating the User Application Project
Building the Application Project
Generating the HEX File
4.5.2.1.5. Programming Files Generation
4.5.2.1.6. QSPI Flash Programming SDM
6.5.1. Prerequisites
6.5.2. Setting Up and Generating Your Simulation Environment in Platform Designer
6.5.3. Creating Nios V Processor Software
6.5.4. Generating Memory Initialization File
6.5.5. Generating System Simulation Files
6.5.6. Running Simulation in the QuestaSim Simulator Using Command Line
4.5.2.1.4. Software Design Flow (User Application Project)
This section provides the design flow to generate and build the Nios® V processor user application.
Creating the User Application BSP Project
To launch the BSP Editor, follow these steps:
- In the Platform Designer window, select File > New BSP . The Create New BSP windows appears.
- For BSP setting file, navigate to the software/user_application/bsp folder and name the BSP as settings.bsp.
BSP path: <project directory>/software/user_application/bsp/settings.bsp
- For System file (qsys or sopcinfo), select the Nios® V processor Platform Designer system (.qsys).
- For Quartus project, select the Quartus Project File.
- For Revision, select the correct revision.
- For CPU name, select the Nios® V processor.
- Select the Operating system as Altera HAL.
- Click Create to create the BSP file.
Figure 64. Create New BSP Window
Configure BSP Editor and Generate the BSP Project
- Go to Main > Settings > Settings > Advanced > hal.linker.
- Enable the following settings:
- enable_alt_load
- enable_alt_load_copy_exceptions
Figure 65. hal.linker Settings - Click the BSP Linker Script tab in the BSP Editor.
Figure 66. Linker Region Settings
- Set all the Linker Section Name list to the User Application RAM.
- Click Generate BSP. Make sure the BSP generation is successful.
- Close the BSP Editor.
Creating the User Application Project
- Navigate to the software/user_application/app folder and create your user application source code.
- Launch the Nios V Command Shell.
- Execute the command below to generate the user application CMakeLists.txt.
niosv-app --app-dir=software/user_application/app \ --bsp-dir=software/user_application/bsp \ --srcs=software/user_application/app/<user application>
Building the Application Project
You can choose to build the application project using the RiscFree* IDE for Intel FPGAs, Eclipse Embedded CDT, or through the command line interface (CLI).
With the CLI, you can build the user application using the following commands:
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug \ -B software/user_application/app/debug -S software/user_application/app
make -C software/user_application/app/debug
The user application (.elf) file is created in software/user_application/app/debug folder.
Generating the HEX File
You must generate a .hex file from your application .elf file, so you can create a .jic file suitable for programming flash devices.
- Launch the Nios V Command Shell.
- For Nios® V processor application copied from QSPI flash using SDM bootloader, use the following commands to convert the ELF to HEX for your application. These commands creates the user application (.hex) file.
elf2flash --input software/user_application/app/debug/<user application>.elf \ --output flash.srec –epcs –-offset 0x0
riscv32-unknown-elf-objcopy --input-target srec \ --output-target ihex flash.srec \ <user application>.hex
Related Information