New tool for C++ Programming for old cRIOs

If your team is like mine and has a bunch of old cRIOs laying around for prototyping use or installed on old robots to use for demonstrations and such, and you’ve been programming them using C++, you may have recently found yourself unable to program them anymore due to an expired WindRiver Workbench license!

Well, we’ve developed a relatively simple to use plug-in for Eclipse that enables teams to continue to develop programs for their old cRIOs without WindRiver Workbench. This enables cRIO development alongside current roboRIO-based development in the same IDE.

If this interests you and your team, you can get the plug-in by following the instructions on the project page over at Teamforge:
https://usfirst.collab.net/sf/projects/thunder_crio_c_tools/

The instructions and Eclipse update site link are on the Wiki page:
https://usfirst.collab.net/sf/wiki/do/viewPage/projects.thunder_crio_c_tools/wiki/HomePage

Thanks go to Patrick Plenefisch of WPI for bundling the toolchain that backs the plugin.

Huzzah and such. Thanks for filling the void.

Very cool! Thanks.

Thank you very much, now we can use our RioPaperWeights again…

Glad teams are finding it useful.

If you have problems with it, please feel free to reply to this thread or create a tracker on the teamforge project page (you do not need to be a member of the project to create a tracker, you only need to have an account on teamforge which anyone can create).
Please don’t create new CD threads for problems as the students responsible for this project and I are not regularly monitoring CD for such.

Firstly, thank you for making this. this is a big help for our team as we cant afford to buy 9000+ roboRIO’s :stuck_out_tongue:

Now, i am having an issue. we installed the toolchain, installed the plugin, everything is there and it works. We are trying to import last years code in so we can get that bot up and running, following the instructions we made a new project, got rid of the sample cpp, imported ours (just one file as we haven’t done multithreading until this year, also didn’t have a header file) and i opened up the project. go to look for it in Eclipse, nothing was there. the file is in the src directory, so we are confused on what else needs to be done to find the code, and have it show up.

You are welcome!

Now, i am having an issue. we installed the toolchain, installed the plugin, everything is there and it works. We are trying to import last years code in so we can get that bot up and running, following the instructions we made a new project, got rid of the sample cpp, imported ours (just one file as we haven’t done multithreading until this year, also didn’t have a header file) and i opened up the project. go to look for it in Eclipse, nothing was there. the file is in the src directory, so we are confused on what else needs to be done to find the code, and have it show up.

When you say you “imported” your code, how did you do that?
If you place the files in the src directory using, say, Windows explorer or some other method, you may need to tell Eclipse to re-scan the directories for source files. You can do this by right-clicking the project and choosing “Refresh”.
How I tend to import existing sources is this way: Start with a new project. Remove the sample/starter cpp file if you don’t need it. Open Windows explorer and browse to the files you wish to import. Drag & Drop all cpp files into the src folder in the new project inside Eclipse. If it prompts you, tell it you want it to copy the files. Do the same for any headers you have, but drop them to the include folder instead.

Let me know if this doesn’t get you going; leave as much detail as possible!

Theres a reason why i am not the head programmer. This worked, and theres almost no errors with the code! going to fix those errors and see if we can get it on the cRIO, thanks again for this!

Great! Hope the tools prove helpful for you and your team!

So, we tried to use this plugin, but whenever we try to build the program, there are a number of errors.
‘Invoking: Thunder cRIO Tools C++ Compiler’

g++ -DCPU=PPC603 -DTOOL_FAMILY=gnu -DTOOL=gnu -D_WRS_KERNEL -IC:\Users\TEAM 4917\workspace\boom\include -I"C:\Program Files (x86)\FRC_Toolchain\mingw\powerpc-wrs-vxworks\wind_base/…/include/WPILib" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/robot.d" -MT"src/robot.d" -o “src/robot.o” “…/src/robot.cpp”

g++: error: 4917\workspace\boom\include: No such file or directory

mingw32-make: *** [src/robot.o] Error 1

Those are the last three lines of the build log.
Any help would be appreciated, thanks!

Looks like there may be a bug when the user files are within a directory path which contains spaces.

I will try to fix it in the next couple of days. In the meantime, if you move your Eclipse workspace (File>Switch Workspace, choose a new directory, perhaps c:\eclipseworkspace or something) things should work just fine.

Sorry about this - we’ll see if we can’t get it fixed! Thanks for the details!


g++ -DCPU=PPC603 -DTOOL_FAMILY=gnu -DTOOL=gnu -D_WRS_KERNEL -IC:\Users\TEAM 4917\workspace\boom\include -I"C:\Program Files (x86)\FRC_Toolchain\mingw\powerpc-wrs-vxworks\wind_base\/../include/WPILib" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/robot.d" -MT"src/robot.d" -o "src/robot.o" "../src/robot.cpp"

g++: error: 4917\workspace\boom\include: No such file or directory

mingw32-make: *** [src/robot.o] Error 1

The first -I needs to have its path in quotes because of the space in the “TEAM 4917” directory name. It should be this instead:


g++ -DCPU=PPC603 -DTOOL_FAMILY=gnu -DTOOL=gnu -D_WRS_KERNEL -I"C:\Users\TEAM 4917\workspace\boom\include" "C:\Program Files (x86)\FRC_Toolchain\mingw\powerpc-wrs-vxworks\wind_base\/../include/WPILib" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/robot.d" -MT"src/robot.d" -o "src/robot.o" "../src/robot.cpp"

This is actually generated by the tool suite. It can be fixed by hand as you mention, but ultimately it is a bug in the tool suite. We’ll get it fixed soon.

how would we be able to fix it by hand, we are on a fairly tight time constraint with this project. thank you for all the help and efforts so far :smiley:

The easiest way is to place your Eclipse workspace in a location (folder) that does not contain spaces as described in my earlier post. Go to File->Switch Workspace in Eclipse. Browse to your c:\ directory and create a new folder and select that to be your workspace. Then do everything you’d been doing before (you can even copy the project from the old workspace to this one if you want). This will work around this issue.

The other option is to edit the compiler options to fix as per Alan’s suggestion. Right click the project in Project Explorer in Eclipse. Choose properties. Expand C/C++ Build in the tree at left, then choose Settings under it. In the right side of the window, expand “Thunder cRIO Tools C++ Compiler” if it is not already, then pick “Includes” under that. The first entry in the list at right under “Include Paths” should be your project’s include directory. Double-Click this entry to bring up the edit box for it, then put double quotes (") both at the beginning and at the end of the text that is already there. Click “OK” all the way out, then try to build again. It should resolve the issue.
Alternatively if you do not use any header files in the include directory of your project, you can just delete that first entry instead of editing it to add the quotes.

i followed the steps that you provided and im still getting cc1plus.exe has stopped working and the error
mingw32-make: ***[src/robot.o] Error 1
if you have any ideas on how to fix this i would greatly appreciate it

Did you elect to move the workspace to a path without spaces, or did you try fixing the quoting issue in the settings?

If you didn’t try moving the workspace yet and re-creating the project files (make a new project entirely in the new workspace, then re-import your sources to it), I would strongly suggest trying that. If that does not work, can you provide more details about your computer system and eclipse version?

I moved the work space and it got rid of that error now there is a error with START_ROBOT_CLASS (SimpleRobotDemo); we noted it out and the 3 errors went away. All 3 are semantic errors for the same line.

I have an Eclipse Luna with only Java support installed. So I added the C++ CDT via “Install New Software” from the luna cdt site. Then I installed the tool chain. Then I installed the Thunder cRio Tools. This all appeared to work correctly.

When I try to create a C++ project, under the shared library folder, there is no “FRC cRio Binary” option as described in the documentation. Also, the tool chain does not appear in the right hand window (at least not that I can identify…there are tool chains listed but no FRC specific name) if it is supposed to.

Do you have JDK installed? if not then install that and also make sure you read and follow the instructions given on the website carefully. i had the same issue and uninstalling everything and re doing it fixed it for me.