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

Erasing/Programming EPCS via NIOS

Altera_Forum
Honored Contributor II
1,469 Views

I using a CYCLONE 1C12 with an EPCS 1C4 device. I have built a nios system and I am trying to download to my EPCS device via the JTAG. I have set the "Reset Address" to the EPCS_controller. I tried to download via the IDE Flash Programmer, it didn't work. Before I tried, I Programed the .SOF via the JTAG using the quartus programmer and was able to test some of the stand alone functionality of my logic (i.e. that was not micro-processor related). I then was able to download and run a simple program both into on board dual port ram and also SRAM and it ran correctly. However when I tried to download and store the code to the EPCS device I got the following errors : 

# Programming flash with the FPGA configuration 

$SOPC_KIT_NIOS2/bin/nios2-flash-programmer --epcs --base=0x00060800 M4K1553PxIII.flash 

Using cable "ByteBlasterMV [LPT1]", device 1, instance 0x00 

Resetting and pausing target processor: OK 

No EPCS layout data - looking for section [EPCS-202013] 

Unable to use EPCS device 

Leaving target processor paused 

# Programming flash with the project 

$SOPC_KIT_NIOS2/bin/nios2-flash-programmer --epcs --base=0x00060800 epcs_controller.flash 

Using cable "ByteBlasterMV [LPT1]", device 1, instance 0x00 

Resetting and pausing target processor: OK 

No EPCS layout data - looking for section [EPCS-202013] 

Unable to use EPCS device 

Leaving target processor paused 

 

To check the connection between the CYCLCONE device and the EPCS I did a AS programming and I was able to configure the CYCLONE device using the .POF file successfully.  

 

Then I tried to simply erase the EPCS via the JTAG and EPCS bridge using the command below in the SDK shell. I received the following errors:- 

 

nios2-flash-programmer --epcs -base=0x00060800 --erase-all 

Using cable "ByteBlasterMV [LPT1]", device 1, instance 0x00 

Resetting and pausing target processor: OK 

No EPCS registers found: tried looking at addresses 

0x000000A, 0x000010A, 0x000020A, 0x000030A and 0x000040A 

Leaving target processor paused 

 

I carried out the same command with the --debug option and got the following results 

 

......... 

......... 

Looking for EPCS registers at addresses 0x0000000A (with 32bit alignment) 

intial values: xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx (where x = garbage) 

Not here:reserved fields are non-zero 

Looking for EPCS registers at addresses 0x0000010A (with 32bit alignment) 

intial values: xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx (where x = garbage) 

Not here:reserved fields are non-zero 

......... 

........ 

etc 

 

Does anyone have ANY ideas or suggestions ?From the messages that I got from teh debugger it seems that it is reading some memory somewhere. I checked the location of the EPCS controller in the SOPC builder and it was correct !
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
366 Views

Hi, 

 

I have the same problem here but I didn't go into that detail as you already did. I rather decided to submit a service request to Altera in order to have them put hands on that issue. In my case, we were running fine with programming the EPCS devices through JTAG so far. Then we got new devices (same type/model) in and we started to face this problem. I mean, we have proof that it basically works. There might be some minor changes that we probably missed. I also double-checked the design and configuration and ended up finding nothing. To work around that problem for a while we were trying to find a way to programm the EPCS device through AS since this still works. But unfortunately it seems like there's no way to get the actual NIOS II code through that interface. The one and only way seems to be JTAG -> FPGA -> EPCS? Or does anybody know how to convert and include an .elf file (NIOS II binary) into a .pof file which I can eventually program onto the EPCS device? 

 

Folks, whenever I have new from Altera I keep you updated! 

 

Steffen
0 Kudos
Altera_Forum
Honored Contributor II
366 Views
0 Kudos
Altera_Forum
Honored Contributor II
366 Views

Hi Guys, 

 

I have just seen this issue with an EPCS64N device! 

 

Any thoughts. 

 

Regards, 

 

David
0 Kudos
Altera_Forum
Honored Contributor II
366 Views

Just had this problem 10 years later. The solution is to specify the command correctly. 

 

nios2-flash-programmer --epcs -base=0x00060800 --erase-all  

 

is wrong because -base looks to the programmer like -b at address "a". It should be (note --base): 

 

nios2-flash-programmer --epcs --base=0x00060800 --erase-all
0 Kudos
Reply