[!WARNING]
NOTE Using eclipse is not supported by the smoothie developers, you are on your own if you decide to use it.
I first want to thank David Cabanis for the e-mail that he sent me a few months ago. It forms the core of this page. David, You Rock!
Install Eclipse with C/C++ and GNU Support
To get started, you need to install Eclipse. To this you will add support for the GNU tool chain used by the Smoothie project. At the time this page was written, Eclipse 4.4 (Luna), was the current release. This guide also applies to later versions - 4.5 (Mars) and 4.6 (Neon).
Eclipse is a Java application and requires at least version 6 of the Java Runtime Environment, JRE, be installed on your machine. On Windows and Linux, you will want to make sure that you have this Java requirement installed. On OS X, it will detect the Java requirement when you first attempt to run Eclipse and offer to install it for you if not already installed.
Go to Eclipse Downloads to download and decompress the Eclipse IDE for C/C++ Developers archive.
Now startup that shiny new version of Eclipse by executing the Eclipse binary at the root of the decompressed Eclipse files. There is no separate install process required for Eclipse. If Eclipse fails to start, it is probably due to a missing JRE.
On initial startup, it will ask where you want your workspace to be located. Select an empty directory where you want to place your Eclipse-C/C++ projects or select an old CDT workspace. If you use only one workspace, check the item to always use this as the default and not ask on every startup.
Keep the workspace directory in mind, you’ll need it later. You can say if a directory is a workspace directory from its sub-directory named “.metadata”
Close the Welcome tab
On the Help menu, select the Install New Software… option.
On the install dialog, press the Add… button near the upper right hand corner.
Set Name: to Eclipse for ARM.
Set Location: to http://gnuarmeclipse.sourceforge.net/updates
Click the Ok button.
There should now be a GNU ARM C/C++ Cross Development Tools item listed on the Install dialog. It may take several seconds to populate this item into the list. Once it appears, check it.
Now press the Next button.
At this point an install wizard appears. You can just keep clicking through this wizard to allow it to progress.
At some point it will complain about unsigned content. Ignore this warning by pressing the Ok button.
At the end of the install wizard, press the Restart Now button.
[optional] If you like to use the GIT plugin for eclipse repeat the previous step with the following package source and package selection:
Luna - http://download.eclipse.org/releases/luna
Collaboration/Eclipse Git Team Provider, Collaboration/Java implementation of Git
Create Eclipse Project for Smoothie
Open a shell and change into the workspace directory using cd
In this, check out the Smoothieware source repository as described in Getting Smoothie
If you wish, you can switch between branches using the git eclipse plugin later
In the workspace directory there should be a directory named Smoothie now. It will be our the project directory
[optional] you might want to rename the project directory. At this time this can be done in your shell. If you decide to do so later, do it in eclipse.
Type make all to test, if the compiler works. The first build will take a while. To speed that up you might provide the parameter -j <number of cores + 1> to make (e.g. make -j 3 all)
Go back to Eclipse
On the File menu select New > Makefile Project with Existing Code
Set Existing Code Location to the project directory.
If the Project Name field wasn’t automatically filled in with the name of your project directory (e.g. Smoothie) then set it to that manually.
Leave the options C and C++ checked
Select Cross ARM GCC toolchain from the Toolchain for Indexer Settings list.
Click the Finish button.
Now you have to be quick: In the lower right corner there is the progress icon. Click it. If it isn’t there, click Window->Show View->other and select General/Progress
When the C/C++ Indexer is running in the Progress view, stop it by clicking the red square icon.
The reason is that the CHECKSUM()-macro causes an out of memory-exception in the indexer.
To correct this, unfold the structure in the Project Explorer and open src/libs/checksumm.h
This change does not affect normal compilation or build in Eclipse. It only affects the Indexer of Eclipse.
Insert at line 54:
#ifdef __CDT_PARSER__
#define CHECKSUM(X) ((uint16_t)sizeof(X))
#else
Insert at the end of the file before the line #endif /* CHECKSUM_USE_CPP */:
#endif /* __CDT_PARSER__ */
Save and close checksumm.h
Mark this change as ignored for Git as the Dev Team does not like it:
Either by right click on the file in Project Explorer and select Team->Advanced->Assume unchanged
Or by executing the command git update-index --assume-unchanged src/libs/checksumm.h
Right-click on the Smoothie project in the Project Explorer pane.
Select Properties from the pop-up menu.
Select Index->Rebuild
This should complete in a short time, now.
You now have a new created project named like the project directory in the left pane, Project Explorer. Let’s now create a build configuration that can build Smoothie sources under Eclipse uses the existing makefile.
Right-click on the Smoothie project in the Project Explorer pane.
Select Properties from the pop-up menu.
Click the arrow to left of C/C++ Build item in left pane to expand its sub-items.
Select the Settings sub-item.
Click the Manage Configurations… button towards the upper right hand corner of the dialog.
Click the New… button.
Set Name: to Release
You should be able to accept the default of Copy settings from > Existing configuration > Default.
Click the Ok button.
Select Release configuration from the list of the small configurations dialog and then press the Set Active button.
Click the Ok button.
At the top of the properties dialog set Configuration: to Release
In the “Toolchains” tab, uncheck Use global tool chain path (This has moved to the “Tool Paths” tab from Eclipse 4.5 onwards)
Behind the Per project path, click Browse…
Select the gcc-arm-none-eabi subdirectory of your project directory
If the Indexer does not find the Types of the mbed system (e.g. SDCard, USB, DFU, SDFAT, … in main.cpp), try this:[This seems to be not necessary any more, I keep it here for testing]
Go to project properties
Click the arrow to left of C/C++ General item in left pane to expand its sub-items.
Select the Paths and Symbols sub-item.
Select the Includes tab
Click the Add.. button. This will pop-up the Add directory path dialog.
Set Directory: to ${ProjDirPath}/mbed/drop/LPC1768
Check both Add to all configurations and Add to all languages.
Click the Ok button.
Add another directory and set it to ${ProjDirPath}/mbed/drop using the same steps as before.
Select the Symbols tab.
Click the Add… button. This will pop-up the Add Symbol dialog.
As name, insert __LPC17XX__.
Check both Add to all configurations and Add to all languages.
Click the Ok button.
At this point you can click the Ok button on the Properties dialog.
Clean and Build the Project
To clean select Project->Clean..: from the main menu. Make your selection and click ok.