Nios® II Software Developer Handbook

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

5.4.3.1. Creating a BSP for an Intel FPGA Development Board

In some situations, you need to create a BSP separate from any application. Creating a BSP is similar to creating an application. To create a BSP, perform the following steps:
  1. Start the Nios® II Command Shell.

    For details about the Nios® II Command Shell, refer to the "Getting Started from the Command Line" chapter.

  2. Create a working directory for your hardware and software projects. The following steps refer to this directory as <projects>.
  3. Make <projects> the current working directory.
  4. Find a Nios® II hardware example corresponding to your Intel FPGA development board. For example, if you have a Stratix® IV development board, you might select < Nios® II EDS install path>/examples/verilog/niosII_stratixIV_4sgx230/triple_speed_ethernet_design.
  5. Copy the hardware example to your 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

    The <projects> directory contains a subdirectory named software_examples/bsp. The bsp directory contains several BSP example directories, such as hal_default. Select the directory containing an appropriate BSP, and make it the current working directory.

    For a description of the example BSPs, refer to “ Nios® II Design Example Scripts” in the Nios® II Software Build Tools Reference section.

  7. Create and build the BSP with the create-this-bsp script by typing the following command:

    ./create-this-bsp

    Now you have a BSP, with which you can create and build an application.

    Note: Intel FPGA recommends that you examine the contents of the create-this-bsp script. It is a helpful example if you are creating your own script to build a BSP. create-this-bsp calls nios2-bsp with a few command-line options to create a customized BSP, and then calls make to build the BSP.