Nios II Embedded Design Suite (EDS)


2012-04-04Publicerad av Sven-Åke Andersson

Introduction


When we design with the Nios II embedded processor, we have access to a portfolio of robust software development tools and software components available from Altera and their partner ecosystem. The Nios II Embedded Design Suite (EDS) is included as part of the Quartus II software (web and subscription edition) and includes:

  • Nios II Software Build Tools for Eclipse
  • Nios II GCC 4 Tool-chain

We do not need to download anything other than the Quartus II software to get the Nios II EDS tools listed above. The Nios II Software Build Tools for Eclipse and the Nios II GCC 4 Tool-chain are recommended for all new designs.

Nios II Software Build Tools for Eclipse


The Nios II Software Build Tools are a fully integrated development environment built from the ground up. Nios II Software Build Tools are used as a foundation and designed as plug-ins for industry-standard Eclipse. The Nios II Software Build Tools for Eclipse includes:

  • Eclipse IDE
  • Source navigator and editor
  • Source debugger and profiler
  • Compiler, linker, and assembler for C and C++
  • Nios II plug-ins for Eclipse
  • Nios II Project Manager
  • Nios II Software Templates
  • Nios II Flash Programmer
  • Nios II BSP Editor
  • Quartus II Programmer
  • Nios II Command Shell


Download the Nios II Software Build Tools for Eclipse Handbook (PDF).
 

EDS installation


This screenplot shows the EDS installation that is included in the Quartus software installation. 



 


Nios II software in Eclipse


The Nios II Software Build Tools (SBT) for Eclipse is a set of plugins based on the Eclipse framework and the Eclipse C/C++ development toolkit (CDT) plugins. The Nios II SBT for Eclipse provides a consistent development platform that works for all Nios II embedded processor systems. We can accomplish all Nios II software development tasks within Eclipse, including creating, editing, building, running, debugging, and profiling programs.

Writing software for the Nios II processor is similar to writing software for any other microcontroller family. The easiest way to start designing effectively is to purchase a development kit from Altera that includes documentation, a ready-made evaluation board, a getting-started reference design, and all the development tools necessary to write Nios II programs. Modifying existing code is a common, easy way to learn to start writing software in a new environment.

The Nios II Embedded Design Suite provides many example software designs that we can examine, modify, and use in our own programs. The provided examples range from a simple “Hello world” program, to a working RTOS example, to a full TCP/IP stack running a web server. Each example is documented and ready to compile.


Running Eclipse


We start EDS from the Tools menu in Quartus:  Tools->Nios II Software Build Tools for Eclipse.




 
The first time we start Eclipse we have to tell the tool where to store our project (the workspace).

 


The Eclipse Nios II workbench.

 



 

Nios II perspective


Before we create a Nios II project, we must ensure that the Nios II perspective is visable. To open the Nios II perspective select Open Perspective from the Window menu. Then select Others and click Nios II.

 


 

Creating a project


To create a new project select from the File menu: New->Nios II Application and BSP from Template. To build the application and the Board Support Package (BSP) do the following:
 
  1. Find the SOPC information file in the design directory
  2. Give a name to the project (HelloWorld).
  3. Select a template (Hello World)





 
Click Next to create the new BSP.

 



Click Finish to create the project. Here is the result stored in the software directory.


 


 

We have added a simple Hello World program that we will load and run in the Nios II system. The program prints "Hello from Nios II" to the STDOUT.


 

 

Build the project


To build the project select from the Project menu: Build All.

 


 

Loading and running the software project
 

To run a software project, right-click the application and select: Run As -> Run Configuration... Make sure the right ELF file is selected (nommu_nios2_linux_3c120_125mhz_11.0sp1/software/HelloWorld/HelloWorld.elf).

 


 


Problem encountered 


This message is displayed in the window header:

[Target Connection]: Connected system ID hash not found on target at expected base address. The message stops us from loading the program to our target board.
 

Problem solved


I had turned off the OpenCores IP licenses (see last chapter) which meant that the Eclipse tool couldn't access the board. After fixing that problem everything runs just fine.

 



 

This message is printed on the Nios II console.