Go to Post But now the most important question - is there a practical application for one of these devices on a FIRST robot? - Chris Fultz [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 18-10-2007, 15:29
Guy Davidson Guy Davidson is offline
Registered User
AKA: formerly sumadin
FRC #0008 (Paly Robotics)
Team Role: Alumni
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Ra'anana, Israel
Posts: 660
Guy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to behold
Send a message via ICQ to Guy Davidson Send a message via AIM to Guy Davidson Send a message via MSN to Guy Davidson
WPILib and Eclipse

I was trying to get WPILib working with Eclipse. Following the instructions here, I installed mingw, c18 compiler, CDT, and the two plugins. However, I can't find the right option to create the project, and am stuck there. What am I doing wrong?

Thanks.
  #2   Spotlight this post!  
Unread 22-10-2007, 01:17
Abrakadabra Abrakadabra is offline
Here We Go !!!
AKA: Scott Kukshtel, Mr. K
FRC #3467 (The Windham Windup!)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2002
Location: Windham, New Hampshire
Posts: 160
Abrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant future
Re: WPILib and Eclipse

You must first make sure you copied the two plugins from the .zip file downloaded from the WPILib page into the Eclipse "plugins" directory and restarted Eclipse so they are registered. Note: you must extract the plugin .jar files from the .zip file provided on the WPILib page.

To create a new project:
  1. Choose menu items File->New->C Project.
  2. In the "C Project" dialog that appears, type in your name for the project and adjust the location if necessary.
  3. If you have properly installed the two plugins, there should be a choice in the "Project Type" list that says "Microchip Embedded Systems".
  4. When you select "Microchip Embedded Systems", you will be given a choice of 7 different "Toolchains" to use on the right hand side. Just select the appropriate one for the type of project you are creating and click "Next".
  5. On the next dialog, take the default configuration and click "Finish", or click on the "Advanced Settings" button to see more options.

You will also have to follow the instructions on the WPILib page concerning search and include paths, as well as the linker file and library order. These can all be checked/adjusted in the Project Properties dialog. (Right-click on the project object in the left-hand "Project Explorer" pane and select "Properties").

HTH. If you have more specific questions beyond that, please post again.
  #3   Spotlight this post!  
Unread 22-10-2007, 14:57
Guy Davidson Guy Davidson is offline
Registered User
AKA: formerly sumadin
FRC #0008 (Paly Robotics)
Team Role: Alumni
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Ra'anana, Israel
Posts: 660
Guy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to behold
Send a message via ICQ to Guy Davidson Send a message via AIM to Guy Davidson Send a message via MSN to Guy Davidson
Re: WPILib and Eclipse

Thanks. It works now. I guess I either misssed the option before, or had to relocate the plugins to make it work. Unless it fails to complie or anything like that, I think it should work now.

How exactly do I compile? I found the myriad of options under Project, but I have no idea where they built file goes when I either Build All or define a Make Target. Any idea?

Last edited by Guy Davidson : 22-10-2007 at 16:41.
  #4   Spotlight this post!  
Unread 23-10-2007, 17:55
Abrakadabra Abrakadabra is offline
Here We Go !!!
AKA: Scott Kukshtel, Mr. K
FRC #3467 (The Windham Windup!)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2002
Location: Windham, New Hampshire
Posts: 160
Abrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant future
Re: WPILib and Eclipse

Now you're getting more into the specifics of how Eclipse works, and that's pretty well documented (including steps and examples) in the Eclipse "C/C++ Development User Guide". I recommend you check it out.

Your WPILib project will work just like any other Eclipse C/C++ project; just trust the plugins to create the project for you and make all the right property settings. If you create a project and just add a simple WPILib example file, it should compile and link with no changes required to the Project properties.

After you compile and link, the generated objects and .hex file will be placed in a subdirectory under your project directory, and will be named based on the toolchain that you chose to use (e.g. mine is called "vEx WPILib Robot"). This allows you to use the same project directory and source files for multiple projects (e.g. a Vex project and an FRC project can use the same code; they just need to be compiled and linked differently).

You'll still need to use either the IFI Loader or the one that comes with EasyC to move the .hex file to the robot. Note that you can use the Loader that comes with EasyC (and take advantage of its graphics terminal capability) without actually having an EasyC license on your machine. Just use the graphics terminal routines available in WPILib.

HTH.
  #5   Spotlight this post!  
Unread 23-10-2007, 21:01
Guy Davidson Guy Davidson is offline
Registered User
AKA: formerly sumadin
FRC #0008 (Paly Robotics)
Team Role: Alumni
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Ra'anana, Israel
Posts: 660
Guy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to behold
Send a message via ICQ to Guy Davidson Send a message via AIM to Guy Davidson Send a message via MSN to Guy Davidson
Re: WPILib and Eclipse

Thanks again for your help. I'm almost getting there. I had to mess around with the path variable and eclipse settings a bit, but I got forward. Right now though, I'm getting another error I haven't been able to figure out by myself:

**** Build of configuration vEx WPILib Robot for project test ****

mingw32-make
'Building target: test.hex'
'Invoking: MPLINK Linker'
mplink "..\18F8520.lkr" /a INHX32 /w /m FRCMapfile.map /o"test.hex" ./main.o /l"C:\mcc18\lib" ..\Vex_library.lib ..\WPILibVex.lib
MPLINK 4.12, Linker
Copyright (c) 2007 Microchip Technology Inc.
Error - Could not find linker command file '..\18F8520.lkr'.
Errors : 1

mingw32-make: *** [test.hex] Error 1

I have no idea how to tell it where said linker file is, and I have four files on my machined named "18F8520.lkr": one in the MPLAB\LKR folder, one in the MCC18 folder, and two others in WPILib folders - one in the \2k5 and another in the \Vex. Although there's no one in the \2k6, and I'm using a pretty new installation of mcc18. Could this be a problem? How do I solve this issue?

Thanks again for your help.
  #6   Spotlight this post!  
Unread 24-10-2007, 12:38
Abrakadabra Abrakadabra is offline
Here We Go !!!
AKA: Scott Kukshtel, Mr. K
FRC #3467 (The Windham Windup!)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2002
Location: Windham, New Hampshire
Posts: 160
Abrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant future
Re: WPILib and Eclipse

Oh yeah... I forgot that the project wizard plug-in assumes that your project directory is a subdirectory of one of the toolchain directories under WPILib: \2k5, \2k6, or \Vex. That's why it's looking for "..\18f8520.lkr".

For a Vex project, you want to use the .lkr file in the \Vex directory.

To get your project to look for it in the right place, go to:

- Project Properties dialog
- Left hand tree: C/C++ Build -> Settings
- Tool settings tab
- Left hand tree: MPLink Linker -> Linker Information
- Specify your Linker file pathspec in the top list box
- You can also add library search paths in the second box, and don't miss the "Libraries included in Linking" list box at the bottom (you may have to scroll to see it).

HTH.
  #7   Spotlight this post!  
Unread 24-10-2007, 19:24
Guy Davidson Guy Davidson is offline
Registered User
AKA: formerly sumadin
FRC #0008 (Paly Robotics)
Team Role: Alumni
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Ra'anana, Israel
Posts: 660
Guy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to behold
Send a message via ICQ to Guy Davidson Send a message via AIM to Guy Davidson Send a message via MSN to Guy Davidson
Re: WPILib and Eclipse

It's not really working either. The only way it works as of now is if I have my source files in the WPILIB\Vex folder, and by works I mean this generates a different error. Now, the error is something with the ifi_libraries.o being out of date. I'm pretty sure this is happening because I am usign the mcc18, rather than the older one. I guess I'll have to find one of our CD's with mcc18 v2.4.
  #8   Spotlight this post!  
Unread 25-10-2007, 01:52
Abrakadabra Abrakadabra is offline
Here We Go !!!
AKA: Scott Kukshtel, Mr. K
FRC #3467 (The Windham Windup!)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2002
Location: Windham, New Hampshire
Posts: 160
Abrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant future
Re: WPILib and Eclipse

Yes - you definitely need to have the 2.40 version of mcc18. Newer versions are incompatible with the IFI-provided libraries (plus they cost real money after the trial period

I think if you poke around in the Eclipse project properties box, you'll eventually figure out how and where to put things. I'm still trying to figure out the best organization for my team (FRC, using Vex for prototyping), so maybe when I settle that I'll try to post my findings (and project files) here.
  #9   Spotlight this post!  
Unread 26-10-2007, 15:00
Guy Davidson Guy Davidson is offline
Registered User
AKA: formerly sumadin
FRC #0008 (Paly Robotics)
Team Role: Alumni
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Ra'anana, Israel
Posts: 660
Guy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to behold
Send a message via ICQ to Guy Davidson Send a message via AIM to Guy Davidson Send a message via MSN to Guy Davidson
Re: WPILib and Eclipse

Still no luck. I got my hands on a copy of the c18 compiler, and now tried to build it, and now I'm getting a new error:

**** Build of configuration vEx WPILib Robot for project Vex ****

mingw32-make all
'Building target: Vex.hex'
'Invoking: MPLINK Linker'
mplink "..\18F8520.lkr" /a INHX32 /w /m FRCMapfile.map /o"Vex.hex" ./main.o /l"C:\mcc18\lib" ..\Vex_library.lib ..\WPILibVex.lib
MPLINK 3.90, Linker
Copyright (c) 2004 Microchip Technology Inc.
Error - Coff file '././main.o' does not appear to be a valid COFF file.
Errors : 1

mingw32-make: *** [Vex.hex] Error 1

main.c is my source file. Could this imply a problem with my code? Or what am I looking at?
  #10   Spotlight this post!  
Unread 26-10-2007, 23:53
Abrakadabra Abrakadabra is offline
Here We Go !!!
AKA: Scott Kukshtel, Mr. K
FRC #3467 (The Windham Windup!)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2002
Location: Windham, New Hampshire
Posts: 160
Abrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant future
Re: WPILib and Eclipse

I'm not sure if this is the solution, but try changing the link order of the Vex_library.lib and WPILibVex.lib - I think you have them backwards.
  #11   Spotlight this post!  
Unread 27-10-2007, 00:32
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 592
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: WPILib and Eclipse

Error - Coff file '././main.o' does not appear to be a valid COFF file.


That last COFF file error might be that the program is being compiled with the new microchip compiler rather than the 2.4 (I think) compiler that comes with the kit. The object file formats are incompatible.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
  #12   Spotlight this post!  
Unread 27-10-2007, 01:01
Guy Davidson Guy Davidson is offline
Registered User
AKA: formerly sumadin
FRC #0008 (Paly Robotics)
Team Role: Alumni
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Ra'anana, Israel
Posts: 660
Guy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to behold
Send a message via ICQ to Guy Davidson Send a message via AIM to Guy Davidson Send a message via MSN to Guy Davidson
Re: WPILib and Eclipse

Mr. K, I'll try that. If that doesn't work, I might restart the process on another computer, and see if I can get it to work there. Unless I get a different error message.

Bard, I would be surprised if that's it. I removed mcc18 v3.0, completley deleted the folder, and installed v2.4 from the cd that comes in the kit. Any other ideas?
  #13   Spotlight this post!  
Unread 28-10-2007, 14:22
Abrakadabra Abrakadabra is offline
Here We Go !!!
AKA: Scott Kukshtel, Mr. K
FRC #3467 (The Windham Windup!)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2002
Location: Windham, New Hampshire
Posts: 160
Abrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant future
Re: WPILib and Eclipse

"I removed mcc18 v3.0, completley deleted the folder, and installed v2.4 from the cd that comes in the kit. Any other ideas?"

Make sure you do a "clean" build, i.e. delete all the old object files (.o) from your project as well. If any are hanging around from when you used the newer compiler, they will cause problems.
  #14   Spotlight this post!  
Unread 29-10-2007, 21:56
Guy Davidson Guy Davidson is offline
Registered User
AKA: formerly sumadin
FRC #0008 (Paly Robotics)
Team Role: Alumni
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Ra'anana, Israel
Posts: 660
Guy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to behold
Send a message via ICQ to Guy Davidson Send a message via AIM to Guy Davidson Send a message via MSN to Guy Davidson
Re: WPILib and Eclipse

It worksssss! Doing a clean build from eclipse didn't fix it. However, going and manually erasing the old object files did the trick. Now I can start programming!
  #15   Spotlight this post!  
Unread 31-10-2007, 19:35
Guy Davidson Guy Davidson is offline
Registered User
AKA: formerly sumadin
FRC #0008 (Paly Robotics)
Team Role: Alumni
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Ra'anana, Israel
Posts: 660
Guy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to behold
Send a message via ICQ to Guy Davidson Send a message via AIM to Guy Davidson Send a message via MSN to Guy Davidson
Re: WPILib and Eclipse

And now I'm running into trouble again. I am having a hard time using user input (from the Vex OI right now, though I will be moving to working with FRC control systems soon) to do anything.

I've tried the OIToPWM, but I don't understand what the function variable is. I kinda get the rest. I've also tried the Tank2 command, but couldn't get that to work either. Any ideas? Obviously I've read the WPILib documentation, but that wasn't too useful with the basic things.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Eclipse Development Astronouth7303 Programming 39 16-12-2007 02:52
"Full screen mode" in Eclipse/Easy Eclipse Kelly Programming 0 15-07-2007 16:37
Direct Control of PWMs and OI in WPILib CyberWolf_22 Programming 7 06-02-2006 19:06
using eclipse dasRatsel Programming 82 02-01-2006 13:20


All times are GMT -5. The time now is 19:35.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi