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

Booting from EPC4

Altera_Forum
Honored Contributor II
1,311 Views

Hi all, 

 

Can I ask - is there a simple way to generate the programming file necessary to write to my EPC4 device? 

Basically I want the solution that gives me a programming file consisting of following sections :- 

 

1. FPGA bitstream 

2. bootstrap loader 

3. my Nios2 software 

 

I was hoping there was some commandline or GUI way to specify and churn out a single programming file which I could then program to the EPC4 from Quartus via the Programming Tool? 

 

At the moment I am trying (and so far loosing http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/unsure.gif !) to work through the User Guide - to construct this target programmer design to allow me to reach the EPC4 thru the JTAG in order to get this data down as I wish? Surely this is a bit contrived? 

 

After a few bumps and bangs I&#39;ve managed to get as far as making a new target and running the flash programmer but now have the Make bombing out with an error and announcing a synhronisation error? 

 

Does it have to be so difficult? I can program the FPGA thru the JTAG fine.... program the EPC4 directly thru the byteblaster connector fine.... I just want a combined programming fine to program thru the bytel=blaster conector and I am all done!!! 

 

Has anyone any thoughts or advice? 

 

Thanks! 

 

joe
0 Kudos
8 Replies
Altera_Forum
Honored Contributor II
415 Views

Use the EPCS controller and set your reset address to that device. The EPCS controller includes a bootloader that will copy the software out of the EPCS device. 

 

Then in the IDE you use the flash programmer to populate the hardware and software in the EPCS device. I assume you have a target configuration already that you have created for your board already. You can do this from the command line too but I would give the IDE a shot first. So the 3 steps you describbed are possible (well except 2 is contained in the EPCS controller). Check out the EPCS controller document up on the Altera site for more info.
0 Kudos
Altera_Forum
Honored Contributor II
415 Views

When I try to program an EPCS device using the Nios II Flash Programmer and my own custom Cyclone board, I get the error: make: *** [epcs_controller_boot_rom_programflash] Error 5 

 

or in more detail..... 

 

 

make: Entering directory `/cygdrive/f/projects/emshw/full_featured/software/ems_boot/Release&#39; 

28-Jan-2005 14:40:30 - (INFO) nios2-flash-programmer: Launching Quartus Programmer to download: 

f:/projects/emshw/full_featured/target_board/system/target_board.sof 

Send (64) failed. 

Unable to synchronize with target. 

28-Jan-2005 14:41:18 - (SEVERE) nios2-flash-programmer: Error opening target hardware 

28-Jan-2005 14:41:18 - (SEVERE) nios2-flash-programmer:  

In order to program flash, you must first create a purpose-built 

flash-programming design (i.e. FPGA configuration) and associate it with 

your particular board. The Nios development kit is delivered with purpose-built 

flash-programming designs pre-built for several development boards. If you wish 

to program flash on your own board, you must first create a flash-programming 

design. 

 

The process of creating a flash-programming design for your board is mostly 

automated. From a bash-shell, execute this script: 

 

mk_target_board --help 

 

The help-message includes references to other documentation on programming 

flash and targeting Nios systems to custom board designs. 

 

 

 

 

 

Then this windows message-box pops up.... 

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

java.exe - Application Error 

 

The instruction at "0x032c2140" referenced memory at "0x033e2390". The memory could not be "read". 

 

Click on OK to terminate the program 

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

 

 

 

 

 

Then I click OK and the Console output continues with... 

 

 

- exiting. 

make: *** [epcs_controller_boot_rom_programflash] Error 5 

make: Leaving directory `/cygdrive/f/projects/emshw/full_featured/software/ems_boot/Release&#39;
0 Kudos
Altera_Forum
Honored Contributor II
415 Views

question? 

 

Is a reset necessary for the programmer to work? I do not have a reset signal - only a watchdog reset input which I do not connect to the programmer design, since I don&#39;t want to reset it!!! So at the moment I just tie reset to vcc on the schematic?
0 Kudos
Altera_Forum
Honored Contributor II
415 Views

Actually you are getting that error message because you don&#39;t have target information defined for your board. That&#39;s why it is telling you  

"mk_target_board --help" 

 

I would read this document to find out more: http://www.altera.com/literature/ug/ug_nio..._programmer.pdf (http://www.altera.com/literature/ug/ug_nios2_flash_programmer.pdf

 

Basically the flash programmer needs this information so that it can properly set up hardware that will program your flash, and so it knows what regions are available (and dito for the EPCS). Once you have created this target information, in SOPC builder select the new target board from the dropdown and do the usual rebuilds/recompiles (you are going to create a target just like a Nios II development board).
0 Kudos
Altera_Forum
Honored Contributor II
415 Views

I thought I did everything mentioned in the documentation to create my target board information? 

That is what: f:/projects/emshw/full_featured/target_board/system/target_board.sof refers to? 

 

perhaps there are distinct rules to where the files must be placed in the folder hierachy? 

 

presently I have as follows :- 

 

F:/projects/emshw/full_featured .....where my FPGA design lives. 

 

this is where I ran the mk_target_board utility program to create my board called target_board. 

which created the folder (and contents) referred to in the console output.... 

 

sure is a mystery to me at the moment. it is hard to know what I should do next? 

I suppose I could try re-installing all the altera tools again for example? but that&#39;s maybe clutching at straws. 

 

http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/unsure.gif
0 Kudos
Altera_Forum
Honored Contributor II
415 Views

Did you define in the target that there is a EPCS device? 

 

Also roughly how big is your software? (wondering if you are running out of room).
0 Kudos
Altera_Forum
Honored Contributor II
415 Views

Hi 

 

Thanks for all the advice so far! 

 

Well, the test program I want to put to the flash is about 10KBytes - it is a little flashing LED program with minimal libraries/etc - just something for me to get going standalone first!  

 

The command I entered was basically as shown in the screen on page 24 of the User Guide :- 

 

mk_target_board --name=target_board --family=cyclone --clock=50 --index=1 --buffer_size=4096 --epcs=U2 

 

My device is a 1C12, and I chose 4096 instead of 16384 just to be safe!! 

 

I had some problems initially with quartus complaining about constraints, until I removing the asmi component. I added the EPCS controller and labelled it as U2. 

 

So as it stands now the programmer does appear to build in quartus okay - but does not want to work.
0 Kudos
Altera_Forum
Honored Contributor II
415 Views

I had the same problem with the quartus i belive what you have done is to delete the deley_rest_block  

if so that is a mistake.  

try to add it back , if you need the vhdl file that define this block look for them in the example file of the standart project ,  

you will need to add a PLL and to tie all the input and output of the the system to the right pins of the cheep , look at the standart project for example
0 Kudos
Reply