User guide

Tutorials
Creating a Nios II C/C++ Application Project
A Nios II C/C++ application project contains your program code and corresponding build
settings. In this tutorial you create a Nios II C/C++ application project for the full featured
hardware design provided in the Nios II Embedded Design Suite (EDS). The example C
program exercises the visible output devices on a Nios development board, such as the LEDs
and LCD screen.
Follow the steps below to create a Nios II C/C++ application project using the New Project
wizard.
1. Look for the highlighted Nios II C/C++ button on the perspective's tab to verify that
you are using the Nios II C/C++ perspective. If you are not using the Nios II C/C++
perspective, point to Open Perspective on the Window menu, and then either click
Nios II C/C++, or click Other... and then double-click Nios II C/C++.
2. On the File menu, point to New, and then click
Nios II C/C++ Application. The
New Project wizard appears.
3. Type tutorial as the name of the project in the Name box.
4. Allow the IDE to use the default location for the Nios II C/C++ application project by
leaving Specify Location off. The default path appears in the Location box when you
select the SOPC Builder system file in the following steps. And the name of the project
directory is the project name, tutorial.
Note: When off, the Nios II IDE creates the new project directory in the default
location specified in the New Projects
page. At installation, the default location is
the <SOPC Builder system path>/software directory. Altera recommends
using this location because it keeps software files in proximity to the system
hardware files. Turning on Specify Location allows you to specify an alternative
project location in the Location box.
5. Click Browse next to the SOPC Builder System box, and browse to the following
directory:
<Nios II EDS install path>/examples/verilog/<Nios development
board>/full_featured
6. Select the SOPC Builder system file (.ptf) in this directory (e.g.
NiosII_cycloneII_2c35_full_featured_sopc.ptf) and click Open. You return to
the New Project wizard, with data appearing in the SOPC Builder System and CPU
boxes.
Note: The SOPC Builder system file describes the processors, memories, and
peripherals contained in a Nios II hardware system. SOPC Builder generates the
file, and the Nios II IDE uses it when building projects, downloading code, and
communicating with the target hardware. For designs targeting custom hardware,
obtain an SOPC Builder system from the hardware designer.
Note: If your SOPC Builder system has more than one Nios II processor, you can
select a specific processor for the project in the CPU box. Since the full_featured
example design contains only one processor (named "cpu"), only one processor is
available in the list.
7. Select the Count Binary project template in the Select Project Template list. The
Count Binary example continuously sends a counting pattern to the LEDs, the seven
segment display, and the LCD display on the Nios development board.
11