Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
10 years ago

Linux and Programming the FPGA

Hi

When we boot DE1-SOC with a Linux, it is possible to put a rbf file in the root directory and during the boot process that file will be used to program the FPGA. I was wondering if there is any solution to program the FPGA directly with Quartus when we boot the board with Linux.

Best,

10 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    When we look at all the golden reference design , the Fgpa's rbf file is always keep in the FAT partition of SD card. In the event of the HPS power up first from SD card, this could be use to program the FGPA. Is this what you need?

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks for you reply. This is what I do right now. Now I don't want to do this anymore. I want to be able to program the FPGA directly from Quartus and run the Linux from SDCARD. But when I try to do that, it fails.

    (When I am not booting the board with Linux, I can program the FPGA directly from Quartus without any problem).
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    you may want to stop the boot-process in uboot-stage, then load the FPGA from Quartus-Programmer, enable the bridges with the correct bridge-handoff and the boot Linux...

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Thanks for you reply. This is what I do right now. Now I don't want to do this anymore. I want to be able to program the FPGA directly from Quartus and run the Linux from SDCARD. But when I try to do that, it fails.

    (When I am not booting the board with Linux, I can program the FPGA directly from Quartus without any problem).

    --- Quote End ---

    wondering why you want to program directly from quartus instead of allow the HPs to take care teh FGPA, for debug purpose only?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    wondering why you want to program directly from quartus instead of allow the HPs to take care teh FGPA, for debug purpose only?

    --- Quote End ---

    Yes exactly. Programming from Quartus is easier and faster compared to copying to programming file to the SDCARD. (I am TA of a course and for students, programming from Quartus is much better).
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    you may want to stop the boot-process in uboot-stage, then load the FPGA from Quartus-Programmer, enable the bridges with the correct bridge-handoff and the boot Linux...

    --- Quote End ---

    Thanks. I have no idea how to do this. Is there any documentation describing this or how do you know how to do what you said?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Yes exactly. Programming from Quartus is easier and faster compared to copying to programming file to the SDCARD. (I am TA of a course and for students, programming from Quartus is much better).

    --- Quote End ---

    I presumed you still need to utilize the hps right? there fore you still nede the hps power up.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    You could read the documentation in [1] to do so, but if your issue is only related to not copy every step an rbf to the sd-card, you could also try to setup a tftp-server on your server or local machine, connect your borad to that machine and use TFTP as load command for the rbf and then pass the rbf to the FPGA, also from uboot-stage...

    [1] http://rocketboards.org/foswiki/view/documentation/gsrd131programmingfpga#fpga_configuration_from_u_45boot
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Configure your u-boot to load the rbf file from a tftp server and make your build script copy the rbf to the tftp directory on your server is the easiest way to go.

    But if you really want to run Quartus you could add an rc script (name and location in /etc/ depends upon your Linux) to your SoC Linux which does something like:

    ssh my.work.station.ip 'cd /my/design/location; nios2-configure-sof myproject.sof'
    

    You need to add the ssh keys generated on your SoC to your workstation so you can run ssh without entering a password.