Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17255 讨论

Active Serial FPGA, how to create Raw bin file for SPI Programming

Altera_Forum
名誉分销商 II
3,363 次查看

Hi,  

Well, I'm lost with all the programming file formats of Altera.  

 

Now what I have:  

- FPGA -- Connected to SPI EEPROM through it's active programming interface 

- CPU -- Connected to the same SPI Flash 

a mux used to mux data from FPGA or CPU to the Flash, mux is set to FPGA when power up. 

 

I have created jic file and successfully initialized the SPI flash with proper FPGA image (by Quartus Software).  

 

Upon power up, FPGA can be configured by itself in Active Serial Mode. 

 

Now I want to update a new image to the SPI Flash via CPU SPI Interface.  

 

What kind of binary format should I use so that the CPU just needs to dump all data to the Flash?  

 

Thank you. 

 

Jeff
0 项奖励
6 回复数
Altera_Forum
名誉分销商 II
2,250 次查看

you need to crate an rpd file from quartus.

0 项奖励
Altera_Forum
名誉分销商 II
2,250 次查看

Personally we use rbf (raw binary format) here. There are no headers or anything in these files. you can generate rbf from the "Convert Programming File" utility in under the file menu in quartus.  

 

/Boris
0 项奖励
Altera_Forum
名誉分销商 II
2,250 次查看

Thank you dwesterg and Boris,  

That is really helpful,  

I've tried the rpd file but it doesn't work, seems like i have to send LSB first according to the SRunner document.  

 

I'm really confused and afraid to use rbf as the document stresses that there's some header at the front of rpd and that rpd and rbf are different.  

 

I really don't understand why there'are so many files format (jic, pof, rpd...) , Ultimately we want the RBF to be inside the flash and FPGA just issues DCLK and read data back ... !!! 

 

Thank you. I'll try tomorrow!
0 项奖励
Altera_Forum
名誉分销商 II
2,250 次查看

We are programming the entire RBF into the flash like you want to do and it works just fine. I always recommend programming the flash using the jic and read it out to a file. Then program using the RBF from your CPU into the flash read out that and compare the files. They should be identical.  

 

/Boris
0 项奖励
Altera_Forum
名誉分销商 II
2,250 次查看

jefflieu, 

 

We do in-system programming all the time to the FPGA flash, specifically, Altera's EPCS flash connected to FPGA via Active Serial port. The RPD file is the correct format to use with the SRunner (or JRunner, something like that.) There may be other format you can use but RPD is what we use with the SRunner so it should work. You're on the right track so just need to debug why RPD not working for you. 

 

Don't worry about all the different file formats that Altera has. Different tool/utility uses different input file format. If you're using SRunner then the input file format for that tool is RPD (and maybe some other file.) It'll tell you in the documentation. 

 

The JIC file is typically used when you have cable connected to JTAG and using Serial Flash Loader to program flash indirectly, and the POF file is used when you have ByteBlaster connected to flash directly, and the RBF is just the raw bitstream. (Typically with RBF you may have to do byte swapping before can be used to program FPGA.) 

 

 

 

 

--- Quote Start ---  

Thank you dwesterg and Boris,  

That is really helpful,  

I've tried the rpd file but it doesn't work, seems like i have to send LSB first according to the SRunner document.  

 

I'm really confused and afraid to use rbf as the document stresses that there's some header at the front of rpd and that rpd and rbf are different.  

 

I really don't understand why there'are so many files format (jic, pof, rpd...) , Ultimately we want the RBF to be inside the flash and FPGA just issues DCLK and read data back ... !!! 

 

Thank you. I'll try tomorrow! 

--- Quote End ---  

0 项奖励
Altera_Forum
名誉分销商 II
2,250 次查看

For my case, rbf works, rpd works,  

also using the following also works: 

- sof2flash 

- then nios2-elf-objcopy -I SREC -O binary ... 

 

When using the file coverter GUI, I have to reverse the bits for each byte of rpd and rbf.  

When using nios2-elf-objcopy, the bit are already reversed.  

 

Thanks all. 

Jeff
0 项奖励
回复