066469

所属分类:Linux/Unix编程
开发工具:Borland C++
文件大小:12KB
下载次数:0
上传日期:2019-01-05 07:03:26
上 传 者Kamzevfy
说明:  这是在ALTEAR上使用的代码,他是用来NOIS II开发的代码,可以用的,
(This is the code used on ALTEAR, it's code for NOIS II development, it's available,)

文件列表:
7template.xml (802, 2005-05-24)
dflash_prog.c (52777, 2005-05-25)

/************************************************************************** * Copyright 2005 Altera Corporation, San Jose, California, USA. * * All rights reserved. All use of this software and documentation is * * subject to the License Agreement located at the end of this file below.* *************************************************************************/ /************************************************************************** * * * Description *************** * This is a program which programs CFI and EPC flash devices using the Host * Filing System feature in Nios II. Unlike the nios2-flash-programmer utility, * this method does not require a seperate flash programming hardware design. * Any design that meets the criteria in the Requirements section can be used. * * When programming EPCS devices with both SOF and ELF data, a little trickiness * is employed to satisfy the fact that the SOF must ALWAYS be located at offset * 0x0 within the EPCS. If you are programming both SOF and ELF into EPCS, you * must program each in seperate steps, and you MUST program the SOF first. * If you program the ELF first, it may get located at offset 0x0, in which case * it will get overwritten when you program the SOF. The below table describes * the behavior of this flash programmer when dealing with EPCS devices. * * ------------------------------------------------------------------------ *|File being programmed | SOF exists at 0x0 | SOF does NOT exist at 0x0 | *|------------------------------------------------------------------------ *| ELF | ELF gets put at | ELF gets programmed | *| | end of SOF | at 0x0 | *|------------------------------------------------------------------------- *| SOF | SOF overwritten | SOF gets programmed | *| | with new SOF @ 0x0 | at 0x0 | *|------------------------------------------------------------------------ * * Requirements **************** * This project MUST be run in "Debug As" mode. The reason is that it uses * the HostFS filing system to retrieve the SREC file used for programming. * The HostFS feature requires a GDB server to be running, which is only the * case when using "Debug As" mode. * * The hardware design this program is run on must comprise the following items * at minimum. * - Nios II core (/e, /s, or /f) * JTAG Debug module (level 1 or higher) * - JTAG UART * - 256KB of program/data RAM (any kind) * - Interface to CFI flash (if you want to program CFI flash) * - Interface to EPCS flash (if you want to program EPCS flash) * * * Instructions for use: ************************* * To use this software example, copy the entire directory "alt_flash_prog" * to /kits/nios/examples/software/. Then start Nios II IDE, select * File -> New -> Project -> C/C++ Application. In the new project wizard * that appears, select "Alternate Flash Programmer" from the list of examples * on the left hand side. * * To program an elf file into flash: * 1.) Compile your actual software project in Nios II IDE to create a .flash * file in your "Debug" or "Release" directory. * 2.) Copy the .flash file created in step 1 to this project's root directory * (the same directory where this flash_prog.c file is located) * 3.) Right-click this project in the C/C++ Projects tab, and select * "Debug As -> Nios II Hardware". * 4.) When the debugger launches, and the program breaks at the first command * in "main", click "Run -> Resume". This will start the program and a menu * of options will be presented on the terminal. * 5.) Choose the option which suits your needs and follow the instructions. * * To program a SOF file into flash: * 1.) Run the "sof2flash" utility on your system's SOF file to create a .flash * file. * 2.) Copy the .flash file to this project's root directory (the same * directory where this flash_prog.c file is located). * 3.) Right-click this project in the C/C++ Projects tab, and select * "Debug As -> Nios II Hardware". * 4.) When the debugger launches, and the program breaks at the first command * in "main", click "Run -> Resume". This will start the program and a menu * of options will be presented on the terminal. * 5.) Choose the option which suits your needs and follow the instructions. * * * Note: This example will not run on the Nios II Instruction Set Simulator * * Software Files ****************** * flash_prog.c - Main C file that contains all flash programming code in this * example. * **************************************************************************/

近期下载者

相关文件


收藏者