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.
-
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 -
Open WindRiver. Go to File->New->Vxworks Downloadable Kernel Module
-
Name your project, and choose it’s location. Then click next.
-
Click next if you do not want to reference any subprojects.
-
Do not change anything in the “Buid Defaults” or “Build Support” window, instead just click next.
-
In the Build Specs window, unclick the following check boxes: “PPC32diab”, “PPC32gnu”, and “PPC603diab”. “PPC603gnu” should be the only box left checked. Click next.
-
Click next one more time and then click finish.
-
Enter the project explorer on the left-hand side of windriver. Right click on the project you just created and click “Properties”.
-
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”.
-
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.
-
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.
-
Back in the properties window, click OK.
-
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.
-
Write all your code.
-
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.
-
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.
-
Click FIRST -> Undeploy from the menu bar at the very top of the window.
-
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.
-
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.
-
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