Skip to content

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.

Prerequisites

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.
Please note:

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)

Setup the eclipse IDE for RIOT development

  1. Start the eclipse IDE and switch to the workbench
  2. Now we create a new Makefile project with existing code by clicking on: File→New→Makefile Project with Existing Code
  3. 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

Picking our specific project

  1. We select the RIOT project in the Project explorer and click the Project→Properties menu.
  2. 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)
  3. Optionally for debugging (native) we unselect the use default build command checkbox and enter make all-debug as build command

After setting the project properties we build the set project by clicking Project→Build All.

Setting parameters for our specific project

  1. We click on Run→Run Configurations... which opens the Run Configurations window
  2. There we add a new launch configuration (if not already present)
  3. 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
  4. We switch to the (x) = Arguments tab and add tap0 to the Program Arguments:
  5. We hit the Apply button and if everything went right,
  6. hitting the Run button executes our built project

Repeat the setup for Debug Configurations if not applied automatically by Eclipse, to enable debugging.

This litte howto ends here for now. I hope it was somehow helpful. So, Happy RIOT-ing!
Clone this wiki locally