Altera Home Page
文档资料 许可
在线购买 下载

  主页   |   产品   |   支持   |   最终市场   |   技术中心   |   教育与活动   |   公司介绍   |   在线购买  
  mySupport   |   器件   |   软件   |   IP   |   设计范例   |   参考设计  

 产品
      MAX/MAX II
      Stratix/Stratix GX
      Nios II
  
 功能
      算法
      存储器
      总线及I/O
      逻辑
      接口与外设
      DSP
      通信
      PLL & Clocking
  
 设计输入方法
      Quartus II软件工程
      Tcl
      VHDL
      Verilog HDL
      C Code 范例
      DSP Builder
      TimeQuest
   片内调试
  
 仿真工具
      Mentor Graphics ModelSim
      Cadence NCsim
      Synopsys VCS
  
 旧范例
      图形编辑器
      AHDL
  

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

  • Standard
  • Full-featured

Cyclone™ Design Examples

  • Standard
  • Full-featured

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.

  请填写反馈意见