--- Quote Start ---
Are you sure that the EPCS is working properly?
--- Quote End ---
Yes, before using NIOSII i set up a simple fpga configuration which flashes some LEDs. I wrote the design to the EPCS device and repower the fpga. The design was loaded from the epcs and the LEDs where flashing.
--- Quote Start ---
You can use the Quartus programmer, upload an SFL image (you should find as ready compiled one as
C:\altera\xx.x\quartus\common\devinfo\programmer\sfl_fpga_name.sof) and then do a new autodetect. Then it should show you the EPCS connected to the FPGA. Using a scope you should see the EPCS lines toggling and use it as a reference.
--- Quote End ---
Ok I've done this and it works. The EPCS16 device was detected properly and the epcs clock line has activity.
--- Quote Start ---
Once you have that working you know that the communication between the EPCS and the FPGA is working properly and can focus on the Nios II flash programmer.
The only two explanations I can think of for your problem would be wrong pin assignment (chip select instead of clock, for example)
--- Quote End ---
I checked the pin assignement against the schematic of the board and against "Pin Information for the Cyclone ® III EP3C16 Device Version 1.3". It seems to be Okay.
- dclk -> K2 (DCLK)
- sdo -> D1 (DATA1, ASDO)
- data0 -> K1 (DATA0)
- sce -> E2 (FLASH_nCE, nCSO)
--- Quote Start ---
[...] or wrong EPCS controller address. As long as you are sure that the image in the FPGA matches the .sopcinfo file that the Nios Flash programmer uses (which it should, now that you have enabled the system ID check) you should have the correct EPCS controller address so I don't understant why the EPCS lines aren't even toggling.
--- Quote End ---
In Qsys the mapping of the epcs controller is 0x21800-0x21fff. This seems to be the same for the flash-programmer.
Maybe i use the flash-rpgrammer incorrect. Here is my workflow:
[list]
[*]at first i use the quartus programmer to erase the EPCS device
[*]now i load the fpga configuration (*.sof file) with the quartus programmer via jtag into the fpga
[*]i choose "Run As -> NIOSII Hardware" from the Eclipse project menu
[*]now the system is running in the fpga (not written in the epcs -> volatile)
[*]i click "Terminate and Remove Launch" in the NIOSII console window to release the USB Blaster
[*]i choose "NIOS II -> Flash Programmer" from the Eclipse project menu
[*]after selecting "File -> New" i select hte *.sopcinfo file
[*]i add the *.sof file
[*]i add the *.elf file
[*]i cklick start
[/list]
There was no activity at the clock lines. I noticed, that the system on the fpga was stopped.
This is the output of the flash programmer:
Info: 23.04.2013 15:04:07 - (FEIN) sof2flash: Starting
Info: Info: *******************************************************************
Info: Info: Running Quartus II 32-bit Convert_programming_file
Info: Info: Command: quartus_cpf --no_banner --convert --device=EPCS128 --option=Y:/TLK2711-SP/Terasic_DE0/NIOS_SYSTEM/flash/NIOS_SYSTEM_epcs.opt Y:/TLK2711-SP/Terasic_DE0/NIOS_SYSTEM/NIOS_SYSTEM.sof Y:/TLK2711-SP/Terasic_DE0/NIOS_SYSTEM/flash/NIOS_SYSTEM_epcs.pof
Info: Info: Quartus II 32-bit Convert_programming_file was successful. 0 errors, 0 warnings
Info: Info: Peak virtual memory: 126 megabytes
Info: Info: Processing ended: Tue Apr 23 15:04:16 2013
Info: Info: Elapsed time: 00:00:09
Info: Info: Total CPU time (on all processors): 00:00:02
Info: Info: *******************************************************************
Info: Info: Running Quartus II 32-bit Convert_programming_file
Info: Info: Command: quartus_cpf --no_banner --convert Y:/TLK2711-SP/Terasic_DE0/NIOS_SYSTEM/flash/NIOS_SYSTEM_epcs.pof Y:/TLK2711-SP/Terasic_DE0/NIOS_SYSTEM/flash/NIOS_SYSTEM_epcs.rpd
Info: Info: Quartus II 32-bit Convert_programming_file was successful. 0 errors, 0 warnings
Info: Info: Peak virtual memory: 126 megabytes
Info: Info: Processing ended: Tue Apr 23 15:04:31 2013
Info: Info: Elapsed time: 00:00:15
Info: Info: Total CPU time (on all processors): 00:00:02
Info: 23.04.2013 15:04:33 - (FEIN) sof2flash: Done
Info: Using cable "USB-Blaster ", device 1, instance 0x00
Info: Resetting and pausing target processor: OK
Info: Reading System ID at address 0x00022080: verified
Info: Processor data bus width is 32 bits
Info: Looking for EPCS registers at address 0x00021800 (with 32bit alignment)
Info: Initial values: 0001703A 04C00074 9801483A 9CFFF804 983FFD1E 0000203A
Info: Not here: reserved fields are non-zero
Info: Looking for EPCS registers at address 0x00021900 (with 32bit alignment)
Info: Initial values: 92400237 4A40100C 483FFD26 90000135 92400237 4A40200C
Info: Not here: reserved fields are non-zero
Info: Looking for EPCS registers at address 0x00021A00 (with 32bit alignment)
Info: Initial values: 108001C4 1004D0FA 002EE03A 003F9C06 002EE03A 003F9506
Info: Not here: reserved fields are non-zero
Info: Looking for EPCS registers at address 0x00021B00 (with 32bit alignment)
Info: Initial values: 00000000 00000000 00000000 00000000 00000000 00000000
Info: Not here: SPI_SLAVE_SEL has 0 valid bits (should be between 1 and 16)
Info: Looking for EPCS registers at address 0x00021C00 (with 32bit alignment)
Info: Initial values: 00000014 00000014 00000260 00000000 00000014 00000001
Info: Not here: reserved fields are non-zero
Info: No EPCS registers found: tried looking at addresses
Info: 0x00021800, 0x00021900, 0x00021A00, 0x00021B00 and 0x00021C00
Info: Leaving target processor paused
Error: Error code: 8 for command: $SOPC_KIT_NIOS2/bin/nios2-flash-programmer "Y:/TLK2711-SP/Terasic_DE0/NIOS_SYSTEM/flash/NIOS_SYSTEM_epcs.flash" --base=0x21800 --epcs --sidp=0x22080 --id=0x16 --timestamp=1366718316 --device=1 --instance=0 '--cable=USB-Blaster on localhost ' --program --verbose