Flash Tests
Flash Tests is a program which demonstrates the use of the flash programming application program interface (API) in Nios® II embedded processors. The application first opens the flash device with the name EXT_FLASH_NAME, which is defined in system.h. The following API functions are then executed to test the flash interface:
alt_get_flash_info—This function queries the flash device and collects various information about it. In the example, the results of this query are compared to what is expected, and an error is reported in the event of a mismatch.
alt_write_flash—This function writes a specified number of bytes to the flash device. In the example, this function is called repeatedly in a loop to write a lengthy amount of data.
alt_read_flash—This function reads a specified number of bytes of data from the flash device. In the example, alt_read_flash is used to read back and test all of the writing routines.
alt_erase_flash_block—This function performs a block erase on the flash device.
alt_write_flash_block—This function writes an erase block of data to the flash device.
During the test, status and error information is passed to the user via printf's.
Using This Design Example
This embedded software example is installed with the Nios II processor version 1.0 in a directory under <Nios II kit path>/examples/software and is available as a Nios II integrated development environment (IDE) project template. The template includes the project settings required to run this design on the supported target hardware configuration. To use this software example, it is not necessary to copy the files from the installation directory. Simply create a new C/C++ application project in the IDE, and choose the desired project template.
Hardware Requirements
This example requires the following devices to be present in the target hardware design:
STDOUT component such as a UART or JTAG UART
- CFI flash component
You can run this software design example on the following Nios II hardware design examples:
Stratix® Design Examples
Cyclone™ Design Examples
Related Links
For more information about using this example in your project, go to:
Design Examples Disclaimer
These design examples may only be used within Altera Corporation devices and remain the property of Altera. They are being provided on an “as-is” basis and as an accommodation; therefore, all warranties, representations, or guarantees of any kind (whether express, implied, or statutory) including, without limitation, warranties of merchantability, non-infringement, or fitness for a particular purpose, are specifically disclaimed. Altera expressly does not recommend, suggest, or require that these examples be used in combination with any other product not provided by Altera.
|