Building application selector from source files, Build the project, Building application selector from source files –4 – Altera Embedded Systems Development Kit, Cyclone III Edition User Manual

Page 52

Advertising
background image

Altera Corporation

Development Board Version 1.0.

8–4

July 2010

Altera Embedded Systems Development Kit, Cyclone III Edition

Application Selector Details

The flash hardware image catalog is a simple database which keeps track
of what application hardware images are currently stored (cached) in
flash. The flash catalog is located in sector 1 of the flash at offset 0x8000,
and is 0x8000 (32K) bytes long. The catalog mechanism uses a scheme
referred to as "Zero = Spent, 'F' = Available", or ZSFA. This scheme avoids
erasing entire flash sectors when only a few words need to be written to
the flash. Using ZSFA, a word in the flash which is 0x0 is considered spent
and cannot be used to store data. A word which is 0xFFFFFFFF is
available

since it is in its erased state. Every other value is considered a

valid entry in the catalog.

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.

Building
Application
Selector from
Source Files

The first thing that’s needed to build the software project is a board
support package (BSP). To create a BSP perform these steps:

1.

Open a Nios II Command Shell.

2.

Change to the directory:

altera

/<version>/kits/cycloneIII_3C120_embeddedl/examples/

application_selector/software_examples/ bsp/
ucosii_application_selector

3.

Run the command ./create_this_bsp.

Build the project

The next step is to build the Application Selector project. To build the
project, perform these steps:

1.

In the Nios II Command Shell, change to the directory:

Advertising