LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Flash FPGA lvbitx

Solved!
Go to solution

Hi everybody !

 

I'm very active on the forum last weeks but I have a lot of questions 🙂

 

This time, I would like to flash an FPGA Labview lvbtix file but without using Labview. I saw on the web that is possible with the MAX tool since 2014 but it's not what I want. I mean flashing the bitfile with a pure Linux method like copying files, run commands or use external tools for instance.

 

Do you know if this trick is possible ?

 

Thank you for your reply !

 

Afghow.

0 Kudos
Message 1 of 12
(4,689 Views)

Hey Afghow,

 

What hardware are you using? Is it one of the LinuxRT cRIO controllers?

 

Thanks,

 

Sebastian

0 Kudos
Message 2 of 12
(4,665 Views)

Hi,

 

I am using a myRIO board 🙂

0 Kudos
Message 3 of 12
(4,657 Views)

In that case, this thread might be helpful.

 

https://forums.ni.com/t5/NI-Linux-Real-Time-Discussions/Working-out-what-chassis-you-re-using-in-C-C...

 

You'll want to use the "Update Firmware" function on the RIO device.

0 Kudos
Message 4 of 12
(4,649 Views)

Hi,

 

I saw this tool but it's strongly linked to the NI suite. What I would like is a pure Linux method or external tool (no NI software).

I have my bitfile, I connect to the board through SSH and I'm able to flash the FPGA by command line for instance.

 

Thank you,

 

Afghow.

0 Kudos
Message 5 of 12
(4,628 Views)

Just to be clear we're talking about the same thing, you're looking for a way to have a bitfile automatically programmed to the FPGA the next time the system boots, is that right?

 

Can you explain why you want to do this without NI Software? If you don't want to use LabVIEW, the System Configuration API has a C API you can either integrate in to an existing application or use to make your own lightweight tool for programming an autoload bitfile.

 

Thanks,

 

Sebastian

Message 6 of 12
(4,599 Views)

Hi !

 

Nice reference, I have installed the Eclipse environment and available functions seem to match with what I want to do !

 

However, my first try of flashing returns me the -63106 error code, according to the documentation there is a problem of bitfile signature. My bitfile is just a simple FPGA LEDs blinking. For this error, the documentation says : "The specified signature does not match the signature of the bitfile. If the bitfile has been recompiled, regenerate the C API and rebuild the application" or "When error -63106 is reported it means that the FPGA configurations need to be refreshed. Open the system definition file and refresh each of the FPGA targets". I continue my researches but I think the modification to make is very small but pretty hard to find, by the same way I have problems with "Open the system definition file and refresh each of the FPGA targets", Any idea to do that ?... If somebody already have this problem, keep me informing ! 🙂

 

For information rebuilding the application is without effect.

 

Thank you for your precious help !

 

Afghow.

0 Kudos
Message 7 of 12
(4,567 Views)
Solution
Accepted by topic author Afghow

One of the parameters to NiFpga_Open is the signature of the bitfile, which must match what the signature of the bitfile parameter. The signature is defined in the generated header file produced by the C API Generator. This mechanism is in place to ensure that the bitfile being used matches the generated header. The error you are getting indicates that the signature paramter does not match the signature of the bitfile, so I suspect you need to run or re-run the C API Generator and be sure to pass the correct signature.

 

See https://www.ni.com/docs/en-US/bundle/fpga-interface-c-api-ref/page/capi/functions_session.html documents NiFpga_Open. https://www.ni.com/en/support/documentation/supplemental/09/introduction-to-the-fpga-interface-c-api... has information on using the C API.

 

Sebastian

 

 

0 Kudos
Message 8 of 12
(4,541 Views)

Thank you it works very well ! 🙂

 

But once again we need a NI Tool to do that because we need to have the bitfile signature, however it's a good point to be able to flash the FPGA with a C program ! 🙂

 

Afghow

0 Kudos
Message 9 of 12
(4,485 Views)

That right, you need to run the C API Generator, but you should only have to do that when you rebuild the FPGA VI.

 

One other thing I want to clarify, with NiFpga_Open, the FPGA is programmed but the FPGA image is not persisted. Saying the FPGA is flashed implies that the image has been saved to a flash on the device to be automatically loaded whenever the system boots. On a myRIO, the FPGA will be cleared every time the system is rebooted.

 

myRIO also supports autoload from flash. It can be done easily from MAX or the WIF. Or if you desire a C solution, take a look at this thread https://forums.ni.com/t5/NI-Linux-Real-Time-Discussions/Working-out-what-chassis-you-re-using-in-C-C...

 

Sebastian

0 Kudos
Message 10 of 12
(4,470 Views)