Forum Discussion
Converting .sof file to .flash file for Stratix 10 GX development kit
Hello Intel,
I have the Stratix 10 GX development kit, and am needing to load a user design into the Flash for auto-configuration of the user design at power up. I've been following through the documentation, and have successfully reached the page in the Board Update Portal where you specify a hardware file.
However, the method of converting the Quartus Prime produced .sof file into the necessary .flash file, is not documented clearly.
The link to the instructions to convert the .sof file state the following:
Convert user .sof file and .elf file to the format required to program the Flash
Note: You must have the Nios® II EDS installed in order to perform this step.
1. From the Start Menu, open Nios II Command Shell
2. In the Nios II Command Shell, navigate to the build_hw.sh file and type
sh build_hw.sh yourfile_hw.sof 1
However, I cannot find the build_hw.sh script anywhere. The instructions only say to navigate to it, but do not say where it is.
A search for that filename in the Quartus Prime 23.1 installation directory does not find it. I was able to find one version of it buried deep in the design material .zip file downloaded from the Stratix 10 GX product page:
stratix10GX_1sg280uf50_fpga_revd_htile_v18.1b222_v1.0.zip\stratix10GX_1sg280uf50_fpga_revd_htile_v18.1b222_v1.0\factory_recovery\build_factory_source\PRD\build_hw.sh
But this does not appear to be the correct script (looks like it will produce a .pof, and we need a .flash right?), and anyways it does not execute correctly when invoked from within the Nios II power shell as it exits with a syntax error.
I saw this previous post with a similar question however it was never actually solved, only marked as complete as the OP stopped responding:
Please help clarify the process of converting the .sof file into whatever format is needed to load into flash from the Board Update Portal. If I need to use a specific script from within the Nios II power shell, where is that script located? Is there any alternative, or command line command I can enter manually like was done previously with the Arria 10 GX dev kit (sof2flash)?
46 Replies
- EBERLAZARE_I_Intel
Regular Contributor
Hi,
Thanks for the info, I will need to check on my side, I will get back to you.
- cconger
New Contributor
Hi EBERLAZARE_I_Intel, just curious if you have any update. This is a very fundamental need for any FPGA board so I'm hopeful it is an easy solution. Thank you for any help you can provide!
- cconger
New Contributor
Thank you. Note that I am using Windows 11, and Quartus Prime Pro 23.1.
Also, if I try to convert the .sof into a .pof using File -> Convert Programing File, I get the following error from Quartus:
Error(20687): Convert Programming Files does not support the target device 1sg280lu2f50e2vg. Please use Programming File Generator to generate the programming file for the target device.
So it seems this device isn't supported for conversion anyways. This is a confusing process for a very basic need to have an FPGA auto-configured at power-up. Any help would be greatly appreciated!
- sstrell
Super Contributor
No it just means you have to use the PFG instead of CPF to create the .pof. The CPF was/is for older devices.
- cconger
New Contributor
Thanks for the info!
However that further reinforces that their instructions are incomplete for converting a file to be loaded into Flash on the Stratix 10 GX development board. The only build_hw.sh script I was able to find calls quartus_cpf to produce a .pof file first, before converting that into a .bin file. If quartus_cpf doesn't work for this device, then the script won't work either even after the syntax errors are fixed, or otherwise it is not the right script being referred to by their instructions.
- sstrell
Super Contributor
I think maybe it was CPF in older versions of Quartus so that's why the old script is like that.
- EBERLAZARE_I_Intel
Regular Contributor
Hi,
I am back after lots investigation, yeah, there seem to be some confusion, documentation update will be update on this one.
But in the meantime we are still figuring the proper and final steps, I will let you know the update again soon.
- EBERLAZARE_I_Intel
Regular Contributor
Hi,
Can you share your .sof?
- cconger
New Contributor
Thanks for your help with this. I will need to check with project leadership before I upload our design, even just the .sof, to a public forum.
May I ask why our specific .sof is relevant, so that I can offer justification for sharing? Shouldn't the steps to convert a .sof to whatever format is necessary for the Board Update Portal of the Startix 10 GX development board, be independent of the specific .sof to be converted?
- EBERLAZARE_I_Intel
Regular Contributor
Hi,
I just got it converted from a .sof to .flash. Apologies it takes some time, it does seem it is not properly documented on our side, and thanks for your feedback we will get this channeled properly and update our documentation.
Use a quartus_pfg or Programming file generator to create a ".rpd" from your ".sof".
After that open a Nios II command shell, get your ".rpd" and convert it to ".flash" using:
nios2-elf-objcopy -I binary -O srec --srec-forceS3 --srec-len 32 <RPD filename> <FLASH filename>
If you're using on a Windows machine, you may need to include ".exe".
Let me know if the .flash works for your S10 board as in your Arria 10 board.
- EBERLAZARE_I_Intel
Regular Contributor
Hi,
Did you have the chance to test it?
- cconger
New Contributor
Thank you for the reply. I am currently awaiting a license issue with Intel which I hope to be resolved any day now. I will absolutely update this post ASAP once I'm able to test it.
In the meantime, one additional piece of feedback I may offer that would be useful to include in the documentation update, would be to indicate where the nios2-elf-objcopy.exe file is located. Since the path to the executable not already part of the path variable upon launching the Nio2 command shell, I had to search for the executable with the following command:
find ./ -name "nios2-elf-objcopy.exe"
And it indicates the executable is located in the following directory:
[quartus_install_directory]/23.1/nios2eds/bin/gnu/H-x86_64-mingw32/bin
That is relatively hidden and some users may not know how to search within the shell, it would be much more convenient (and save Intel unnecessary service requests!) if this information was offered up front along with the steps to do the file conversion.
- EBERLAZARE_I_Intel
Regular Contributor
Hi,
Thanks a lot for the feedback, let me work on it.
Noted on your time needed to test, let me know if you have any questions on your primary issue, I will be glad to help in the meantime.
- EBERLAZARE_I_Intel
Regular Contributor
Hi,
Just want to check if you have update for this week.
- ChrisConger
New Contributor
Thank you for your continued support. I am the OP but I've now been locked out of my Intel account I used to start this thread
I signed up for the Intel SSLC which uses Azure to log in, but it does not play nicely with my company's Microsoft Azure profile and I cannot log in to reply to the forums anymore! We are working this issue as well, but irrelevant for this thread other than to explain why replies are slow and I apologize. So, the one issue I've run into so far, is the nios2-elf-objcopy.exe execution cannot find the .rpd file. The .rpd file does not reside in the same folder as the .exe executable, and while I am typing the command in I can tab-to-complete the path to the .rpd as well as the .rpd filename itself, so I know I have it entered correctly.
Vice versa, if I move into the folder where the .rpd is located and then attepmt to run the executable by using the path to the executable, even if I tab-to-complete to ensure the path is correct, upon hitting enter it says the executable cannot be found.
I currently can't copy the .rpd into the folder with the executable as I do not have admin privileges and the folder is protected, though I will work my with IT to try that next. I am currently on the road on work travel and will be back on Monday.
That is my update for now, I was able to convert the .sof to .rpd, but am getting errors related to file not found that i do not understand when running the indicated command to convert the .rpd to .flash.