AN 717: Nios II Gen2 Hardware Development Tutorial

ID 683615
Date 9/22/2014
Public
Document Table of Contents

1.4.4. Developing Software with the Nios II Software Build Tools for Eclipse

You can perform all software development tasks for your Nios II processor system using the Nios II Software Build Tools (SBT) for Eclipse™.

After you generate the system with Qsys, you can begin designing your C/C++ application code immediately with the Nios II SBT for Eclipse. Altera provides component drivers and a hardware abstraction layer (HAL) which allows you to write Nios II programs quickly and independently of the low-level hardware details. In addition to your application code, you can design and reuse custom libraries in your Nios II SBT for Eclipse projects.

To create a new Nios II C/C++ application project, the Nios II SBT for Eclipse uses information from the .sopcinfo file. You also need the .sof file to configure the FPGA before running and debugging the application project on target hardware.

The Nios II SBT for Eclipse can produce several outputs, listed below. Not all projects require all of these outputs.

Table 2.  Nios II SBT for Eclipse OutputsThe Nios II SBT for Eclipse can produce several outputs but not all projects require all of these outputs.
Output Description
system.h file
  • Defines symbols for referencing the hardware in the system.
  • The Nios II SBT for Eclipse automatically create this file when you create a new board support package (BSP).
Executable and Linking Format File (.elf) Is the result of compiling a C/C++ application project, that you can download directly to the Nios II processor.
Hexadecimal (Intel-Format) File (.hex)
  • Contains initialization information for on-chip memories.
  • The Nios II SBT for Eclipse generate these initialization files for on-chip memories that support initialization of contents.
Flash memory programming data
  • Boot code and other arbitrary data you might write to flash memory.
  • The flash programmer adds appropriate boot code to allow your program to boot from flash memory.
  • The Nios II SBT for Eclipse includes a flash programmer to allow you to write your program or arbitrary data to flash memory.

This tutorial focuses on downloading only the .elf directly to the Nios II system.