Specifications
Creating Hello_World for an Altera Development Board
In this section you create a simple “Hello World” project. To create and build the hello_world example
for an Altera development board, perform the following steps:
1. Start the Nios II Command Shell.
(2)
2. Create a working directory for your hardware and software projects. The following steps refer to this
directory as <projects>.
3. Change to the <projects> directory by typing the following command:
cd <projects>r
4. Locate a Nios II hardware example for your Altera development board. For example, if you have a
Stratix
®
IV GX FPGA Development Kit, you might select <Nios II EDS install path>/examples/
verilog/niosII_stratixIV_4sgx230/triple_speed_ethernet_design.
5. Copy the hardware example to your <projects> working directory, using a command such as the
following:
cp -R /altera/100/nios2eds/examples/verilog/niosII_stratixIV_4sgx230/triple_speed_ethernet_design .r
6. Ensure that the working directory and all subdirectories are writable by typing the following
command:
chmod -R +w .r
7. The <projects> directory contains a subdirectory named software_examples/app/hello_world. The
following steps refer to this directory as <application>.
8. Change to the <application> directory by typing the following command:
cd <application>r
9. Type the following command to create and build the application:
./create-this-appr
The create-this-app script copies the application source code to the <application> directory, runs
nios2-app-generate-makefile to create a makefile (named Makefile), and then runs make to create an
Executable and Linking Format File (.elf). The create-this-app script finds a compatible BSP by
looking in <projects>/software_examples/bsp. In the case of hello_world, it selects the hal_default
BSP.
To create the example BSP, create-this-app calls the create-this-bsp script in the BSP directory.
Related Information
The Nios II Command Shell on page 3-4
Running Hello_World on an Altera Development Board
To run the hello_world example on an Altera development board, perform the following steps:
1. Start the Nios II Command Shell.
2. Download the SRAM Object File (.sof) for the Quartus II project to the Altera development board.
This step configures the FPGA on the development board with your project’s associated SOPC Builder
system.
(2)
For more information, refer to the "The Nios II Command Shell" chapter.
3-6
Creating Hello_World for an Altera Development Board
NII5V2
2015.05.14
Altera Corporation
Getting Started from the Command Line
Send Feedback