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++
12603 Discussions

Does anyone have success on programing EPCQ in Q16.0 with nios2-flash-programmer?

Altera_Forum
Honored Contributor II
1,839 Views

I'm working on a Cyclone V GX Custom Kit with EPCQ256 and Altera Serial Flash Controller Core NOT Legacy EPCS/EPCQx1 Flash Controller. 

 

Programming EPCQ with .jic is fine, boot from EPCQ both hardware and software seem ok, but not 100% functional, I think the copy rwdata from EPCQ to OCRAM might have some flaws. 

So I need to debug it with Execte-In-Place Method, If the .hex in .jic is same as my NIOS .elf the debug will be going without problem. 

But every time I changed the source code, I had to rebuild .hex, repack it into .jic and download it by Quartus programmer again, it's really time consuming. 

 

In order to be more inefficient, I'm trying to update EPCQ256 with nios2-flash-programmer. 

 

I was trying to use the flowing command, but failed with No EPCS registers found. 

There were tons of No EPCS registers found explained in this forum, but most latest solution were only related to Q13.0 and even ancient Q10.0, not help at all. 

So anyone has any idea?  

----------------------------------------------------------- 

$nios2-flash-programmer "REMOTE_epcq_controller_0_avl_mem.flash" --epcs --base=0x02000000 --sidp=0x4081860 --id=0x55 --timestamp=1469103213 --device=1 --instance=0 '--cable=USB-Blaster on localhost ' --program --verbose --erase-all --debug Using cable "USB-Blaster ", device 1, instance 0x00 Resetting and pausing target processor: OK Reading System ID at address 0x04081860: verified Processor data bus width is 32 bits Looking for EPCS registers at address 0x02000000 (with 32bit alignment) Initial values: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF Not here: reserved fields are non-zero Looking for EPCS registers at address 0x02000100 (with 32bit alignment) Initial values: FFFF8F98 FFFFAF1B FFFFAF90 FFFFCFF2 FFFFEF59 FFFF2F18 Not here: reserved fields are non-zero Looking for EPCS registers at address 0x02000200 (with 32bit alignment) Initial values: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF Not here: reserved fields are non-zero Looking for EPCS registers at address 0x02000300 (with 32bit alignment) Initial values: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF Not here: reserved fields are non-zero Looking for EPCS registers at address 0x02000400 (with 32bit alignment) Initial values: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF Not here: reserved fields are non-zero No EPCS registers found: tried looking at addresses 0x02000000, 0x02000100, 0x02000200, 0x02000300 and 0x02000400 Leaving target processor paused  

----------------------------------------------- 

And a very strange thing, the Nios II Flash Programmer GUI generate some scripts that would only work for CFI FLASH 

See, there is not --epcs/epcq arguments at all. I guess nios2-flash-programmer can only cope with Legacy EPCS/EPCQx1 Flash Controller. 

I think the whole EPCS tool set must be broken. 

 

http://www.alteraforum.com/forum/attachment.php?attachmentid=12476&stc=1  

 

 

----------------------------------------------- 

Another thing, for this application note 

https://www.altera.com/en_us/pdfs/li...e/an/an736.pdf (https://www.altera.com/en_us/pdfs/literature/an/an736.pdf

 

Boot NIOS from EPCQ flash: 

 

"HELLO WORLD!" Demo is OK. 

uc/os II BSP did not work. 

 

Settings.Advanced.hal.linker: 

• allow_code_at_reset 

• enable_alt_load 

• enable_alt_load_copy_rodata gray out in uc/os II bsp 

• enable_alt_load_copy_rwdata gray out in uc/os II bsp 

• enable_alt_load_copy_exceptions gray oute in uc/os II bsp 

 

-------------------QSYS struct looks like this--------------------------------------------------- 

Configuration device: 5CGXFC9E6 EPCQ256 

Configuration mode: Active Serial x4 

Reset vector offset:0x00D00000 

http://www.alteraforum.com/forum/attachment.php?attachmentid=12477&stc=1  

http://www.alteraforum.com/forum/attachment.php?attachmentid=12467&stc=1  

http://www.alteraforum.com/forum/attachment.php?attachmentid=12478&stc=1
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
518 Views

I can't edit my original post due to the PHP exceptions. 

I post the larger version of QSYS here for reference.
0 Kudos
Altera_Forum
Honored Contributor II
518 Views

Can you try using Quartus II Programmer instead of Nios II Flash Programmer to program the .jic file?

0 Kudos
Altera_Forum
Honored Contributor II
518 Views

 

--- Quote Start ---  

Can you try using Quartus II Programmer instead of Nios II Flash Programmer to program the .jic file? 

--- Quote End ---  

 

 

Yes, I have found a way around the Nios II Flash Programmer, I have thought the .jic would erase the whole EPCQ chip before programming any new data, but actually it only erase the part where needed.
0 Kudos
Altera_Forum
Honored Contributor II
518 Views

Did you managed to resolve your problem? How do you do that?

0 Kudos
Altera_Forum
Honored Contributor II
518 Views

Yes, I did. In fact, the tutorial was wrong. You need to uncheck everything in BSP EDITOR, otherwise you will not be able to debug or download your NIOS SW through jtag if your reset vector is set to epcq. 

 

https://www.alteraforum.com/forum/attachment.php?attachmentid=13084  

https://www.alteraforum.com/forum/attachment.php?attachmentid=13085  

https://www.alteraforum.com/forum/attachment.php?attachmentid=13086  

 

Then download the jic file through Programmer. That's all. 

 

Good day!
0 Kudos
Reply