Import Demo into Eclipse

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
Joerg-SH
Posts: 29
Joined: Mon Feb 20, 2012 9:00 pm

Import Demo into Eclipse

Post by Joerg-SH »

I try to add a Demo Projekt in Eclipse
Importing Makefile projects into Eclipse

The first step is to import a makefile project into the Eclipse environment. ChibiOS/RT demos do not include Eclipse project files but just a normal Makefile. Eclipse is able to import a Makefile project and create its own project file so this is not a problem. This is how it is done:

Open you Eclipse environment and select the workspace created into the ChibiOS/RT project directory.
From within Eclipse select “File→New→C_Project”, a dialog box will show.
Select “Makefile_project→Empty_Project” in the “Project type:” box.
Select ”– Other Toolchain –” in the “Toolchains:” box.
Unselect the “Use default location” check box.
Select the demo directory using the “Browse…” button. Something like ”C:\Projects\ChibiOS-RT\demos\ARMCM3-STM32F103-GCC” will appear in the “Location:” box.
In the project name box put the same name of the directory containing the demo, ”ARMCM3-STM32F103-GCC” in this example.


Compile and Run is no Problem but all sub directories missing and also eclipse mark a mistake of missing file

Unresolved inclusion: "ch.h"

how I can fix that?
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Import Demo into Eclipse

Post by Giovanni »

It is because Eclipse cannot "see" the files outside the demo directory. Create a new folder into the project (File->New->Folder) but instead giving it a name, select "Advanced..." and link it to the ./os folder of ChibiOS, then re-index the project (right click->index->rebuild). Eclipse should now be able to see all files and symbols.

Giovanni
Joerg-SH
Posts: 29
Joined: Mon Feb 20, 2012 9:00 pm

Re: Import Demo into Eclipse

Post by Joerg-SH »

Hello Giovanni,
thank You for Your help.
Thats works.

Now Eclipse shows a lot of errors like:
Description Resource Path Location Type
Symbol 'NULL' could not be resolved main.c /ARMCM4-STM32F407-DISCOVERY line 81 Semantic Error


I have to do more changes for eclipse properties?

Greetings

Joerg
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Import Demo into Eclipse

Post by Giovanni »

Heh, that is the static code checker introduced in Eclipse Indigo, in their infinite wisdom it is always active by default, I just disabled it, too much noise.

Window->Preferences->C/C++->CodeAnalysis then disable all checks you don't want to see.

Hopefully it will improve in next versions, I hope they make it something you run when needed and not always active.

Giovanni
Joerg-SH
Posts: 29
Joined: Mon Feb 20, 2012 9:00 pm

Re: Import Demo into Eclipse

Post by Joerg-SH »

Ok thank You. It is a little bit confusing but I think I can live with it ;)

Tomorrow is the last Day of the Week for me and than I have more time to get more experience...

Next step ist to make the debugger run with eclipse. I think there will be more question than ;)

so long

Jörg
Joerg-SH
Posts: 29
Joined: Mon Feb 20, 2012 9:00 pm

Re: Import Demo into Eclipse

Post by Joerg-SH »

By the way...

I use True-studio lite for ST now.

I makes all a little bit easier as to use eclipse.
cambotero
Posts: 1
Joined: Wed Mar 14, 2012 11:33 am

Re: Import Demo into Eclipse

Post by cambotero »

hi, I'm trying to work with the STM32L-discovery demo from chibios, and I had the same problems as Joerg-SH... after following your answers for solving them, I've found a new problem:

I'm using yagarto toolchain, and when I build the demo, it looks like eclipse don't recognise basic definitions like uint32_t, uint16_t... do you know what could be the problem with that?
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Import Demo into Eclipse

Post by Giovanni »

Hi,

First build the project at least one time then right click on the project in Eclipse and try to reindex it, Eclipse should rescan all symbols.

Giovanni
davidji
Posts: 12
Joined: Wed Dec 12, 2012 9:48 pm
Been thanked: 1 time

Re: Import Demo into Eclipse

Post by davidji »

I think all the above problems are because the eclipse doesn't add the include folder from the cross compiler, and hence doesn't find <stddef.h> which includes NULL, size_t, uint32_t, uint16_t, etc. Once you add that by hand, the errors and warnings go away and there is no need to disable the static analysis.
Post Reply