Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

Problems with programming a CFI Flash

Hello,

I have a problem to program a CFI Flash. Following is the Information output from the Nios II Flash Programmer:


Executing command: $SOPC_KIT_NIOS2/bin/bin2flash --input="D:/FileSystem.zip" --output="D:/FileSystem_cfi_flash_0.flash" --location=0x0 
--verbose 
13.01.2011 16:09:58 - (FEIN) bin2flash: Starting
13.01.2011 16:09:58 - (INFO) bin2flash: args = --input=D:/FileSystem.zip --output=D:/FileSystem_cfi_flash_0.flash --location=0x0 --verbose
13.01.2011 16:09:58 - (FEIN) bin2flash: Done
Executing command: $SOPC_KIT_NIOS2/bin/nios2-flash-programmer "D:/FileSystem_cfi_flash_0.flash" --base=0x0 --accept-bad-sysid --device=1 
--instance=0 '--cable=USB-Blaster on localhost ' --program --verbose 
Using cable "USB-Blaster ", device 1, instance 0x00
Resetting and pausing target processor: OK
Found CFI table in 16 bit mode
Raw CFI query table read from device:
   0: 20 00 D7 22 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 40 00 00 00 00 00  Q.R.Y.....@.....
  30: 00 00 00 00 00 00 27 00  36 00 00 00 00 00 04 00  ......'.6.......
  40: 00 00 0A 00 00 00 04 00  00 00 03 00 00 00 14 00  ................
CFI query table read from device:
  10: 51 52 59 02 00 40 00 00  00 00 00 27 36 00 00 04  QRY..@.....'6...
  20: 00 0A 00 04 00 03 00 14  02 00 00 00 04 00 00 40  ...............@
  30: 00 01 00 20 00 00 00 80  00 0E 00 00 01 FF FF FF  ... ............
CFI extended table read from device:
   0: 50 52 49 31 30 00 02 01  01 04 00 00 00 FF FF 03  PRI10...........
  10: FF FF FF FF FF FF FF FF  FF FF FF FF FF FF FF FF  ................
Device size is 1MByte
Erase regions are:
  offset        0:  15 x 64K
  offset    F0000:   1 x 32K
  offset    F8000:   2 x 8K
  offset    FC000:   1 x 16K
Device supports AMD style programming algorithm
Multi-byte programming not supported
Sector erase timeout is 8s
Word program timeout is 256us
              : Checksumming existing contents          
00000000      : Checksum failed - needs program
00010000      : Checksum failed - needs program
00020000      : Checksum failed - needs program
00030000      : Checksum failed - needs program
Checksums took 0.5s                                        
Erase not required
00000000 ( 0%): Programming                             
Program sequence:
  Write address 0x00000000 <= 0xF0
  Write address 0x0000AAAA <= 0xAA
  Write address 0x00005554 <= 0x55
  Write address 0x0000AAAA <= 0xA0
  Write address 0x00000000 <= 0x4B50
  Read  address 0x00000000 => 0xFF
Program failed at offset 0                                         
Leaving target processor paused
Finished executing commands.
Error code: 4 for command: $SOPC_KIT_NIOS2/bin/nios2-flash-programmer "D:/FileSystem_cfi_flash_0.flash" --base=0x0 --accept-bad-sysid 
--device=1 --instance=0 '--cable=USB-Blaster on localhost ' --program --verbose 
In the datasheet from the M29W800DT Flash the Program sequence looks at the end different, I attached it from the datasheet. Maybe thats the problem? Or has anybody an Idea?

Thank you very much!

[EDIT]

The developement Board DE2 has a S29AL032D flash, which works fine. I attached the comparision with both flashs. On the attachement, the flash above dosn't work, the flash below works fine.

[/EDIT]

14 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thank you for the reply!

    I tried everything with the setup, hold, wait time, but same issue.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Hans75,

    I'm facing a similar problem... :mad:

    Have you solved yours?

    Ciao
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

    I am also facing the same issue... I am not able to flash using the nios2-flash-programmer.exe, please find the below error message

    [NiosII EDS]$ nios2-flash-programmer.exe --base=0x0 cfi_flash_0.flash --cable=usb-blaster

    using cable "usb-blaster [usb-0]", device 1, instance 0x00

    resetting and pausing target processor: ok

    checksummed/read 12kb in 0.3s

    erased 128kb in 0.6s (213.3kb/s)

    program failed

    leaving target processor paused

    I am using a single threaded, sequential OS less environment in my project. I am unable to get the program flashed... please advice..

    your help is greatly appreciated.

    Thanks,

    Kiran Kumar
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    As suggested by waiyung, I solved my problem setting following timings, despite as suggested by flash memory datasheet:

    # define CFI_FLASH_HOLD_VALUE 50

    # define CFI_FLASH_SETUP_VALUE 50

    # define CFI_FLASH_WAIT_VALUE 160.

    For example wait time should be set to 90/100 but we need 160. I faced that working in debug mode memory requires wait time greater than one required in usual operation (not run and not debug mode).

    Bye bye