Reviving an old bot with (presumbly) lost RoboRIO code

Recently we tried “reviving” on of our old bots, but couldn’t interface with it as the RoboRIO had outdated firmware so the driver station refused to work with it. We have to update it, but learned that updating the RIO would delete all the code, and were really not ready to rewrite the code so we can get it working again. Is there a way to recover old code off a RIO that won’t work with any current software?

What programming language was used to deploy the code to the RIO?

Regardless of what programming language you use, it won’t be a copy-paste situation. You can’t just put last year’s code on this year’s RIO and expect it to work, as WPILib changes from year-to-year.

If you used something such as Java, you could decompile it and update it to this year’s latest version.

@Benbotics Unfortunately, the code that is deployed to the roboRIO is a compiled version of the one you write in the development environment and I don’t expect it to be recoverable,

For example: If you use LabVIEW, you build and deploy your code as an RT-EXE (which you can think of as an EXE application in your computer, but made for the roboRIO). Thus, the code is not written in a text file with a bunch of code lines, but as a compiled version that strips it down and translates it to instructions that the roboRIO can execute.

If you are using LabVIEW, you can try using the RAD Utility to save the image and be able to load it later. However this is not copying the original code, but the software currently loaded in the device.

I hope this helps. Moving forward, I recommend considering Source Code Control. My team has been greatly benefitted by it!

1 Like

If you are using Java, you could possibly decompile the class files that are in the executable jar. This should do a decent job of getting you code but there’ll be some weirdness if you used anonymous inner classes.

It would be easier to ask for the Driver Station version you need to match what is already on the robot.