Embedded Design Handbook

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

4.2.1.2. Nios® II Software Development Process

This section provides an overview of the Nios® II software development process and introduces terminology. The rest of the chapter elaborates the description in this section.

The Nios® II software generation process includes the following stages and main hardware configuration tools:

  1. Hardware configuration
    • Platform Designer
    • Intel® Quartus® Prime software
  2. Software project management
    • BSP configuration
    • Application project configuration
    • Editing and building the software project
    • Running, debugging, and communicating with the target
    • Ensuring hardware and software coherency
    • Project management
  3. Software project development
    • Developing with the Hardware Abstraction Layer (HAL)
    • Programming the Nios® II processor to access memory
    • Writing exception handlers
    • Optimizing the application for performance and size
    • Real-time operating system (RTOS) support
  4. Application deployment
    • Linking (run-time memory)
    • Boot loading the system application
    • Programming flash memory

In this list of stages and tools, the subtopics under the topics Software project management, Software project development, and Application deployment correspond closely to sections in the chapter.

You create the hardware for the system using the Intel® Quartus® Prime and Platform Designer software. The main output produced by generating the hardware for the system is the SRAM Object File (.sof), which is the hardware image of the system, and the Platform Designer Information File (.sopcinfo), which describes the hardware components and connections.

Note: The key file required to generate the application software is the .sopcinfo file.

The software generation tools use the .sopcinfo file to create a BSP project. The BSP project is a collection of C source, header and initialization files, and a makefile for building a custom library for the hardware in the system. This custom library is the BSP library file (.a). The BSP library file is linked with your application project to create an executable binary file for your system, called an application image. The combination of the BSP project and your application project is called the software project.

The application project is your application C source and header files and a makefile that you can generate by running Intel-provided tools. You can edit these files and compile and link them with the BSP library file using the makefile. Your application sources can reference all resources provided by the BSP library file. The BSP library file contains services provided by the HAL, which your application sources can reference. After you build your application image, you can download it to the target system, and communicate with it through a terminal application.

You can access the makefile in the Eclipse Project Explorer view after you have created your project in the Nios® II Software Build Tools for Eclipse framework.

The software project is flexible: you can regenerate it if the system hardware changes, or modify it to add or remove functionality, or tune it for your particular system. You can also modify the BSP library file to include additional Intel-supplied software packages, such as the read-only zip file system or TCP/IP networking stack (the NicheStack TCP/IP Stack). Both the BSP library file and the application project can be configured to build with different parameters, such as compiler optimizations and linker settings.

If you change the hardware system, you must recreate, update or regenerate the BSP project to keep the library header files up-to-date.

For information about how to keep your BSP up-to-date with your hardware, refer to “Revising Your BSP” in the Nios® II Software Build Tools chapter of the Nios® II Gen2 Software Developer's Handbook.