Forum Discussion

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

EPCS Flash Access on DE0 Nano (Qsys)

Hello,

I'm having trouble accessing the EPCS Flash on a new DE0 Nano board. I've set up a Nios II system in Qsys and included the EPCS Serial Flash Controller. (Other system components include the UP Clock Signals for SDRAM Clock, SDRAM Controller, Sys ID, JTAG UART, and Interval Timer). At this point I'm just trying to make sure I can communicate with the flash using the nios2-flash-programmer (with --epcs and --debug flags). The EPCS reset is connected to both the clk_reset (reset output from clock source) and jtag_debug_module_reset from Nios II; the epcs_control_port is connected to both data master and instruction master ports on the Nios II CPU. I've tried setting CPU reset & exception vectors to either SDRAM (this allows the processor to run & code to execute, but no flash access), or to EPCS (which results in the Nios Console view in Eclipse not loading, and the program fails to launch).

The board does have the newer 64Mbit flash chip, and I've included the override file with an entry for [EPCS-010216]. I am specifying the base address as given in the address map in Qsys. I have modified the pin settings for DATA[0], DCLK, DATA[1]/ASDO, and FLASH_nCE/NCSO as regular I/O (as instructed in the Embedded Peripherals Guide for EPCS Serial Flash Controller Core). I have also exported the EPCS conduit to the top level and assigned the appropriate pins in the pin planner.

The exact output is as follows:

$ nios2-flash-programmer --epcs --debug --base=0x4001000 --verbose
Reading override file "C:/altera/12.1sp1/nios2eds/bin/nios2-flash-override.txt"
Using cable "USB-Blaster ", device 1, instance 0x00
Resetting and pausing target processor: OK
Processor data bus width is 32 bits
Looking for EPCS registers at address 0x04001000 (with 32bit alignment)
  Initial values: 0001703A 04C00074 9801483A 9CFFF804 983FFD1E 0000203A
  Not here: reserved fields are non-zero
Looking for EPCS registers at address 0x04001100 (with 32bit alignment)
  Initial values: 93000237 6300080C 603FFD26 90000335 A8000C26 03010004
  Not here: reserved fields are non-zero
Looking for EPCS registers at address 0x04001200 (with 32bit alignment)
  Initial values: 4A40100C 483FFD26 92C00135 92400237 4A40200C 483FFD26
  Not here: reserved fields are non-zero
Looking for EPCS registers at address 0x04001300 (with 32bit alignment)
  Initial values: 00000000 00000000 00000000 00000000 00000000 00000000
  Not here: SPI_SLAVE_SEL has 0 valid bits (should be between 1 and 16)
Looking for EPCS registers at address 0x04001400 (with 32bit alignment)
  Initial values: 00000000 00000000 00000260 00000000 00000000 00000001
  Valid registers found
EPCS signature is 0x00
EPCS identifier is 0x000000
No EPCS layout data - looking for section 
Unable to use EPCS device
Leaving target processor paused

I've tried with the tools in Quartus 11 Subscription Edition, 12.0 Web Edition, and 12.1 Web Edition, so I assume it's not a tool version problem. I am running these on Win7 x64 SP1.

I'm porting this from a design on the DE0 (cyclone III) that ran fine (but used a CFI flash). Eventually I'd like to store the FPGA configuration, the C code, and some static lookup tables in the left over room. For now I'd just like to be able to ensure communication is working.

I've tried most if not all the troubleshooting steps in the other similar posts. I'm sure I'm missing something simple here. Any ideas?

Thank you in advance!

7 Replies

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

    I am having the same problem with DE0-nano board (Spansion EPCS). 0x00 signature and 0x000000 ID. Any luck with the solution?

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

    Ah, my problem was in not properly connecting the EPSC data0 port to the appropriate pin. It did cause two compile time warnings. Too bad those got buried together with 20 other warnings.

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

    --- Quote Start ---

    Ah, my problem was in not properly connecting the EPSC data0 port to the appropriate pin. It did cause two compile time warnings. Too bad those got buried together with 20 other warnings.

    --- Quote End ---

    Does your DE0 nano have the EPCS64 Spansion chip? I still haven't found a solution, I've had to put the project on the backburner..
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Does your DE0 nano have the EPCS64 Spansion chip? I still haven't found a solution, I've had to put the project on the backburner..

    --- Quote End ---

    Yes, it has a 64Mb Spansion chip.

    Try first with the project in Demonstration\DE0_Nano_SOPC_DEMO. It is critical that at the time of flashing your board runs a working nios II project with EPSC interface.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    To support newly released flash memory devices which might have problems in the

    CFI table, the Nios II Flash Programmer provides the ability to override CFI table

    entries with flash override files. A flash override file lets you manually override

    erroneous information in the CFI table, which enables the Nios II Flash Programmer

    to function correctly.

    you will need to create a text file that includes the missing informations:

    <nios2_install>/bin/nios2-flash-override.txt

    For example for DE0 NANO:

    [EPCS-010216]# EPCS64N (Spansion-lead-free) S25FL064P

    sector_size = 65536

    sector_count = 128
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    To support newly released flash memory devices which might have problems in the

    CFI table, the Nios II Flash Programmer provides the ability to override CFI table

    entries with flash override files. A flash override file lets you manually override

    erroneous information in the CFI table, which enables the Nios II Flash Programmer

    to function correctly.

    you will need to create a text file that includes the missing informations:

    <nios2_install>/bin/nios2-flash-override.txt

    For example for DE0 NANO:

    [EPCS-010216]# EPCS64N (Spansion-lead-free) S25FL064P

    sector_size = 65536

    sector_count = 128

    --- Quote End ---

    Thank you for the reply. However, as I stated in the original post, I already used that flash override file, which resulted in the output included in the original post. Please let me know if I've missed something else; I'm sure it's a small error but I can't find it. If anyone has a sample Quartus+Qsys project for this they could share that would be wonderful.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Rob,

    I have the same problem with you. Have you already solved the problem? How did you do it?