LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How load an FPGA bitfile onto a cRIO target, using a Linux machine?

I need to be able to load an FPGA bitfile onto a cRIO target, using a Linux machine, but I don't see a way to do it.

 

There is a Linux & Windows tool to load a controller image, but it does not have FPGA capability:

http://joule.ni.com/nidu/cds/view/p/id/167/lang/en

 

And there is a Windows-only tool to load both a controller image and an FPGA bitfile:

http://digital.ni.com/public.nsf/allkb/595401C59F89ECCC862578CC005D0887

 

but so far I have been unable to find a Linux tool to load an FPGA bitfile.

 

Does anyone know of a way to do this?

 

Thanks for your help.

 

0 Kudos
Message 1 of 15
(5,065 Views)

Note: if I try bringing "Download Bitfile.vi" (and all its dependencies) to a Linux machine, I see that it is looking for "niriosrv.so", but can't find it.

0 Kudos
Message 2 of 15
(5,062 Views)

Hey Chris,

 

Have you seen this Developer Zone article from our site?

 

http://zone.ni.com/devzone/cda/tut/p/id/12008

 

This should give you the information you need in order to get your bit file to the cRIO with your Linux Machine.

 

Hope This Helps,

 

Doug B

Applications Engineer
National Instruments
0 Kudos
Message 3 of 15
(5,047 Views)

Hi Doug, thank you for your response. Yes, I had seen that article, but the C interface that it talks about looks like it is intended as an add-on to the NI-RIO driver for writing C/C++ applications that *interact* with LabVIEW FPGA bitfiles. I don't need to do that.  All I need to do is simply load a bitfile onto a cRIO FPGA, from a Linux machine. Any thoughts on how to accomplish this?


0 Kudos
Message 4 of 15
(5,042 Views)

 

Doug,

 

Below is text taken directly from the "FPGA Interface C API Help" documentation. It looks like it is not useful for loading a bitfile file onto an FPGA, it is only useful for interacting with code.

 

**************************************************

 

What You Can Do with the FPGA Interface C API

The FPGA Interface C API enables C/C++ applications to interact directly with compiled LabVIEW FPGA VIs on RIO devices without using LabVIEW. C/C++ applications can download a VI to a RIO target, perform DMA data transfers, wait on and acknowledge interrupts, and read from and write to named controls and indicators using C function calls.

A C/C++ application created with the C API can run on the real-time processor of a CompactRIO or NI Single-Board RIO device, and interact with VIs running on the FPGA of the RIO system. Alternatively, a C/C++ application can run on the real-time processor of a PXI system or the processor of a Windows or Linux PC, and interact with VIs running on the FPGA of a PXI or PCI RIO device.

What You Cannot Do with the C API

The current version of the C API does not support the following features.

  • Reading from and writing to controls, indicators, and FIFOs containing the following:
    • Fixed-point types
    • Clusters
    • Arrays containing arrays
  • The following methods callable from an Invoke Method node:
    • Control IO Module Power
    • IO Module Status
    • Mount SD Card
    • Read TEDS
    • Redetect IO Module
    • Unmount SD Card
0 Kudos
Message 5 of 15
(5,034 Views)

in order to interact with the fpga, you have to load the bitfile.  if you skip the interacting part, you have loaded the bitfile.

i am still not sure that this will work from linux though.

Stu
0 Kudos
Message 6 of 15
(5,029 Views)

after reviewing the article posted above by Doug, i see that NI is describing support for linux.

based on our experience with calling FPGA from C under windows, i think this will work.  like i said, skip the interactive part and you have loaded the bitfile.

 

 

Stu
0 Kudos
Message 7 of 15
(5,025 Views)

Stu, thank you for your input. I'll take a closer look at the C utility. In the meantime, I have spoken with a co-worker, and he described a situation where he took a cRIO controller (having a /ni-rt/startup/startup.rtexe file on it) and plugged it into a brand-new backplane right out of the box. After inserting the appropriate modules, the controller was booted up, and it began acquiring data from the modules. This suggests to me that the startup.rtexe file contains the *.lvbit file, and loads it onto the FPGA when it starts up.

 

Is this how the startup.rtexe file works?

 

0 Kudos
Message 8 of 15
(5,010 Views)

Chris 12345 wrote:

Is this how the startup.rtexe file works?


Yes.  From http://digital.ni.com/public.nsf/allkb/17EA4DD6AAECD50A862570A7004B6146?OpenDocument: "neither the FPGA VI nor the Bit files will be included explicitly in the support files for the project. They are implicitly a part of the Real Time or host executable and will be deployed on the FPGA target once the executable is called on the Real Time Target or host."

0 Kudos
Message 9 of 15
(5,002 Views)

Eh, not exactly.  The startup.rtexe DOES NOT contain the FPGA bitfile.

 

There are a couple ways to manage an FPGA image bitfile, depending on your distribution methodology and the requirements of the FPGA image.  This document is a bit windows-centric, but it adequately describes the relationship between the application and the FPGA Bitfile:

 

http://zone.ni.com/devzone/cda/tut/p/id/9640

 

There are two ways to load a bitfile onto an FPGA with Linux - the easiest (by far) is to use the RIO Device Setup utility that comes included with the NI-RIO driver.  It is distributed with Windows and Linux (as per the RIO PSE).  This tool loads your bitfile directly into the FPGA EEPROM, so it can be automatically loaded when your system starts up.  You can get information on this tool here:

 

http://digital.ni.com/public.nsf/allkb/BAAA6D86CDDD583C8625729E00572C8B?OpenDocument

 

However, if you need to "dynamically" load FPGA bitfiles (as in you cannot necessarily image each RIO individually, you prefer to do it programmatically when necessary or desired), the setup utility is probably not for you.  You will need to use the FPGA Interface C API - this is used to interface directly with the FPGA (as opposed to the app running on the FPGA) to load the bitfile and launch the app.  You can get information on how to do this here:

 

http://zone.ni.com/devzone/cda/tut/p/id/12008#

 

This should be all of the resources you need in order to load your bitfile with Linux.

 

-Danny

 

0 Kudos
Message 10 of 15
(4,995 Views)