Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12748 Discussions

CFI and different Command Definition Tables

Altera_Forum
Honored Contributor II
1,985 Views

I am having problems using Quartus Flash Programmer to erase/program CFI flash made by Atmel. 

 

I have a single 64 megabit chip at49bv6416 on my board hooked up to Nios II using Avalon bus and it uses 16-bit data bus. 

I know it has a different Command Definition Table than a similar 64 megabit, also CFI compatible chip made by AMD (am29lv640mh). 

 

For example, "Program Word" command for Atmel chip is following sequence: 

555/aa 

aaa/55 

555/a0 

for AMD chip the sequence is: 

555/aa 

2aa/55 

555/a0 

 

how the quartus flash programmer "knows" what sequence to use for my chip ? 

 

Command values does not seem to be coded in CFI table... 

Do I configure it in some quartus/project file to match my flash chip?
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
902 Views

Have you looked at the flash programmer user's guide (http://www.altera.com/literature/ug/ug_nios2_flash_programmer.pdf). 

 

You may be able to define an override to get your CFI "compliant" flash to function. 

 

- slacker
0 Kudos
Altera_Forum
Honored Contributor II
902 Views

Yes, I have looked in this file and I learned something new: I can use Flash Programmer in command-line mode to display some more debug messages. 

Here is my output from the program for my board: 

 

Using cable "USB-Blaster ", device 1, instance 0x01 Resetting and pausing target processor: OK Reading System ID at address 0x00900BC8: verified Found CFI table in 16 bit mode Raw CFI query table read from device:   0: 1F 00 D6 00 FF FF FF FF  FF FF FF FF FF FF FF FF  ................  10: FF FF FF FF FF FF FF FF  FF FF FF FF FF FF FF FF  ................  20: 51 00 52 00 59 00 02 00  00 00 41 00 00 00 00 00  Q.R.Y.....A.....  30: 00 00 00 00 00 00 27 00  36 00 09 00 0A 00 04 00  ......&#39;.6.......  40: 00 00 09 00 10 00 04 00  00 00 03 00 03 00 17 00  ................ CFI query table read from device:  10: 51 52 59 02 00 41 00 00  00 00 00 27 36 09 0A 04  QRY..A.....&#39;6...  20: 00 09 10 04 00 03 03 17  01 00 00 00 02 7E 00 00  .............~..  30: 01 07 00 20 00 FF FF FF  FF FF FF FF FF FF FF FF  ... ............  40: FF                                                . CFI extended table read from device:   0: 50 52 49 31 30 AF 01 00  01 80 03 03 FF FF FF FF  PRI10...........  10: FF FF FF FF FF FF FF FF  FF FF FF FF FF FF FF FF  ................ Read autoselect code 001F-00D6 (in 16 bit mode) No CFI override data for Device size is 8MByte Erase regions are:  offset        0: 127 x 64K  offset   7F0000:   8 x 8K Device supports AMD style programming algorithm Multi-byte programming not supported Sector erase timeout is 4s Word program timeout is 256us              : Checksumming existing contents 00200000      : Checksum failed - needs erase then program 00210000      : Checksum failed - needs erase then program 00220000      : Checksum failed - needs erase then program 00230000      : Checksum failed - needs erase then program 00200000      : Reading existing contents 00210000      : Reading existing contents 00220000      : Reading existing contents 00230000      : Reading existing contents Checksummed/read 14kB in 0.4s 00200000 ( 0%): Erasing 00210000 (25%): Erasing 00220000 (50%): Erasing 00230000 (75%): Erasing Erased 256kB in 0.0s 00200000 ( 0%): Programming Program sequence:  Write address 0x00000000 <= 0xF0  Write address 0x0000AAAA <= 0xAA  Write address 0x00005554 <= 0x55  Write address 0x0000AAAA <= 0xA0  Write address 0x00200010 <= 0xD76A  Read  address 0x00200010 => 0xE4 Program failed at offset 200010 Leaving target processor paused  

 

Doing this, I can see the wrong program sequence is used, but I am not sure how to change it to the correctl one. Yes, I can override CFI table using --override=<filename> parameters, but how do I find numbers for CFI table to override? 

 

Any ideas ?
0 Kudos
Altera_Forum
Honored Contributor II
902 Views

Get out your datasheet and compare the read CFI table values with what should be there. Use the override table to "replace" these bad values for (in your case) FLASH-001F-00D6. 

 

You might be able to find some examples of doing this, on this forum, or, if not, definitely on Altera&#39;s website. 

 

Best of luck and good job using the --debug option. I&#39;m sorry I didn&#39;t recommend it to you, in the first place. 

 

Cheers, 

 

- slacker
0 Kudos
Reply