Sorry for the long post, but I hope this is useful to someone who wants to use Eclipse to develop their robot software. It would have helped me.
To configure the open source Eclipse IDE as a replacement for MPLAB on a Windows platform, here are the steps I used:
Download and install the Eclipse Platform SDK (3.0 or greater) from http://www.eclipse.org. This is the basic IDE which is only setup for Java code development.
Download and install the Eclipse C/C++ Development Tools (CDT) from Eclipse CDT™ (C/C++ Development Tooling) · GitHub. This is a plug-in that will tailor Eclipse for C code development.
Download and install a copy of a “make” utility. I used GNU make that somebody compiled for windows (GNU make for Windows), but you might find other versions. Microsoft’s nmake might also work, but I
haven’t tried it.
Set your “path” environment variable for mpasm, mcc18\bin and gmake. I used: C:\Progra~1\mcc18\mpasm;C:\Progra~1\mcc18\bin;C:\Progra~1\gmake. Note that make sometimes has problems with spaces in path names, so it is best to use the DOS 8.3 alias (i.e. “Progra~1” instead of “Program Files”).
Create a file called “makefile” in the folder with your C source code. You can tailor the one below (also attached) to your liking. Be sure to replace multiple spaces at the beginning of lines with <tabs> if you cut and paste. A make manual is located at: GNU make
Verify your makefile is working well from a DOS command prompt by trying “make clean” and “make all” commands.
Start Eclipse and create a new Standard Make C Project and select options as follows:
- Fill in project name and uncheck the “Use default” box to set the directory to point to your robot code.
- The defaults on the Make Builder tab should be fine
- On the Error Parsers tab, only the CDT GNU C/C++ Error Parser box should be checked.
Try a Project > Clean and a Project > Build All commands and see if your code builds properly. Any code errors should show up in the Problems tab of the console window and you can click on an error and be taken to that point in the code just like in MPLAB. If you have makefile problems, you can edit it from within Eclipse.
That’s it. I know everybody has their favorite IDE, but for those who like Eclipse, this will give you all the functionality of MPLAB with the exception of the simulator.
Software Mentor / Volunteer
Team 1329: GO ROBOREBELS!
#************** Example Makefile ***********************
#RENAME AS NEEDED
#del for windows, rm for unix
RM := del /F
LINKER = mplink
CC = mcc18
CFLAGS = -i"C:PROGRA~1\mcc18\h" -nw=2066
DEFINES = -D_FRC_BOARD -D_PRIORY_CAMERA
optimization parameters (default = full optimization)
OPT_DEBUG=-Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
make a list of object files that match all C files
OBJFILES := (patsubst %.c,%.o,(wildcard *.c))
COMPILE=(CC) (PICFLAG) < -fo=@ (CFLAGS) (DEFINES) $(OPT)
#re-link if any object file changed
(LINKER) "18f8520user.lkr" (OBJFILES) “FRC_library.lib” /l (LIB_PATH) /m (PROJECT).map /o $(PROJECT).hex
%.o: %.c *.h
#delete all the build files so you can start from scratch.
Example_makefile.txt (2.4 KB)
Example_makefile.txt (2.4 KB)