FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
6264 Discussions

Converting .sof file to .flash file for Stratix 10 GX development kit

cconger
Beginner
7,982 Views

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:

Solved: Procedure for programming the hardware1 region of flash on my Stratix 10 GX development board? - Intel Communities

 

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)?

 

0 Kudos
46 Replies
EBERLAZARE_I_Intel
4,304 Views

Hi,


Thanks for the info, I will need to check on my side, I will get back to you.


0 Kudos
cconger
Beginner
4,175 Views

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!

0 Kudos
cconger
Beginner
4,268 Views

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!

 

0 Kudos
sstrell
Honored Contributor III
4,257 Views

No it just means you have to use the PFG instead of CPF to create the .pof.  The CPF was/is for older devices.

0 Kudos
cconger
Beginner
4,248 Views

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.

0 Kudos
sstrell
Honored Contributor III
4,247 Views

I think maybe it was CPF in older versions of Quartus so that's why the old script is like that.

0 Kudos
cconger
Beginner
4,216 Views

Fair enough, but back to the topic of this thread, the script that Intel points to (which I had to really dig to try and find since they don't say where it is) uses that utility.  So if that utility won't work anyways for a Stratix 10 device, then Intel has multiple problems with their instructions for customers to load their own designs into the Stratix 10 GX development board Flash.

Do you by chance know how to get a user-produced .sof file converted into the correct format, so that it can be passed to the Board Update Portal to be loaded into Flash on the Stratix 10 GX development board?

0 Kudos
EBERLAZARE_I_Intel
4,108 Views

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.


0 Kudos
EBERLAZARE_I_Intel
3,968 Views

Hi,


Can you share your .sof?


0 Kudos
cconger
Beginner
3,961 Views

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?

0 Kudos
EBERLAZARE_I_Intel
3,868 Views

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.


0 Kudos
EBERLAZARE_I_Intel
3,823 Views

Hi,


Did you have the chance to test it?


0 Kudos
cconger
Beginner
3,805 Views

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.

0 Kudos
EBERLAZARE_I_Intel
3,732 Views

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.


0 Kudos
EBERLAZARE_I_Intel
3,688 Views

Hi,


Just want to check if you have update for this week.


0 Kudos
ChrisConger
Beginner
3,668 Views

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.

0 Kudos
EBERLAZARE_I_Intel
3,626 Views

Hi,


Let me try again on my side based on your testings, just to be sure again, what was the Quartus and Nios version did you worked on for the latest test?


0 Kudos
ChrisConger
Beginner
3,610 Views

I am using Quartus Prime Pro, 23.1.0 Build 115 03/30/2023 SC Pro Edition

 

I'm not sure the Nios version, it is whatever was installed along with the installation of this version of Quartus Prime Pro.  If there is a means of checking the Nios version I'd be happy to check it, just let me know where to look.

0 Kudos
ChrisConger
Beginner
3,586 Views

Hi,

 

So I was able to convert the .rpd into a .flash by running the command you specified from the Windows command shell.  The Nios2 command shell always gives me the "file not found" error even though tab-to-complete ensures the file is visible and entered correctly.

 

Should there be any issue in running the command in a Windows command shell and not the Nios2 command shell?

 

The command appears to execute without problem and a .flash file is produced.  However, after uploading the file through the Board Update Portal (appears to successfully upload), upon power cycling the board with User Design #1 selected by setting SW3.3 correctly on the S10 dev board, it does not appear to program correctly.

 

After a few seconds the "Error D3" red LED lights up on the LED daughter board, and the design does not appear functional or programmed.

 

Any help you can offer would be greatly appreciated on why after converting .sof to .rpd, and then from .rpd to .flash, the board will not program correctly.  If I manually program the FPGA with the original .sof used to perform that chain of conversion, it works fine so we know the .sof is good.

0 Kudos
ChrisConger
Beginner
3,553 Views

For clarity, below is the exact sequence of steps I am taking along with screenshots/photos.

 

First, I use Programming File Generator invoked from within Quartus with the project open in order to convert from .sof to .rpd.  This is the first screen that pops up, and I enter the output file information.  Please confirm the other settings are correct... if I choose "AVST x16" as the Configuration Mode, the .rpd file type is not offered as a conversion option so I guess Active Serial x4 is the only possible choice since you said to convert to .rpd first.

pfg_output_file.png

 

I select the .sof file just generated by building the project.  This .sof file works correctly if I manually program the FPGA directly through Quartus Programmer, so we know the .sof is good:

pfg_input_file.png

 

And after clicking "Generate", I get a success notification and the .rpd file is located where I specified.

pfg_success.png

 

 

Here you can see I attempt to perform the .rpd to .flash conversion within the Nios2 command shell, but I get the "file not found" error:

nios2_error.png

 

If I instead run the exact same command but within the Windows command shell (note the directory paths and everything is the same), it appears to work as a .flash file is generated.  I am guessing there is no success message to be expected, so a silent return to the prompt must be a good thing (?):

win_worked.png

 

Next, I ensure the Stratix 10 board SW3.3 is set to load the factory build at powerup so that I can connect to the board update portal:

SW3_factory.jpg

 

And upon powering up, I am able to connect to the Board Update Portal through my web browser:

bup_welcome.png

 

For hardware file I choose the .flash file generated by the steps above.  There is no embedded processor in the FPGA design and so no software file exists/needs to be specified:

bup_openfile.png

 

Here the file can be shown to be selected just prior to clicking "upload."

bup_fileselected.png

 

We can see the upload in process here:

bup_fileuploading.png

 

After uploading, I get the following success message:

bup_finished.png

 

Note that though it says to press some switches and look at LEDs, those switches are not labeled nor are they documented in the User Guide so I don't know which ones to press.  At any rate, the design should now be able to load upon a power cycle so I skip the steps above and get ready to power cycle the board to test if the design will load automatically.

 

After powering off the board, I first set SW3.3 to choose the user design on power-up and not the factory load:

SW3_user.jpg

 

Finally, after powering up with the user design selected via SW3.3, after a few seconds this red LED comes on and the design is non-functional... I'm assuming this LED indicates a configuration error.

LED_error.jpg

 

Recall that the .rpd was generated using Active Serial x4 as the configuration mode since AVST x16 doesn't give me the .rpd option... I have tried setting SW1 (MSEL selection) to both "10" as well as "01," and neither works.

 

Can you describe to me what steps I did incorrectly, or missed?  As far as I know I have done exactly as you indicated I should do as well as how the current documentation describes the flow.  Thanks again for your help with this, this is an extremely frustrating and complex method of doing such a fundamental operation as loading a user design into NVM for auto-configuration at power-up.

0 Kudos
Reply