beautypg.com

How to use the flash override file, Width mode override parameter – Altera Nios II User Manual

Page 26

background image

A–2

Appendix A: Non-Standard Flash Memories

Width Mode Override Parameter

Nios II Flash Programmer User Guide

© March 2014

Altera Corporation

For example, the SST 39VF800 flash memory contains three incorrect entries in its CFI
table at location 0x13, 0x14, and 0x2C. The following example demonstrates how to
override the values at those addresses.

[FLASH-00BF-2781] # Keyword FLASH, followed by the Mfgr ID and Device ID

# These ID values can be found in three ways:
# -by consulting the flash memory device's data sheet.
# -by using the "autoselect" command
# -by running nios2-flash-programmer --debug

CFI[0x13] = 0x02

# The primary command set, found at CFI table -

CFI[0x14] = 0x00

# addresses 0x13 and 0x14 are overridden to
#

0x02, 0x00.

CFI[0x2C] = 0x01

# The number of CFI Erase block regions, found at
# CFI table –address 0x2C is overridden to 0x1.

1

This example is for illustration only. nios2-flash-programmer recognizes the SST
39VF800 as a nonstandard CFI device and overrides its CFI table. You do not need to
create an override file for this particular part.

How to Use the Flash Override File

There are two ways to deploy flash override files:

1. Place the override file in /bin. The Nios II Flash

Programmer searches this directory for all filenames matching the pattern nios2-
flash-override*

. The flash programmer loads all these files as override files.

2. Pass the override file to the flash programmer with the --override parameter.

The following example illustrates this parameter:

nios2-flash-programmer --base 0x0 -–override=my_override.txt sw.flash

Width Mode Override Parameter

The override procedure described in

“Flash Override Files”

assumes the Nios II Flash

Programmer detects the correct data-width mode from the CFI query table. In some
cases, a 16-bit CFI flash memory device wired in 8-bit mode might return a query
table indicating 16-bit mode. This condition prevents the flash programmer from
correctly interpreting the remainder of the query table. The flash programmer cannot
detect this situation, because the device type is unreadable. If your flash memory
device has this problem, you must program it from the command line.

In this case, override the data width on the command line with the hidden parameter
--width=8

.

This parameter is known to be necessary for only two flash memory devices: the ST
Micro ST29W800 and ST29W640. Unless you are using these devices, you are unlikely
to require this parameter.