Page 1 of 1

Import Demo into Eclipse

Posted: Mon Feb 20, 2012 10:25 pm
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?

Re: Import Demo into Eclipse

Posted: Mon Feb 20, 2012 10:35 pm
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

Re: Import Demo into Eclipse

Posted: Tue Feb 21, 2012 7:11 pm
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

Re: Import Demo into Eclipse

Posted: Tue Feb 21, 2012 7:34 pm
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

Re: Import Demo into Eclipse

Posted: Wed Feb 22, 2012 8:09 pm
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

Re: Import Demo into Eclipse

Posted: Fri Feb 24, 2012 5:38 pm
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.

Re: Import Demo into Eclipse

Posted: Wed Mar 14, 2012 11:41 am
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?

Re: Import Demo into Eclipse

Posted: Wed Mar 14, 2012 11:47 am
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

Re: Import Demo into Eclipse

Posted: Wed Dec 12, 2012 10:20 pm
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.