-
Notifications
You must be signed in to change notification settings - Fork 2k
Using the Eclipse IDE for C and CPP Developers, Howto
BytesGalore edited this page Jul 7, 2014
·
27 revisions
This brief howto is meant as a quick guidance to start developing using RIOT-OS and eclipse.
It should give at least a hint how to start developing with eclipse.
Right now this howto is focused on the native
board.
Before we start it is assumed that:
- the OS used for development is equipped with a working and somehow current GCC toolchain (
native
) - the RIOT GIT-repository have been cloned, (head over to the getting started guide if you're uncertain how to obtain the RIOT source)
- and the Eclipse IDE for C/C++ Developers is installed/available.
We use the default
project for this tutorial, which requires to have at least one tap
device / interface available.
(using linux, type sh ./cpu/native/tapsetup.sh create 1
to create one tap device tap0
)
- Start the eclipse IDE and switch to the workbench
- Now we create a new Makefile project with existing code by clicking on: File→New→Makefile Project with Existing Code
- A new window shows up asking for the directory containing the source and the Makefile.
- for
native
we select the main directory of RIOT and choose the Linux GCC in the Toolchain and indexer Settings and click Finish
- We select the RIOT project in the Project explorer and click the Project→Properties menu.
- Presented with a Properties for RIOT window we change the Build Location to the project we want to work with (i.e.
${workspace_loc:/RIOT}/examples/default
) - Optionally for debugging (
native
) we unselect theuse default build command
checkbox and entermake all-debug
as build command
After setting the project properties we build the set project by clicking Project→Build All.
- We click on Run→Run Configurations... which opens the Run Configurations window
- There we add a new launch configuration (if not already present)
- Now we adjust the C/C++ application: path to the just now built executable relative from the RIOT main folder, i.e.
examples/default/bin/native/default.elf
- We switch to the (x) = Arguments tab and add
tap0
to the Program Arguments: - We hit the Apply button and if everything went right,
- hitting the Run button executes our built project
Repeat the setup for Debug Configurations if not applied automatically by Eclipse, to enable debugging.