Niosii Eval User Guide-1488733
Niosii Eval User Guide-1488733
Altera Corporation iv
July 2010 Preliminary
Contents
Why do I get the error “Can't find valid feature line for core SD_MMC_SPI_CORE
(EC11_0002) in current license;
Error: Error (10003): Can't open encrypted VHDL or Verilog HDL file” when I try
to re-generate the Nios II Standard hardware design? .............................................................. D–3
Where can I get the SD-Card Controller IP License? ................................................................. D–3
How do I add pictures so the Picture Viewer Application can find them? ............................ D–3
How do I add my own design so the Application Selector can find and run it? ................... D–4
Where do I go to get more designs for the Nios II Embedded Evaluation Kit? ..................... D–4
How do I open a design example in the Nios II IDE? ................................................................ D–4
How do I restore the factory image? ............................................................................................ D–5
How do I re-build the factory image? .......................................................................................... D–5
Additional Information
Further Information .............................................................................................................................. i–ii
v Altera Corporation
Preliminary July 2010
Contents Contents
Altera Corporation vi
July 2010 Preliminary
1. Getting Started
Introduction The Altera® Nios® II Embedded Evaluation Kit, Cyclone® III Edition
includes a full-featured FPGA development board, LCD Multimedia
High Speed Mezzanine Card (HSMC), hardware and software
development tools, documentation, and accessories needed to begin
embedded and system on a programmable chip (SOPC) designs using
FPGAs.
The development board includes an Altera Cyclone III FPGA and comes
preconfigured with an FPGA hardware reference design stored in flash
memory as well as several ready-to-run demonstration applications
stored on the SD-Card Flash provided. Hardware designers can use the
FPGA reference design as a platform to build complex embedded
systems. Software developers can use the hardware reference design plus
sample software applications as a starting point for their own
applications.
Success for an embedded system start rights from the evaluation stage.
Choosing the right platform, development tools, operating systems may
be the difference between success and failure. The Altera Nios II
Embedded Evaluation Kit, Cyclone III Edition is an evaluation kit that
enables you to make these critical decisions with minimal investment.
Kit Contents The Nios II Embedded Evaluation kit will acquainting you with the
Nios II processor, the hardware and software development flows and the
robust embedded ecosystem of operating systems, middleware, IP and
third party offerings that support the Nios II processor.
■ LCD Controller
Demonstration Vendor
Application Selector/Web Server Altera
Altera Picture Viewer Altera
Altera Mandelbrot C2H Altera
Altera Spinning Cube Altera
Imagem Tacquin Game Imagem
Imagem Watch Imagem
Imagem Avionics Imagem
Demonstration Vendor
uC-GUI Demonstration Micrium
Photo Frame PlanetWeb PlanetWeb
SpectraWorks GUI Demonstration by PlanetWeb
PlanetWeb
DAVE 2D Graphics Demonstration TES
Altia Red HMI Altia
Altia Blue HMI Altia
Imagem aPhone Imagem
Imagem 2-D Demonstration Imagem
Imagem Instrumentation Imagem
SLS uClinux SLS
PlanetWeb Menu PlanetWeb
About this User This user guide describes how to start using the Altera Nios II Embedded
Evaluation Kit, including unpacking the kit, installing required software,
Guide and running the Application Selector utility and other design examples.
This user guide addresses the following topics:
■ How to set up, power up, and verify correct operation of the Nios II
Embedded Evaluation board
■ Nios II standard processor system for the Embedded Evaluation
board
■ How to install the Nios II Embedded Evaluation Kit, Cyclone III
Edition
■ How to install the Altera Quartus II Web Edition software
■ How to start and run the Application selector utility
■ Design examples
■ Taking the next step
■ Frequently asked questions
f For a full description of the development boards and their design and
use, refer to the Cyclone III FPGA Starter Board Reference Manual and LCD
Multimedia HSMC Reference Manual.
kits
cycloneIII_3c25_niosII
board_design_files
demos
documents
examples
factory_recovery
Table 1–2 lists the file directory names and a description of their contents.
Licensing Considerations
The Quartus II Web Edition software is license-free and supports
Cyclone III devices without any additional licensing requirement. This
kit also works with the Quartus II Subscription Edition software, after
you obtain the proper license file. To purchase a subscription, contact
your Altera sales representative.
Licensing the IP
After installing the Quartus II Web Edition software, you will have
installed an OpenCore Plus evaluation of the Nios II IP core. Any designs
you create operate in Altera’s OpenCore Plus evaluation mode and allow
you to do the following:
To ship designs with the Nios II IP Core you need to obtain a license for
the Nios II IP (IP-NIOS). To obtain a license you can:
Micrium MicroC/OS-II RTOS— You can develop software for any of the
Nios II development kits using the Micrium MicroC/OS-II RTOS. To
generate software to run on other boards, ship in a product, or both, you
must obtain a license. To obtain a license for the Micrium MicroC/OS-II
RTOS, contact Micrium today.
To help shorten your design time, Altera provides some of its most
popular intellectual property (IP) cores with the Altera IP Base Suite,
which is completely free with a Quartus II subscription.
f For more information about obtaining the Altera IP Base Suite, refer to
the Free IP Base Suite Licenses With Active Quartus II Subscription page.
If your design requires access to the on-board SD Card then you can
request an evaluation license or purchase the SD-Card Controller IP,
drivers and FAT File system from El Camino.
El Camino GmbH
Landshuter Str. 1
D-84048 Mainburg
Germany
Tel. +49 - 8751 - 8787 - 0
Fax +49 - 8751 - 842876
Web: www.elcamino.de
E-mail: [email protected]
■ Install the Quartus II Web Edition software on the host computer. For
more information, refer to “Installing the Quartus II Web Edition
Software” on page 1–9.
■ Install the Nios II Embedded Evaluation Kit, Cyclone III Edition. For
more information, refer to “Installing the Nios II Embedded
Evaluation Kit, Cyclone III Edition” on page 1–7.
■ Install the USB-Blaster™ driver software on the host computer. The
Cyclone III FPGA starter development board includes integrated
USB-Blaster circuitry for FPGA programming.
Power Up the To power up the development board, perform the following steps:
Development 1. Ensure that the red on/off switch (SW1) - on the back-side of the
Board development board is in the OFF position (up).
Figure 3–1. Block Diagram of Nios II Embedded Evaluation Kit, Cyclone III Edition
Touch panel. The video pipeline signals have been multiplexed inside the
FPGA and de-multiplexed by the MAX II CPLD to provide a full range of
functionality on the daughter card over a limited number of pins on the
HSMC connector. (see the LCD Multimedia Daughtercard Reference Manual
for details)
Where to find There are two pre-generated processor systems that target the Nios II
Embedded Evaluation Kit:
the Nios II
Processor Nios II 3C25 Standard Processor System
Systems
Location
You can locate the Nios II 3C25 Standard Processor System in the <install
dir>/examples/standard folder.
Description
Simple general purpose Nios II processor system targeted for the Nios II
Embedded Evaluation Kit, Cyclone III Edition to be used as a starting
point for your embedded system development.
■ Nios II /f CPU
■ PLL
■ DDR SDRAM Memory Controller
■ SSRAM Memory Controller
■ CFI Flash Controller
■ JTAG UART
■ Remote System Update
■ Performance Counter
■ System Clock Timer
■ High Resolution Timer
■ LED PIO
■ Button PIO
Location
You can locate the Nios II 3C25 Video Processor System in the <install
dir>/examples/video folder.
Description
Video, Ethernet and SD Card controller based processor system for LCD
Color touch panel control, in-system update using SD Card, remote
system update using Ethernet
CPU Platform
System Functions
■ PLL—The PLL accepts the global input clock source from the
50-MHz on-board oscillator and generates the following clocks
● 100-MHz CPU Clock
● 100-MHz SSRAM Clock
● 66.5-MHz DDR SDRAM Clock
● 60-MHz Peripheral Clock (“slow peripherals”)
● 40-MHz Remote System Update Clock
Memory Interface
■ SSRAM Controller
■ DDR SDRAM Controller
■ CFI Flash Controller
■ SD Card
1 The controller, API, and FAT File System for the SD-Card used
in the Nios II Standard System is provided under license
agreement by El Camino (http://www.elcamino.de)
Communication Interfaces
● PIO for LCD I2C Controller—The I2C pins are used to configure
the LCD panel for brightness and set the gamma correction
curves.
● SPI Touch Panel Controller—Used to communicate with the
touch panel ADCs.
● Pixel Converter—Logic block that converts parallel 32-bit
R-G-B-0 data to an 8-bit data stream. This is required because of
the pin-limitation placed on the system by the HSMC connector.
The video data-stream is multiplexed in the FPGA on the
Cyclone III Starter Board and de-multiplexed in the MAX II
device on the LCD Multimedia Daughtercard.
● Sync Generator—Generates the horizontal and vertical sync
signals for each frame displayed on the LCD touch screen.
Overview The application selector is the default utility that boots up on power on
and allows users to quickly select, load, and run different ready-to-run
applications or demonstrations stored on an SD Card using the LCD
touch panel. An application consists of a FPGA hardware image and an
application software image. When you select an application the
application selector copies these images from the SD Card to the Flash
memory and reconfigures the FPGA with your selection.
Also, you can easily convert your own applications to be loadable by the
application selector.
Running the This section describes the general operation of the Application Selector
utility.
Application
Selector There are a couple of ways the application selector can update your
board.
The application selector will boot from flash, and a splash screen
will appear while the application selector searches for applications
on the SD Card. (see Figure 4–1)
1 If there are more than five applications on the SD Card, you can
scroll through the list by touching the scroll-up and scroll-down
buttons on the right hand side of the screen.
For more detailed information about the Application Selector Utility, see
Appendix B: Application Selector Details.
The way this works is that when your kit is connected to a network, it
serves up a web page. The contents of this web page are stored in the SD
Card in a folder entitled webserver_html. From any PC, you can view
this web page by simply typing the correct IP address on a web browser.
By following the instructions displayed on the HTTP forms on the web
page you can browse to and load a design stored on the local PC and
program it to the flash on your board. You can then reset the FPGA on
your board and the FPGA should reconfigure from the newly
downloaded Flash image.
Requirements
1. A host PC with a connection to a working Ethernet port.
3. Flash files for hardware and software image to update the board
with. These must be present on your host PC. Several flash files
examples are provided in the
altera/<version #>/kits/ cycloneIII_3c25_niosII/ examples/
application_selector/remote_system_update folder.
1 The .flash file format is an SREC file with addressing offset from
the base address of your flash device. For this application, the
ext_flash device is used. For information on how to create these
file refer to the section: “Creating Flash files for Remote System
update”
Operating Instructions
1. Apply power to the board by plugging in the power cable and
pressing switch SW1.
2. Using an Ethernet cable, connect the Ethernet RJ-45 jack on the LCD
Multimedia HSMC to a working Ethernet port.
1 You should now see a web page displayed on the web browser
which is being served up by the board from the contents of the
webserver_html directory on the SD Card.
6. On the upper left hand side on the web form, click on the link under
Go to instructions. You will be directed to the remote configuration
instruction page. Carefully read the instructions for remote
configuration.
7. Click on the Left hand side of the web page you will see a CFI Flash
Upload section. Click Browse button and browse to the hardware
Flash image on your PC and click Open.
10. If your remote update system has a software Flash image, then click
on Return to Instructions and repeat the previous three steps to
upload and program the software Flash.
11. Click on the Reset System button. The FPGA should now
reconfigure from the newly programmed contents of the Flash file.
Creating Flash The image required for remote system update consists of a Flash image
for FPGA configuration and if your system has a software application
files for Remote then it consist of a Flash image for the software application. To create the
System update flash files you must have the Nios II EDS and Quartus II FPGA design
software installed on your PC.
■ A hardware SRAM object file (*.SOF) must have the cpu reset
address configured from the Flash device at offset 0x0.
■ Create the software Executable link format file (ELF) in the standard
fashion.
■ On your host PC, launch a Nios II Command Shell from Start ->
Programs -> Altera -> Nios II <version #> EDS -> Nios II Command
Shell
■ From the command shell navigate to where your SOF file is located
and create your hardware Flash image using the following
command:
■ From the command shell navigate to where your ELF file is located
and create your software Flash image using the following command:
About Design The Nios II Embedded Evaluation kit comes with several applications
that showcase the versatility of the Nios II processor in various
Examples applications such as imaging, graphics, networking etc.
Operation
The Picture Viewer application displays a new picture on the LCD screen
after a settable delay (1,2,3,4,5,10,15,20 seconds). If decoding the image
takes longer than this delay time, then the image is displayed as soon as
it has been decoded. The image is scaled to optimally fit the LCD screen.
1. Power on the board by pressing the switch SW1. You will see the
Application Selector menu on the LCD Touch Screen Display. See
Figure 5–1.
3. Touch the Load button located on the bottom left corner of the
Touch Screen to load the Pic Viewer application. You will see the
progress bar on the screen. See Figure 5–2.
4. After loading the Pic Viewer application you will see the a slide
show of pictures stored on the SD card. Figures 5–4. shows the first
image stored on the SD card. The miniature view on the bottom
right corner shows the next image of the slide show.
Figure 5–3. Running the Picture Viewer Application - Displaying First Image
5. The next image will be displayed after the delay period. See
Figure 5–4.
● To display the next image before the delay time is finished, touch
● On the top center of touch panel you will see the Delay-period
(in Sec.). You can increase or decrease the delay period by
● You can hide the control buttons by clicking on the Hide button
located at the top left corner of the touch screen. To show the
control buttons again touch anywhere on the LCD Touch panel.
● On the bottom right corner, you will see the miniature view of
the next picture being decoded in the background.
6. The slide show continues until you tap the Stop button.
None
1. Power on the board (SW1). You will see the Application Selector
menu on the LCD Touch Screen Display.
3. Touch the button marked Load. The LCD Touch panel display
begins loading the Mandelbrot C2H application as shown in
Figure 5–5.
6. To change modes, color palettes, or pause the design simply tap the
touch panel to bring up the menu.
7. The menu will offer you the choice of using hardware or software
rendering. To select software rendering press the Software button
followed by the Continue button. See Figure 5–8.
8. To change the color palette used in the final image simply press the
Color button followed by the Continue button. See Figure 5–8.
The benchmark data is displayed in the bottom right of the screen and it
represents the instantaneous frames per second being rendered and
displayed.
Consider the implications of what you have observed: What one would
traditionally do with an expensive, power hungry GHz processor was
just accomplished using an inexpensive Cyclone III FPGA, running at 100
MHz. Such is the power of hardware acceleration using FPGAs.
Operation
The design performs panning and zooming on the complex plane which
gives a video like effect. Every time a new frame is rendered, a new set of
coordinates must be calculated. These coordinates contain a center point,
zoom factor, and maximum number of iterations. Knowing the center
point and zoom factor the top left point of the screen is then determine
and passed to the Mandelbrot algorithm. The maximum number of
iterations is used to determine how much effort is spent per pixel before
it is determined that the point is included in the Mandelbrot set (these
points appear as black pixels). The pixel calculation is based on the
following software segment:
The approach taken for the C2H accelerated version is to offload this
algorithm to pipelined and parallel hardware. Each Mandelbrot engine
contains dedicated multiply, addition, and subtraction logic to perform
multiple operations in parallel. Each Mandelbrot accelerator operates on
a quarter of the frame and is only called once per frame. The workload is
distributed on a pixel basis so each accelerator handles every fourth pixel.
The full design example for the application selector utility is available in
your Nios II Embedded Evaluation kit installed under the examples
directory.
■ The server can process basic requests to serve HTML, JPEG, and GIF
files from the Altera FAT file system on an SD card.
To learn more about the application selector with embedded web server
refer to the source code and design example in the <install_dir>/
examples/application_selector folder.
1 If you actually look at the design, there are several other Avalon
Streaming components in this flow. These have been omitted
from this discussion for clarity because they are not operational.
They are just timing-adapters which allow the operational
pieces to fit together properly.
Starting from the end of the chain: The sync-generator just takes a stream
of 8-bit-wide data values on its streaming input. Three consecutive 8-bit
values make a single color pixel (R, G, B, R, G, B…) An start of packet
(SOP)-pulse marks the start of each frame. The sync-generator drives
external pins so that the pixel-stream appears on the display.
The system has a FIFO because all systems like this always have FIFOs.
It’s there to “take up the slack” and keep the display fed even when the
DDR SDRAM memory is unavailable (due to contention, refresh, etc.).
Once the Pixel Format Converter has produced a stream of 24-bit (8:8:8)
(R:G:B) values, the data format adapter serializes the data into a stream of
8-bit (R, then G, then B) values. This is the input to the sync generator
block which produces the horizontal and vertical timing signals.
Get the full LCD For more information about the video pipeline and LCD controller, refer
to AN527: Implementing an LCD Controller.
controller
Application Note
Creating a new The Nios II Standard System is designed to use a 32-bit 0:R:G:B data
format. Suppose you wanted to change the entire display subsystem to
5:6:5 Pixel- work with 16-bit 5:6:5 pixels instead of 32-bit 0:R:G:B pixels. This can be
Format accomplished with a few simple steps:
component 1. Copy the Nios II Standard System into your own project directory.
This section describes some details about the operation of the Application
Selector.
SD Card The Application Selector uses the SD Card for storing applications and
data used by these applications (such as the pictures used by the picture
viewer or the HTML pages used by the Web Server application). The SD
Card must be formatted with the FAT 16 file system, and can be any
capacity up to 2GB. Long file names are supported.
Application Files Each loadable application consists of two flash files, and an optional text
file, all stored on an SD Card.
The first flash file represents the software portion of the example and
must be derived from an .ELF file as described in the section of this
document titled “Creating Your Own Loadable Applications”. This flash
file can be named anything supported by the FAT16 file system, the only
restriction being that the name must end with _sw.flash.
The second flash file represents the hardware portion of the example and
must be derived from a .SOF file as described in the section of this
document titled “Creating Your Own Loadable Applications”. This file
can be named anything supported by the FAT 16 file system, the only
restriction being that the name must end with _hw.flash
CFI Flash The Application Selector uses the on-board CFI flash to store several
different things. Table B–1 shows a map of how the different sections of
flash are used by the Application Selector.
Hardware images
CFI flash is used to store both the hardware image of the Application
Selector itself, as well as up to 10 hardware images of applications which
are being loaded.
Hardware images for the applications being loaded get written to flash at
load time to an offset between 0x580000 and 0xD00000, depending on
caching. Hardware image caching is described in more detail in the
section titled “Hardware Image Caching”
Software Images
CFI flash is used to store the software images of both the Application
Selector utility itself as well as software images of applications being
loaded. All software images used by the application selector contain a
boot copier which is pre-ended by the elf2flash utility during file
conversion process described in the “Creating Your Own Loadable
Applications” section. The boot copier copies the software code to
program memory before running it.
Software images for the applications being loaded get written to flash at
load time to offset 0x180000. Software images must be smaller than 4MB,
or they will overwrite the application HW images located at offset
0x580000.
Hardware Image Copying data from the SD Card to flash is slow due to both the read speed
from the SD Card in SPI mode and the write speed of the CFI flash.
Caching However the remote update feature allows us to reconfigure the FPGA
from anywhere in flash, so we can benefit by persistently holding
(caching) a certain number of frequently used application hardware
images in flash to avoid having to copy them from the SD Card every time
the application is loaded.
it inspects the .flash file on the SD Card. If the .flash file contains an S0
record on its first line which contains a 32-bit ASCII-encoded number, it
is considered to be a valid timestamp tag.
The Application Selector then scans the flash catalog for entries which
contain a matching timestamp. If a matching timestamp value is found,
then it means the desired hardware image is already stored in flash, and
can be used to directly reconfigure the FPGA without first copying it from
the SD-Card into the flash. For details on the flash catalog, refer to the
section below titled “Flash Hardware Image Catalog”.
Flash Hardware The flash hardware image catalog is a simple database which keeps track
of what application hardware images are currently stored (cached) in
Image Catalog flash. The flash catalog is located in sector 1 of the flash at offset 0x8000,
and is 0x8000 (32K) bytes long.
The way ZSFA works is that whenever a catalog entry needs to be read,
the sector is scanned from its lowest address until the first 0xFFFFFFFF
value is encountered. Every non-zero value encountered along the way is
a valid catalog entry. When a catalog entry needs to be written, the sector
is scanned until the first 0xFFFFFFFF value is found, and the new catalog
entry is written to that offset. To erase a catalog entry, you scan for it in the
sector, then write 0x0 to it to mark it as "spent". The sector(s) containing
the ZSFA catalog only need to be erased once enough data has been
stored there that there are no more “available” entry spots available.
Each flash catalog entry consists of two sequential 32-bit words. The first
word is the 32-bit timestamp value of a hardware image which is
currently in flash. The second word is the 32-bit flash offset of the image
itself. Entries are always created and erased as whole units, two 32-bit
words at a time.
2. The .SOF file must contain a Nios II CPU whose reset address is set
to CFI Flash at offset 0x00000000.
Once you have your working .SOF and .ELF file pair, perform the
following steps to convert them to a loadable application
selector-compatible application.
1. Copy both the .SOF and .ELF files into a common directory of your
choosing. This directory is where you will convert the files.
examples/application_selector/application_utilities/
flash_file_conversion_script
to the directory where you copied your .SOF and .ELF files.
Optionally, copy it to a directory in the Nios II Command Shell
search path i.e. <nios2 install>/bin
The eek.sh script runs the Nios II Command Line utilities sof2flash
and elf2flash to convert the .SOF and .ELF files to application
selector-compatible .FLASH files.
1 Feel free to open eek.sh in a text editor to see the exact commands
which are run.
5. You will now see two new files in the directory, <elf file>_sw.flash,
and <sof file>_hw.flash. These are the application files you will put on
the SD Card
7. Create a new subdirectory and name it what you would like the title
of your application to be shown as in the application selector.
8. Copy both .flash files and info.txt into the new directory.
Altera_EEK_Applications
<Name of Application>
<elf name>_sw.flash
<sof_name>_hw.flash
info.txt
10. Place the SD Card in the Nios II Embedded Evaluation Kit, Cyclone
III Edition board, and switch on the power. The Application Selector
will start up, and you will now see your application appear as one
of the selections
Rebuilding the This section describes how to rebuild the Application Selector utility from
source code using the Nios II Software Build Tools. If you are new to
Application developing software on the Nios II processor it is recommended that you
Selector first go through the tutorial My First Nios II Software Tutorial. This will
walk you through compiling a simple project that runs on the Nios.
<Install Directory>
examples/
application_selector/
software_examples/
bsp/
hal_application_selector
<Install Directory>
examples/
application_selector/
software_examples/
app/
application_selector
<Install Directory>
examples/
application_selector/
application_utilities/
app_selector_boot_code
Modifying the This section discusses the parts of the Application Selector you can
modify in order to tailor the utility to your needs
Application
Selector Changing the CFI flash map
If your application needs to use the CFI flash in a particular manner
which is not compatible with the Application Selector’s default flash
layout, you can modify the way some things are mapped in flash fairly
easily.
General Guidelines
If you choose to modify the flash map, take great care in ensuring that you
leave enough space in each block for the data you intend to store there.
Otherwise, you may overlap sections and the Application Selector utility
may overwrite important data and cause a failure.
Also, it is a good idea to completely erase the flash before altering the
flash map. This will prevent stale, unused data from accidentally causing
errors in the Application Selector Utility.
<Install Directory>
examples/
application_selector/
software_examples/
app/
application_selector/
src/
app_selector.h
to reflect what section of flash you would like to use to hold and cache
application hardware images. Note that one hardware image consumes
0xC0000 bytes (6 flash sectors), so ensure that
AS_HW_IMAGE_OFFSET_END - AS_HW_IMAGE_OFFSET_START
is always greater than or equal to 0xC0000. The Application Selector will
cache as many images in this section as it is able to fit. For instance, the
default section is 0x780000 bytes in size (60 flash sectors), so it is able to
cache up to 10 loadable application hardware images.
<install Directory>
examples/
application_selector/
application_utilities/
app_selector_boot_code/
app_selector_boot_code.s
to reflect the flash offset where you would like to put the loadable
application software images. Ensure that there is enough space
allocated at that offset to hold your application software images.
<install Directory>
examples/
application_selector/
software_examples/
app/
application_selector/
src/
app_selector.h
to reflect the flash offset where you would like to put the loadable
application software images. Ensure that there is enough space
allocated at that offset to hold your application software images.
1 You will need to rebuild both the boot code and the
application selector utility for these changes to take effect.
Flash Catalog
The flash catalog can be relocated in flash and size-adjusted by
performing the following steps.
to reflect the flash offset where you would like to put flash catalog.
1 You will need to rebuild the boot code for these changes to
take effect.
Restoring the The Nios II Embedded Evaluation kit is programmed from the factory to
configure the FPGA from flash to the application selector. In the course of
Original Flash your development you may need to replace the factory image with your
Image own flash image. To restore the original Flash contents of the Factory
Image (i.e. the application selector) perform the following steps:
(Application
1. Make sure you have:
Selector)
a. A PC with Nios II Embedded Evaluation Kit, Quartus II
<version 7.2 or later> FPGA design software and Nios II EDS
<version 7.2 or later>
Altera/<version #>/kits/cycloneIII_3c25_niosII/factory_
recovery/flash_contents/cycloneIII_embedded_evaluation_kit_ap
plication_selector.sof
1 The SRAM Object File (SOF) contains a Nios II CPU which can
access and program the on-board flash.
8. From the Nios II Command Shell, program the factory image into
flash by typing the command:
Nios2-flash-programmer --base=0x04000000
restore_cycloneIII_3c25.flash
9. You should now be able to reset the board to start the application
selector.
Rebuilding the This section describes the process of rebuilding the factory recovery
image from source files. You may wish to modify and rebuild the factory
Application recovery image you’ve modified the application selector or boot code and
Selector from would like a single recovery file which includes your modifications. Keep
in mind that any modifications you make to the application selector or
Source Files boot code, may make them incompatible with existing applications.
To perform the tasks illustrated in this section, you must first open a
Nios II command shell.
Boot Code The first portion of the factory recovery image is the application boot
code, located at flash offset 0x0. Appendix B describes the functionality of
the boot code and how to rebuild it from the source files.
nios2-flash-programmer -–base=0x4000000
Hardware Image The hardware image catalog section of flash is located at offset 0x8000.
This section holds the locations of the currently cached hardware images
Catalog in flash. Any time a factory recovery is performed, this section of flash
should be erased to ensure no stale catalog entries exist. To erase this
section of flash, enter the command:
After erasing this section, you may wish to read back the erased contents
into a file, so that you can combine this file into the final factory recover
image. The command to read back this section into a file named
catalog.srec is:
Application The application selector hardware image section contains the FPGA
hardware image for the application selector utility. This section is located
Selector at flash offset 0x20000. The FPGA gets configured with this image upon
Hardware Image power-up and after a board reset. The file you will need to create this
portion of the factory recovery image is named
cycloneIII_embedded_evaluation_kit_application_selector.sof, and is located in
the application selector’s Quartus II project directory. The command
needed to create the application selector hardware portion of the factory
recovery image is:
make flash
Once “ext_flash.flash” is created, you can program it into flash with the
following command:
Combining Once you’ve created flash (or srec) files for all the sections of the factory
recovery image, you can combine them all into one file using the cat
factory recovery command:
image files cat app_selector_boot_code.srec catalog.flash appsel_hw.flash
ext_flash.flash > temp_restore.flash
However, you are still not done. Some of the individual files we combined
contained non-data records in them. Some non-data records, such as “S0”
records cannot appear anywhere in an SREC file except for the beginning,
so you want to remove all the non-data records from the final factory
recovery image. Data record types, are S1, S2, and S3, so you want to
remove all the other types of records (S0, S5, S7, S8, and S9).You can use
the command “sed” to perform this task. Use the following command to
remove all non-data records from the new factory recovery image file:
You can now restore the Embedded Evaluation Kit board to its factory
state by running the command
To generate non time limited SOF files you will need to purchase shipping
licenses for any OpenCore Plus IP cores in your system. Contact your
local sales offices to purchase the license.
http://www.altera.com/corporate/contact/con-index.html
1. For usage instructions use the LCD Touch Screen to highlight the
demonstration and press the Info button.
Where can I get full Quartus II projects and source code for
ready-to-run demonstrations?
Altera's partners can provide full Quartus II projects, source code,
development tools and even design services to get you up and running
developing products. You will find links to partners from Nios II
Embedded Evaluation Kit (NEEK), Cyclone III Edition page.
When your hardware and software image is ready you can add your
design to be loadable by the application selector by following the steps
listed in the FAQ: “How do I add my own design so the Application
Selector can find and run it?”
El Camino GmbH
Landshuter Str. 1
D-84048 Mainburg
Germany
3. Add any .JPEG or .BMP file to the “images” folder on the SD Card.
The next time you run the Picture Viewer application, these new files will
be found.
3. An SD Card reader
You will be able to download the designs to your local drive and add
them to your SD Card by placing them in the SD Card folder entitled
Altera_EEK_Appliations. The application selector should automatically
detect these new designs and load them on to your kit.
1. Using the Quartus II Programmer, configure the FPGA with the SOF
file:
altera/<version #>/kits/cycloneIII_3c25_niosII/
examples/application_selector/cycloneIII_embedded_
evaluation_kit_applicatoin_selector.sof
altera/<version #>/kits/
cycloneIII_3c25_niosII/factory_recovery/flash_cont
ents
3. In the Nios II Command Shell, program the factory image into flash
with the command:
nios2-flash-programmer base=0x04000000
restore_cycloneIII_3c25.flash
Check that either the address is correct (hex four million - i.e. 6
zeroes after the 4) or that you have two "-" characters before
"base".
4. You should now be able to reset the board to start the Application
Selector.
Revision History The table below displays the revision history for the chapters in this user
guide.
How to Contact For the most up-to-date information about Altera products, refer to the
following table:
Altera
Information Type Contact Note (1)
Technical support www.altera.com/mysupport/
Technical training www.altera.com/training/
Technical training services [email protected]
Product literature www.altera.com/literature
Product literature services [email protected]
FTP site ftp.altera.com
Note to table:
(1) You can also contact your local Altera sales office or sales representative.
Information
For More Information About Refer to
Cyclone III handbook www.altera.com/literature/lit-cyc3.jsp
Cyclone III reference designs www.altera.com/products/devkits/altera/kit-
cyc3-embedded.html
eStore if you want to purchase www.altera.com/buy/devices/buy-devices.html
devices
Cyclone III Orcad symbols www.altera.com/support/software/download/pc
b/pcbpcb_index.html
Nios® II 32-bit embedded www.altera.com/technology/embedded/emb-
processor solutions index.html
Conventions
Variable names are enclosed in angle brackets (< >) and shown in italic type.
Example: <file name>, <project name>.pof file.
Initial Capital Letters Keyboard keys and menu names are shown with initial capital letters. Examples:
Delete key, the Options menu.
“Subheading Title” References to sections within a document and titles of on-line help topics are
shown in quotation marks. Example: “Typographic Conventions.”
Courier type Signal and port names are shown in lowercase Courier type. Examples: data1,
tdi, input. Active-low signals are denoted by suffix n, e.g., resetn.
Anything that must be typed exactly as it appears is shown in Courier type. For
example: c:\qdesigns\tutorial\chiptrip.gdf. Also, sections of an
actual file, such as a Report File, references to parts of files (e.g., the AHDL
keyword SUBDESIGN), as well as logic function names (e.g., TRI) are shown in
Courier.
Authorized Distributor
Altera:
IP-NIOS