Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
21615 Discussions

Loading .rbf file into EPCS16 for remote configuration of FPGA.

Altera_Forum
Honored Contributor II
3,155 Views

Hi, 

I have prepared a qsys design(Say in quartus_project_a) for writing and reading bytes with EPCS16 using SPI protocol(I am using EP3C25F25C68 FPGA) and it is working properly. Now, I want to load .rbf file into EPCS16 using this design. Flow will be -  

 

- I have coded a simple verilog program for LED blinking and generated .sof as well as .rbf. All this is done in another Quartus project (Say quartus_project_b

- I want this .rbf file, generated in Quartus_project_B to be loaded using SPI interface in Quartus_project_A, so the FPGA can work without loading .sof externally. 

- Is this correct flow or should I write the logic for led blinking in Quartus_project_A itself. 

- how can i load rbf file into epcs16 using spi? I have observed the file in Notepad but it has nothing like binary or hex content.  

May be I am lacking too much of basics, but little hint will help a lot. 

 

Ashish Devre
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
1,555 Views

Why don't you use JTAG indirect programming method to load the FPGA image to EPCS device? It's the native programming method supported by Quartus. 

 

Programming through SPI, e.g. by an embedded processor is possible, but requires understanding of sending flash memory commands, different SPI bit order for commands and configuration data etc.
0 Kudos
Altera_Forum
Honored Contributor II
1,555 Views

FVM: 

First of all, thanks for the reply. 

Do you mean to say a JIC file? That's fine. But here is my requirement. I am forced to do it that way(By my superiors). 

Besides that I am almost done with NIOS - EPCS16 communication using SPI. I can read from EPCS16 and write into it some random data, also I can erase sectors of EPCS16.  

All I want, right now, is to write the contents of RBF file into EPCS16. But the RBF file, genrated by Quartus II 12.0, seems to be encrypted. How can I write the configuration data, stored in the rbf file, into EPCS16?
0 Kudos
Altera_Forum
Honored Contributor II
1,555 Views

Raw Binary Files containing configuration data for the sequential Passive Parallel Synchronous (PPS), Passive Parallel Asynchronous (PPA), and Passive Serial (PS) configuration schemes. You want to use AS scheme. The POF file is a configuration file for AS that is designed to be used by the Byte-Blaster device, in order to write the configuration data into the EPCS device. The POF file contains not only the configuration data but some other data as well, that is used by the Byte Blaster. As you want to write the configuration data directly to the EPCS from the file you cannot use the POF file directly. 

The RPD file which can be converted from the POF file is a raw programming file, which contains the configuration data and nothing else. If you use the RPD file you are sure to be writing only the configuration data into the EPCS and no other unwanted data.
0 Kudos
Altera_Forum
Honored Contributor II
1,555 Views

I had solved the issue a few time ago, but thanks for the reply. Actually, rbf file does contain binary data (including some header data which may be same for all the rbf files of the projects using same FPGA) . I simply wrote all those bytes into EPCS16 starting from 0th address and it worked fine. Of course each byte of the rbf file must be bit-reversal before writing into EPCS.

0 Kudos
Altera_Forum
Honored Contributor II
1,555 Views

Hi, 

 

if you do not want to use the byte reflecting you can do the following from the Nios II Command Shell: 

sof2flash --epcs --compress --input=yourSOF --output=fw.flash nios2-elf-objcopy -I srec -O binary fw.flash fw.rbf  

 

Now the fw.rbf file should be just in the right format to store to the fpga
0 Kudos
Reply