Nios编程:No CFI table found问题的解决

写入flash程序的时候,系统提示:

[SOPC Builder]$ nios2-flash-programmer --device=1 --instance=0 --base=0x0000000
0 cfi_flash_Share.flash
Using cable "ByteBlasterII [LPT1]", device 1, instance 0x00
Resetting and pausing target processor: OK
No CFI table found at address 0x00000000
Leaving target processor paused 

鼓捣了半天都没有成功,没办法只得查看《Nios II Flash Programmer User Guide》--altera,后面附录一节很详细。

When you run the flash programmer to program CFI flash memory, you
get the error: "No CFI table found at address "
Probable Cause
The flash programmer can connect with a Nios II JTAG debug module in
the FPGA, but it can not successfully execute a query to a flash memory
at the base address specified.
Suggested Actions
■ If you are using nios2-flash-programmer in command-line mode,
make sure you specified the correct base address for the CFI device.
You can find the flash memory's base address in SOPC Builder.
■ Run nios2-flash-programmer in command-line mode with the
--debug parameter. This command dumps the flash memory's
query table. Compare the output with the flash memory device's
data sheet. For further details, see Chapter 3, Using the Flash
Programmer in Command-Line Mode.
■ Ensure your flash memory hardware is correctly connected to place
it at the base address specified in SOPC Builder. Verify the base
address by running the "Test Flash" routine in the "Memory Test"
software template provided in the Nios II IDE. If the test fails, there
is a problem with your memory connection. There are two places to
look for the problem:
● The physical connection on your target board
● The pin assignments on the top-level FPGA design
■ If all else fails, make sure the flash memory device you are using does
not require an override file. See Appendix A, Non-Standard Flash
Memories for details.

后来只得参考flash datasheet编写了,override file:下面是我编写的override文件(my_override.txt):

[FLASH-0001-227E] # 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[0x10] = 0x51
CFI[0x11] = 0x52
CFI[0x12] = 0x59
CFI[0x13] = 0x02 # The primary command set, found at CFI table -
CFI[0x14] = 0x00 # addresses 0x13 and 0x14 is overridden to 0x02, 0x00.
CFI[0x15] = 0x40
CFI[0x16] = 0x00
CFI[0x17] = 0x00
CFI[0x18] = 0x00
CFI[0x19] = 0x00
CFI[0x1A] = 0x00
CFI[0x1B] = 0x27
CFI[0x1C] = 0x36
CFI[0x1E] = 0x00
CFI[0x1F] = 0x07
CFI[0x20] = 0x07
CFI[0x21] = 0x0A
CFI[0x22] = 0x00
CFI[0x23] = 0x03
CFI[0x24] = 0x05
CFI[0x25] = 0x04
CFI[0x26] = 0x00
CFI[0x27] = 0x1A
CFI[0x28] = 0x02
CFI[0x29] = 0x00
CFI[0x2A] = 0x05
CFI[0x2B] = 0x00
CFI[0x2C] = 0x01 # The number of CFI Erase block regions, found at
# CFI table –address 0x2C is overridden to 0x1.
CFI[0x2D] = 0xFF
CFI[0x2E] = 0x01
CFI[0x2F] = 0x00
CFI[0x30] = 0x02

CFI[0x31] = 0x00
CFI[0x32] = 0x00
CFI[0x33] = 0x00
CFI[0x34] = 0x00

CFI[0x35] = 0x00
CFI[0x36] = 0x00
CFI[0x37] = 0x00
CFI[0x38] = 0x00

CFI[0x39] = 0x00
CFI[0x3A] = 0x00
CFI[0x3B] = 0x00
CFI[0x3C] = 0x00

CFI[0x40] = 0x50
CFI[0x41] = 0x52
CFI[0x42] = 0x49

CFI[0x43] = 0x31
CFI[0x44] = 0x33
CFI[0x45] = 0x10

CFI[0x46] = 0x02
CFI[0x47] = 0x01
CFI[0x48] = 0x00
CFI[0x49] = 0x08
CFI[0x4A] = 0x00
CFI[0x4B] = 0x00
CFI[0x4C] = 0x02
CFI[0x4D] = 0xB5
CFI[0x4E] = 0xC5
CFI[0x4F] = 0x04
CFI[0x50] = 0x01

nios2-flash-programmer --device=1 --instance=0 --base=0x00000000 --override=my_override.txt cfi_flash_Share.flash  写入成功,这个flash编程器可真够烦人的,幸好提供了重构cfi table功能.

Ref:
《Nios II Flash Programmer User Guide》--altera
《S29GL-N MirrorBit? Flash Family Data Sheet》--AMD & Fujitsu

你可能感兴趣的:(集成电路及CPU设计)