Hello_world
Software development
- First, create a new software folder inside the hardware Engineering folder to place the software part; open toolsàNios II 11.0 software Build Tools for Eclipse, need to workspace Launcher (Workspace) path settings, it is important to note that the path does not contain spaces, etc., and then click OK.
?
- New project. Click File--New->? Nios II application and BSP from template, pops up Nios II application and BSP from Template dialog box. Select the corresponding SOPC system first, click the browse button after Sopc information file name, select the soft core file that was previously done by the hardware section, The suffix name is. Sopcinfo, it is important to note that the selected files must correspond, otherwise the system will fail because of a soft and hard mismatch. Here Select the Hello_world.sopcinfo, then the system will automatically read the CPU name, no more settings, the following fill out project name, here to fill in the Lab1_hello_world, Project template (Project Template) using the default. Then click Finish to finish. This will generate two project files in the Project Explorer on the left.
- Right click Helloword Project, select Nios II, BSP editor, enter the Nios II BSP editor configuration interface. It is configured primarily under the Main tab in Hall. Then click Generate to generate the BSP library. When the build is complete, click Exit to quit.
- Compile the project. Right-click to select Build Project. The first compile, the time will be more frequent, wait patiently.
- When the compilation is complete, download the. sof file to the FPGA first
- Right-click the project, select Run as--Nios II Hardware, pop Up the Run Configurations dialog box, the Default Project tab, project name and project ELF file name should all have content, Not a choice. Then go to the Target Connection tab, and if there is nothing in connections, click on the Refresh connection on the right to find the downloader, then click System ID prroperties ..., Check if the ID number was set before, click Apply, then click Run, this is the program will be downloaded automatically, and finally in the Nios II Console tab will show the results of the program run after the download is complete.
- Running the results in the Debug window output Hello from Nios ii! indicates the test was successful!
Experiment Code
#include <stdio.h> ? int Main () { printf ("Hello from Nios ii!\n"); printf ("Hello daxigua fpga!\n"); ? return0; } |
?
Nios ii--Experiment 1--hello_world software part