Forum Discussion

cconger's avatar
cconger
Icon for New Contributor rankNew Contributor
2 years ago

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:

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

46 Replies

    • ChrisConger's avatar
      ChrisConger
      Icon for New Contributor rankNew Contributor

      Thank you for your continued support on this issue, I truly do appreciate it.

      One point of clarification, the two links you provided in the previous reply are for a different version of the Stratix 10 GX development kit. If the contents are the same, or at least if the steps to produce a programming file to load into Flash is the same, then that is fine. But I just wanted to be sure that we aren't talking about two different development boards. The board I am using is the following:

      Intel® Stratix® 10 GX FPGA Development Kit

      Specifically the L-tile version. The Intel page only has the downloadable design files for the H-tile version, however I am hopeful that it does not matter.

      Within that design package, the build_hw.sh contained in the factory_recovery/build_factory_source/PRD/ folder attempts to produce a .pof from a .sof, which I don't believe is possible (.pof not a supported format for a Stratix 10? That is what Convert Programming File tells me anyways). And the build_hw.sh does not execute out of the box anyways as it gives a syntax error when attempting to execute.

      I will await further instruction as you requested, but again if we are working on two different development boards I wanted to be sure to point that out before we go too far. Thanks again for your support here!

      • ChrisConger's avatar
        ChrisConger
        Icon for New Contributor rankNew Contributor

        Here are a couple of issues I've resolved with the build_hw.sh, in case it helps as the team works out the issues with the curently-documented process.

        EOL format is incorrect for execution in Nio2 command shell or Linux prompt... need to do an EOL conversion to Unix format in a text editor capable of performing EOL conversion. This resolved the syntax error issue upon trying to execute exactly as taken out of the .zip file.

        quartus_cpf, which is the program invoked to convert a .sof into a .pof, is not supported for Stratix 10 devices. I was mistaken previously thinking .pof is not supported for S10, it is but rather it is the Quartus Convert Programming File application that does not support Stratix 10. I used Programming File Generator from within Quartus to produce a .pof file from my .sof (attempting to copy the .cof settings from the build_hw.sh script... note that the Stratix 10 GX dev kit settings are different from those in the Signal Integrity dev kit you linked earlier so I think it is important to use the right dev kit file), then specified that .pof file as input so that the conversion step in build_hw.sh is skipped and we avoid the error of quartus_cpf not working.

        Next, I get syntax errors with the length calculation using 'expr':

        Generating binary file...
        expr: syntax error
        dd: invalid number: ‘’

        So if I manually typed that series of commands in, I come up with a skip value of 46137391. Finally manually typing the 'dd' command in using the hand-calculated length value, I can produce a .bin file.

        After loading the .bin file in to the portal as you suggested earlier, it still doesn't work. So there is still work to do for Intel, but I wanted to point out the issues that I found in the build_hw.sh script:

        - EOL conversion needed to avoid syntax error

        - .sof conversion does not work since it uses quartus_cpf, and that can't be used for Stratix 10 devices

        - syntax error regarding the 'expr' steps causes final .bin file generation to fail due to empty input argument to 'dd' command

  • Hi,


    Thanks a lot for the input, we are still working on the getting the workaround for this.


    • ChrisConger's avatar
      ChrisConger
      Icon for New Contributor rankNew Contributor

      Hi, sorry for the delayed reply I've been on travel for work.

      So, we are still actively using the Stratix 10 dev kit as the base board for an environmental testing platform that we've developed. We previously used the Arria 10 dev kit, but wanted to move to the more powerful Stratix 10 device.

      Being unable to have a user design configured at power up continues to be an unfortunate obstacle for us, we currently use the platform by manually configuring the FPGA through Quartus Programmer with each power cycle. This reduces our efficiency and costs us money at test facilities.

      I flipped through the remote system update documentation that you linked, I'm not sure that I completely follow it all but it seems pretty complicated and looks like I would need to obliterate the factory image currently in all the boards which makes me nervous to do. The design files for factory recovery of the S10 L-tile GX dev kit is not available on the Intel website, only the H-tile design package is available for download, and thus I would not be able to restore our boards to their factory state should the remote update process not work for some reason.

      Personally I'd prefer to wait for Intel to figure out how to do it with the S10 board as shipped from the factory. If Intel is unable to figure out how to do it, we may revert to the Arria 10 boards and forget about the S10 boards, though it would be unfortunate to have to eat that cost as we purchased several of them, not thinking loading a user design would be a challenge.

  • Hi,


    Thanks for the update.


    In that case, we will hold the RSU design and work towards the Board Update Portal script fix.


    I believe, getting the .bin files properly converted will fix the issue. We are still working on getting the fix for the syntax error for the script.


    This may take some time, and I appreciate your patience on this. We apologies for the inconvenience out of box experience you are having currently.


    • ChrisConger's avatar
      ChrisConger
      Icon for New Contributor rankNew Contributor

      Thank you for your continued support and am happy to help in any way that I can as your team comes up with potential fixes.

      I know I've been frustrated with the board, but I hope it hasn't been mistaken for frustration with you personally. As I said I truly appreciate you and your team's help here, we are a small customer and I don't expect Intel to bend over backwards for us. Any help or solutions you provide will help us immensely, and I stand ready to help you guys in any way that we can.

  • Hi Chris,


    Not a problem, we would like to help our users to get the best experience, we apologies for any inconvenience.


    We are working now on finding the right fix for the S10 boards starting with the script itself.


    In the meantime, just to reiterate, it would require first the .sof to .pof of your design. By using the Quartus PFG not Quartus CPF, I think. We do need to get the .hex for the bootloader using the Quartus PFG however, for S10 steps, we have the build flow here to get one:

    https://www.rocketboards.org/foswiki/Documentation/BuildingBootloader

    Then convert the .pof to .bin for the Board Update Portal.


    But the side is currently down.


    We will keep you updated on anything from time to time, we appreciate your patience.


    Just to check again, you are facing this syntax previously?:

    xxd: ghrd_1sx280lu2f50e2vg.pof: No such file or directory

    expr: syntax error: missing argument after ‘length’

    expr: syntax error: unexpected argument ‘2’

    dd: invalid number: ‘’

    Object file generated successfully!


  • Hi,


    Just a quick point from one of our experts, I did try using Quartus 19.1 and 18.1 Pro, the script was working and I got the .bin. Do you have at least these two versions or in between? Which Quartus version do you have currently? This is just to check the functionality.




  • Hi,


    I hope you have update. As of now, we might not be able to get the Board Update Portal script for the new Quartus version in the shortest of timeline.


    So our suggestions is if you are able to use the Quartus version 18.1~ - 19.1 to use the script?


    Additionally, for S10, the SDM the security device manager should be use as an advantage if you are porting from A10, so using the Board Update Portal isn't ideal to utilize it's full potential, as it is intended more towards a taste of the Quick Start Guide.


    Moving forward towards RSU is my ideal suggestions, I understand it may require further understanding, however you may file any new thread on any questions on the RSU and we will help your there, on security/SDM, config etc.. So let me know your thoughts.


    • ChrisConger's avatar
      ChrisConger
      Icon for New Contributor rankNew Contributor

      Hi, sorry for the slow replies I am on work travel currently through next week and will be back in the office on Aug 11th.

      I am using Quartus Prime Pro, 23.1. I can check with IT about installing an earlier version, however it may not work as the disk space required for each version of Quartus is significant.

      As long as I manually generate the .pof using PFG and then manually type the sequence of commands in from the end of the script, I can get the commands to generate the file as well. However it still does not work upon uploading through the Board Update Portal.

      When I get back from this long travel, Ill take a closer look at the RSU and see if I am able to figure out the steps there and get one of my boards loaded with the user design through that method.

  • Hi,


    Got it, as per the earlier version discussion, as far as our dev concerns it should work on the older versions 18.1 ~ 19.1 versions of Quartus + Nios II. Please give it a try if you're opt for the BUP.


    In the meantime, I would recommend we close the thread for this round, and you may reopen a new one, once you're back and @TAG me, I will be there once you open the new thread.


  • Hi,


    I will transition this thread to community support. If you have a new question, Please login to ‘https://supporttickets.intel.com’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.



    p/s: If any answer from the community or Intel Support are helpful, please feel free to give best answer or rate 4/5 survey.