12-05-2013 04:48 PM
Running LabVIEW 12.1
We have an application that is using an FPGA that was compiled to Run at Reset (runs on any reset or powerup). We occassionally need to update the image on the RT and FPGA and I have downloaded the NI RIO Replication VIs.
The problem I am having now is that when I got to download the bitfile to the FPGA Flash on the sbRIO9636 I am getting the following error:
Error -61141
Possible reason(s):
LabVIEW FPGA: The operation could not be performed because the FPGA is busy. Stop all activities on the FPGA before requesting this operation. If the target is in Scan Interface programming mode, put it in FPGA Interface programming mode.
My updater is stand alone EXE. It may not be able to get a link to the FPGA because we can't be sure what Bitfile is currently on a particular system. I tried using the Open FPGA Reference and loading a BLANK bitfile onto the FPGA by setting the FPGA to RUN when it his the FPGA Open Reference VI - and this works to allow me to erase the bitfile. It does not allow me to immediately after run the Download bitfile VI from the RIO replication - even though I Close and Reset the FPGA before trying to download the Bitfile to the RIO Flash.
Will I have to first Erase the existing bitfile and then load the new one?
Solved! Go to Solution.
12-05-2013 04:59 PM
Adding an Erase before the Download did not work.
12-06-2013 12:14 PM
Hi Ryan,
I am not entirely clear on how your current workflow is set up. Are you trying to use the NI-RIO System Replicator VIs to push a new bitfile onto your targets? In what part of the workflow are you getting this error? A screenshot of the code for your standalone executable may help clear this up.
Is the end goal to push a new bitfile to your target and have it start automatically after you push it to the flash memory?
Regards,
12-06-2013 02:08 PM - edited 12-06-2013 02:11 PM
The workflow is pretty simple.
Connect to the sbRIO and send down a new Bitfile to the Flash and reset the unit.
This works great if the sbRIO has nothing on it. This works great if the FPGA code is encapsulated in the RT EXE and instantiated by the Open FPGA Reference.vi with RUN = TRUE.
What doesn't work is the whole reason I need to send a new bitfile to the FLASH of the RIO in the first place. FPGA RUN WHEN POWERED/RESET. The Fpga code once put on the RIO Flash drive loads every time and runs great. our RT Code Connects fine...
Occassionaly we need to replace the RT and FPGA code. Once the unit has been flashed once the with the FPGA, the NEXT time I want to Flash a NEW FPGA Bitfile onto the RIO Flash using the NI RIO Replication Toolkit VI: Download Bitfile.vi I get an error -61141 LabVIEW FPGA: -61141: The operation could not be performed because the FPGA is busy. Stop all activities on the FPGA before requesting this operation. If the target is in Scan Interface programming mode, put it in FPGA Interface programming mode.
I changed my code to shutdown the FPGA remotely by using a VI Server call into the RT.EXE....mabe I also need to close the Reference. What kills me is that once again we are given VIs for replication that do not perform what can be done by the project and the stand alone RIO Device Setup.exe.
12-06-2013 02:59 PM - edited 12-06-2013 03:07 PM
I have also now changed my code to connect to the sbRIO and then before trying to download the new bitfile to the flash:
Stopping the FPGA Code VI calls through my RT.exe
Setting "Do Not Autoload on Reset" using the Set RIO Device Settings.vi
"Erase Flash" using Download Bitfile.vi
Then I try to Download the NEW Bitfile using Download Bitfile.vi
Then I set "Autoload on any Device Reset" using Set RIO Device Settings.vi
THIS DID NOT WORK EITHER.
Edit: Actually that locked up the FPGA and a RESET button press did not bring it back from being Busy and even the NI RIO Device Setup exe couldn't connect until I power cycled the sbRIO. This is not an acceptable practice as that will shut down the HMI as well as this product embeds the RIO inside the machine and it is not accessible directly.
What is the NI RIO Device Setup exe doing that has not been exposed to us via these VIs.!???!!!!!???
12-06-2013 03:21 PM
Is there a way I can invoke the NI RIO Device Setup EXE from within LabVIEW?
12-09-2013 10:30 AM
Hi Ryan,
I'm looking into the Replication VIs in a little more detail to see what could be going on. In the meantime, you can open the RIO Device Setup using System Exec.vi:
The path in the VI Snippet was where the RIO Device Setup is located on my computer, but it should be updated for your setup.
Regards,
12-09-2013 12:32 PM - edited 12-09-2013 12:34 PM
Well I found what I consider to be a workaround - but maybe this is the required way to do things - but it doesn't seem like it should be since the RIO Device Setup.exe is able to flash or erase the bitfile regardless of the state of the FPGA.
What I have done is to set the FPGA to "Do Not Autoload on Reset" then call the RT System Config VIs and command a System Restart. The RT OS reboots and then the RIO system reboots and this ensures the FPGA is not busy. Then I am able to erase or write on a new bitfile to the RIO Flash and set the RIO to "Autoload on any Reset" and restart the system a second time.
For our current situation this will work. The long Restart times make it a little bit of a headache.