Visible to Intel only — GUID: bry1638592719931
Ixiasoft
Visible to Intel only — GUID: bry1638592719931
Ixiasoft
4.5.2.1.4. Software Design Flow (User Application Project)
Creating the User Application BSP Project
- 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/m 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/m processor.
- Select the Operating system as Altera HAL.
- Click Create to create the BSP file.
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 60. hal.linker Settings - Click the BSP Linker Script tab in the BSP Editor.
Figure 61. 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