Nios® II Software Developer Handbook

ID 683525
Date 8/28/2023
Public
Document Table of Contents

4.3.2. Creating Hello_World for an Intel FPGA Development Board

In this section you create a simple “Hello World” project. To create and build the hello_world example for an Intel FPGA 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>

  4. Locate a Nios® II hardware example for your Intel FPGA 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 .

  6. Ensure that the working directory and all subdirectories are writable by typing the following command:

    chmod -R +w

  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>

  9. Type the following command to create and build the application:

    ./create-this-app

    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.

2 For more information, refer to the "The Nios® II Command Shell" chapter.