Nios II Classic Software Developer’s Handbook

ID 683282
Date 5/14/2015
Public
Document Table of Contents

6.2. The Nios II Embedded Project Structure

The creation and management of software projects based on the HAL is integrated tightly with the Nios II SBT. This section discusses the Nios II projects as a basis for understanding the HAL.
Note: The label for each block describes what or who generated that block, and an arrow points to each block’s dependency.
Figure 10. The Nios II HAL Project Structure Emphasizing How the HAL BSP Fits In

Every HAL-based Nios II program consists of two Nios II projects.

For more information, refer to the figure above. Your application-specific code is contained in one project (the user application project), and it depends on a separate BSP project (the HAL BSP).

The application project contains all the code you develop. The executable image for your program ultimately results from building both projects.

With the Nios II SBT for Eclipse, the tools create the HAL BSP project when you create your application project. In the Nios II SBT command line flow, you create the BSP using nios2-bsp or a related tool.

The HAL BSP project contains all information needed to interface your program to the hardware. The HAL drivers relevant to your hardware system are incorporated in the BSP project.

The BSP project depends on the hardware system, defined by a SOPC Information File (.sopcinfo). The Nios II SBT can keep your BSP up-to-date with the hardware system. This project dependency structure isolates your program from changes to the underlying hardware, and you can develop and debug code without concern about whether your program matches the target hardware.

You can use the Nios II SBT to update your BSP to match updated hardware. You control whether and when these updates occur.

For more information about how the SBT keeps your BSP up-to-date with your hardware system, refer to “Revising Your BSP” in the "Nios II Software Build Tools" chapter.

In summary, when your program is based on a HAL BSP, you can always keep it synchronized with the target hardware with a few simple SBT commands.