[WindRiver]Creating a fresh buildable project

Our team has had problems downloading our own code to the robot. All the sample code works, however when we went to create our own project, it would either not build, or not download (producing the infamous no code error). However after working on this, Andrew (basicxman) and I have come up with a solution that will create our own working project. The following are steps we took to do this and I hope it will help.

  1. Make sure all updates are installed and cRIO is imaged using v19.
    The updates that are needed are:
    a. Labview Update
    b.Driver Station Update
    c.Missing File Needed
    d.Workbench Update
    The correct way to install the Driver Station can be found at this post: http://www.chiefdelphi.com/forums/showpost.php?p=899969&postcount=44

  2. Open WindRiver. Go to File->New->Vxworks Downloadable Kernel Module

  3. Name your project, and choose it’s location. Then click next.

  4. Click next if you do not want to reference any subprojects.

  5. Do not change anything in the “Buid Defaults” or “Build Support” window, instead just click next.

  6. In the Build Specs window, unclick the following check boxes: “PPC32diab”, “PPC32gnu”, and “PPC603diab”. “PPC603gnu” should be the only box left checked. Click next.

  7. Click next one more time and then click finish.

  8. Enter the project explorer on the left-hand side of windriver. Right click on the project you just created and click “Properties”.

  9. Click “Build Properties” on the sidebar and select the “Build Support and Specs” tab. Under “Available and enabled build specs”, make sure the only checked checkbox is “PPC603gnu”.

  10. Select the “Build Paths” tab. Click the “Add…” button. In the pop-up window, type (without quotations) “-I$(WIND_BASE)/target/h/WPILib”. Click OK.

  11. Select the “Libraries” tab. Click the “Add…” button. In the pop-up window, select the “Add full qualified library file” radio button. In the textbox, type (without quotations) “$(WIND_BASE)/target/lib/WPILib.a”. Click OK.

  12. Back in the properties window, click OK.

  13. Now it’s time to add your code. Right click the name of your project in the project explorer and click New -> File. Name your file whatever you choose but make sure it has a .cpp extension.

  14. Write all your code.

  15. If you include any files, check to see if it’s in the WPILib Library. To do this, under your project, select Includes -> (file path ending with WPILib) and check if the file you included is there. If it is, disregard the rest of this step. If it’s not, find out where this file is located. Now right-click on your project name in the project explorer. Click “Import…”. Select General -> File Path -> Next, and then browse for the file. Check the files you want to include in your program. If there’s a corresponding .cpp file with the .h file, import it too. Now click finish. This is an important step. Even if you specify the exact path in your program, if it’s not in the WPILib library, it must be imported.

  16. Make sure you are connected to the cRIO in the “Remote Systems” tab to the left side of windriver. If not, right click your robot name and click connect.

  17. Click FIRST -> Undeploy from the menu bar at the very top of the window.

  18. Then go to Window->Preferences and select “FIRST Downloader Preferences”. Enter your team number in the format XXXX. Then click browse and navigate to your project folder. Enter the PPC603gnu folder followed by ProjectName\Debug and select the .out file. Click OK.

  19. Click FIRST->Download to download the code to the cRIO. Make sure the download window does not just flash across the screen. If it does, make sure you have all the build setting and includes set properly as previously described.

  20. Reboot the cRIO and run your code!

Note the first time you build your code, you may have to exit WindRiver, then reopen it and rebuild your project.

I hope this helps those of you who are having troubles creating your own projects or downloading code. Please reply if you need further assistance.

  • Mike and Team 2200

We’ve developed a convention that we just start all of our little code projects from the SimpleTemplate example and modify from there. Then everything is already setup correctly.

Another advantage of this is that when we’re running in debug mode, everyone knows to just look for ‘SimpleTemplate.out’ and delete that on the remote connection, instead of trying to figure out what the name of the project that the other people are using.

However, I’m sure someone will find your instructions useful.

Excellent write up on how to set up a project from scratch.

If I copy a project using windows explorer, how can I get that project to show up in workbench?
Brian?

Hi, that is a good question, as I don’t think there is a simple one-step way in just opening a project like you can a file. I will keep looking and let you know if I find an answer. However, I do know how to do it in a few steps.

First, create a project the same way I explained in my first post. Specifically, do steps 1 - 12 (including step 12). Now right-click on the project you just created in the project-explorer and click “Import…”. Now in the pop-up window, click General -> File Path -> Next. Locate the folder the project you copied is in, and select all the .h and .cpp files from this folder. Click finish to import these files. Now continue with my initial instructions at step 15.

I hope this helps!

-Mike and Team 2200

Thanks for those detailed steps! Having used eclipse for a long time for Java development, I wanted to create a new, clean project after our sample robot code got a little out of hand after renaming files. :slight_smile: So to have the steps for a non-Java project for an embedded system there like that really helped.

As for getting an existing (copied) project into a workspace, you can right-click in the Project Explorer, select Import…, then select to expand General, and then select Existing Projects into Workspace. Point it at the base directory of the project, and it will pick up the project file with the settings, and bring it all in to the workspace.

Hope that helps!

The solution is never use Windows explorer to manipulate Workbench projects or project files.
Use the Workbench Project Explorer instead.
Someone else has already described how to Import projects that are not already in your Workspace.

If you want to make a copy of a project that already exists in your workspace:

  1. in the Project Explorer, right-click the project and select Copy in the pop-up context menu
  2. in the Project Explorer, right-click in the white space and select Paste in the pop-up context menu – this will pop up a Copy Project dialog box
  3. in the Copy Project Dialog, type in the name you want for the copied project – the default name will be “Copy of <whatever>” just like in Windows Explorer.

(You can also click on the project (to highlight it) and then use CTRL-C to copy and CTRL-V to paste)

Note that either way, the Copy Project dialog will have “Use default location” checked by default – leave it checked.