Generic Serial Flash Interface Intel® FPGA IP User Guide

ID 683419
Date 11/09/2021

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

1.9. Nios II HAL Driver

The HAL API is available for this controller in the following software files:
  • intel_generic_serial_flash_interface_top.h
  • intel_generic_serial_flash_interface_top.c

These files implement the Generic Serial Flash Interface core device driver for the HAL system library.

Nios® II HAL supports a number of generic device model classes including one for device flashes. Developing against these generic classes gives a consistent interface for driver functions so that the HAL can access the driver functions uniformly.

A HAL API application begins by calling alt_flash_open_dev() to open the flash device, which returns a file handle to a flash device. You can obtain the IP name from system.h. All offset-related variables are based on absolute addressing to the flash memory.
  1. Enable altera_safeclib in BSP Software Package from BSP Editor to use the HAL API.
  2. The HAL API does not reset the error bits, thus needs to reset manually depending on the flash device, for example:
    • Clear flag status register for Micron flash.
    • Clear status register for Cypress flash.
  3. Sector protection related operations are not supported in the HAL API.