Specifications

Developing Programs Using the Hardware
Abstraction Layer
6
2015.05.14
NII5V2
Subscribe
Send Feedback
This chapter discusses how to develop embedded programs for the Nios
®
II embedded processor based on
the Altera
®
hardware abstraction layer (HAL). The application program interface (API) for HAL-based
systems is readily accessible to software developers who are new to the Nios II processor. Programs based
on the HAL use the ANSI C standard library functions and runtime environment, and access hardware
resources with the HAL API’s generic device models. The HAL API largely conforms to the familiar ANSI
C standard library functions, though the ANSI C standard library is separate from the HAL. The close
integration of the ANSI C standard library and the HAL makes it possible to develop useful programs that
never call the HAL functions directly. For example, you can manipulate character mode devices and files
using the ANSI C standard library I/O functions, such as printf() and scanf().
For more information, refer to the book:
The C Programming Language, Second Edition, by Brian
Kernighan and Dennis M. Ritchie (Prentice-Hall).
HAL BSP Settings
Every Nios II board support package (BSP) has settings that determine the BSP’s characteristics. For
example, HAL BSPs have settings to identify the hardware components associated with standard devices
such as stdout. Defining and manipulating BSP settings is an important part of Nios II project creation.
You manipulate BSP settings with the Nios II BSP Editor, with command-line options, or with Tcl scripts.
Note:
For details about how to control BSP settings, refer to one or more of the following documents:
For more information about the Nios II SBT for Eclipse, refer to the "Getting Started with the
Graphical User Interface" chapter.
For more information about the Nios II SBT command line, refer to the "Nios II Software Build
Tools" chapter.
For more information about detailed descriptions of available BSP settings, refer to the "Nios II Software
Build Tools Reference" chapter.
Many HAL settings are reflected in the system.h file, which provides a helpful reference for details about
your BSP.
For more information about system.h, refer to the “The system.h System Description File” chapter.
Note:
Do not edit system.h. The Nios II EDS provides tools to manipulate system settings.
©
2015 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information,
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
ISO
9001:2008
Registered
www.altera.com
101 Innovation Drive, San Jose, CA 95134