I'm new to ChibiOS and trying to setup the environment carefully following the guides provided. I've tried it a couple of times, and keep getting stuck at the same place. When I try to import a Makefile project into Eclipse, it appears to work, but the resulting code gives over 100 errors when doing a build. I'm using the STM32F4-Discovery project as my import target. It appears that none of the functions in the Chibios include files are being recognized, and the errors are things like,
Description: Symbol 'CH_FREQUENCY' could not be resolved
Resource: main.c
Path: /ARMCM4-STM32F407-DISCOVERY
Location: line 195
Type: Semantic Error
A large number of the errors were eliminated by directing Eclipse to explicitly look at specific paths to ChibiOS (see attachment). Certainly this is an ugly workaround and indicates a more fundamental problem. Any suggestions?
Eclipse - Chibios setup problem
Moderators: RoccoMarco, lbednarz, tfAteba
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Eclipse - Chibios setup problem
Hi,
Those are two distinct issues.
The many errors are caused by the Eclipse (Indigo) static code analyzer, a royal pain in the .... I disabled it entirely, you can do that in "Code Analysis" in the properties (clean the errors from the view or they will stay there forever).
About paths, Eclipse can discover them automatically, make sure that the auto discover is enabled in "C/C++ Build"->Discovery Options. Then make a build and it will parse paths from the log. The paths will appear under "C/C++ General"->Paths and Symbols. First remove the paths you added manually (and note, I don't see that tab where you added the paths, your import procedure probably was a bit different from mine, I don't have distinct "debug configurations" either).
After the paths are discovered reindex the project in order to allow CDT to store all symbols: rclick->Index->Rebuild.
Giovanni
Those are two distinct issues.
The many errors are caused by the Eclipse (Indigo) static code analyzer, a royal pain in the .... I disabled it entirely, you can do that in "Code Analysis" in the properties (clean the errors from the view or they will stay there forever).
About paths, Eclipse can discover them automatically, make sure that the auto discover is enabled in "C/C++ Build"->Discovery Options. Then make a build and it will parse paths from the log. The paths will appear under "C/C++ General"->Paths and Symbols. First remove the paths you added manually (and note, I don't see that tab where you added the paths, your import procedure probably was a bit different from mine, I don't have distinct "debug configurations" either).
After the paths are discovered reindex the project in order to allow CDT to store all symbols: rclick->Index->Rebuild.
Giovanni
Re: Eclipse - Chibios setup problem
Making those two changes certainly brought down the errors. Thank you for the suggestion.
For my next attempt I started absolutely clean, by setting up the Eclipse environment for this demo per the instructions. After doing this, one error and one warning do remain:
ERROR:
Description: make: *** [scd_cmd_1] Error 1
Resource: ARMCM4-STM32F407-DISCOVERY
Location: [Discovery Options] page in project properties
Type: C/C++ Problem
-----------------------------------------------------
WARNING:
Description: Invalid project path: Include path not found (C:\program-files-arm\ChibiOS_2.4.1\os\hal\platforms\STM32\RTCv2).
Resource: ARMCM4-STM32F407-DISCOVERY
Location: pathentry
Type: Path Entry Problem
If I then "clean" the project, the errors and warnings remain. You have to manually delete the markers to clear errors and warnings.
Doing another build, I pick-up the following error in addition to the error & warning listed above...
ERROR:
Description: make: *** multiple target patterns. Stop.
Resource: chcore.o.d
Path: /ARMCM4-STM32F407-DISCOVERY/.dep
Location: line 1
Type: C/C++ Problem
For my next attempt I started absolutely clean, by setting up the Eclipse environment for this demo per the instructions. After doing this, one error and one warning do remain:
ERROR:
Description: make: *** [scd_cmd_1] Error 1
Resource: ARMCM4-STM32F407-DISCOVERY
Location: [Discovery Options] page in project properties
Type: C/C++ Problem
-----------------------------------------------------
WARNING:
Description: Invalid project path: Include path not found (C:\program-files-arm\ChibiOS_2.4.1\os\hal\platforms\STM32\RTCv2).
Resource: ARMCM4-STM32F407-DISCOVERY
Location: pathentry
Type: Path Entry Problem
If I then "clean" the project, the errors and warnings remain. You have to manually delete the markers to clear errors and warnings.
Doing another build, I pick-up the following error in addition to the error & warning listed above...
ERROR:
Description: make: *** multiple target patterns. Stop.
Resource: chcore.o.d
Path: /ARMCM4-STM32F407-DISCOVERY/.dep
Location: line 1
Type: C/C++ Problem
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Eclipse - Chibios setup problem
I think this is a problem with your "make.exe" program regarding paths. Is it the one from cygwin?
You may try to install the YAGARTO tools which contain a make executable that recognized windows paths.
If it is a problem with cygwin I have to updated the guide with correct info.
Giovanni
You may try to install the YAGARTO tools which contain a make executable that recognized windows paths.
If it is a problem with cygwin I have to updated the guide with correct info.
Giovanni
Re: Eclipse - Chibios setup problem
It does appear to be using cygwin make. The console looks like this:
**** Build of configuration Default for project ARMCM4-STM32F407-DISCOVERY ****
make all
cygwin warning:
MS-DOS style path detected: C:\program-files-arm\ChibiOS_2.4.1\demos\ARMCM4-STM32F407-DISCOVERY
Preferred POSIX equivalent is: /cygdrive/c/program-files-arm/ChibiOS_2.4.1/demos/ARMCM4-STM32F407-DISCOVERY
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.h ... -pathnames
.dep/chcore.o.d:1: *** multiple target patterns. Stop.
**** Build Finished ****
I installed the yagarto tools and cygwin per the guide. I'll uninstall cygwin and give it a try. If I remember, cygwin doesn't have an uninstaller so I'll have to go to their website and find the directions. Easy to get it out of the windows path, but don't know if they put stuff in the registry which has to be undone.
Really looking forward into learning ChibiOS once I get past this hurdle.
With all of the HAL support it seems like it would make a great foundation for robotic programming.
**** Build of configuration Default for project ARMCM4-STM32F407-DISCOVERY ****
make all
cygwin warning:
MS-DOS style path detected: C:\program-files-arm\ChibiOS_2.4.1\demos\ARMCM4-STM32F407-DISCOVERY
Preferred POSIX equivalent is: /cygdrive/c/program-files-arm/ChibiOS_2.4.1/demos/ARMCM4-STM32F407-DISCOVERY
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.h ... -pathnames
.dep/chcore.o.d:1: *** multiple target patterns. Stop.
**** Build Finished ****
I installed the yagarto tools and cygwin per the guide. I'll uninstall cygwin and give it a try. If I remember, cygwin doesn't have an uninstaller so I'll have to go to their website and find the directions. Easy to get it out of the windows path, but don't know if they put stuff in the registry which has to be undone.
Really looking forward into learning ChibiOS once I get past this hurdle.
With all of the HAL support it seems like it would make a great foundation for robotic programming.
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Eclipse - Chibios setup problem
You don't need to uninstall cygwin, just make sure that the YAGARTO tools appear in your PATH environment variable before cygwin.
If you want to uninstall cygwing simply remove the directory and remove the references in the PATH environment variable.
Giovanni
If you want to uninstall cygwing simply remove the directory and remove the references in the PATH environment variable.
Giovanni
Re: Eclipse - Chibios setup problem
Try to uncheck "Generate Makefiles automatically" in C/C++Build properties in Eclipse - this avoids the makefile corruption and it may compile then..
Re: Eclipse - Chibios setup problem
Made a fresh start and deleted the project, and recreated it from scratch.
I took cygwin out of the path & installed yagarto tools. Auto-discover paths is enabled & code analyzer disabled. "Generate Makefiles automatically in c/c++ build properties was greyed out and disabled by default. Did the index-rebuild and then did a "build all".
As the console shows below, it did create a ch.hex ..., but still get the same build error & a warning. The error reported doesn't seem to appear in the console display, but only in the Problems Window:
ERROR:
Description: make: *** [scd_cmd_1] Error 1
Resource: ARMCM4-STM32F407-DISCOVERY
Location: [Discovery Options] page in project properties
Type: C/C++ Problem
Console Output:
**** Build of configuration Default for project ARMCM4-STM32F407-DISCOVERY ****
make all
Compiler Options
arm-none-eabi-gcc -c -mcpu=cortex-m4 -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -ffunction-sections -fdata-sections -fno-common -Wall -Wextra -Wstrict-prototypes -Wa,-alms=build/lst/ -DCORTEX_USE_FPU=FALSE -DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -MD -MP -MF .dep/build.d -I. -I../../os/ports/common/ARMCMx/CMSIS/include -I../../os/ports/common/ARMCMx -I../../os/ports/GCC/ARMCMx -I../../os/ports/GCC/ARMCMx/STM32F4xx -I../../os/kernel/include -I../../test -I../../os/hal/include -I../../os/hal/platforms/STM32F4xx -I../../os/hal/platforms/STM32 -I../../os/hal/platforms/STM32/GPIOv2 -I../../os/hal/platforms/STM32/RTCv2 -I../../boards/ST_STM32F4_DISCOVERY -I../../os/various main.c -o main.o
mkdir -p build/obj
mkdir -p build/lst
Compiling ../../os/ports/GCC/ARMCMx/crt0.c
Compiling ../../os/ports/GCC/ARMCMx/STM32F4xx/vectors.c
Compiling ../../os/ports/GCC/ARMCMx/chcore.c
Compiling ../../os/ports/GCC/ARMCMx/chcore_v7m.c
Compiling ../../os/ports/common/ARMCMx/nvic.c
Compiling ../../os/kernel/src/chsys.c
Compiling ../../os/kernel/src/chdebug.c
Compiling ../../os/kernel/src/chlists.c
Compiling ../../os/kernel/src/chvt.c
Compiling ../../os/kernel/src/chschd.c
Compiling ../../os/kernel/src/chthreads.c
Compiling ../../os/kernel/src/chdynamic.c
Compiling ../../os/kernel/src/chregistry.c
Compiling ../../os/kernel/src/chsem.c
Compiling ../../os/kernel/src/chmtx.c
Compiling ../../os/kernel/src/chcond.c
Compiling ../../os/kernel/src/chevents.c
Compiling ../../os/kernel/src/chmsg.c
Compiling ../../os/kernel/src/chmboxes.c
Compiling ../../os/kernel/src/chqueues.c
Compiling ../../os/kernel/src/chmemcore.c
Compiling ../../os/kernel/src/chheap.c
Compiling ../../os/kernel/src/chmempools.c
Compiling ../../test/test.c
Compiling ../../test/testthd.c
Compiling ../../test/testsem.c
Compiling ../../test/testmtx.c
Compiling ../../test/testmsg.c
Compiling ../../test/testmbox.c
Compiling ../../test/testevt.c
Compiling ../../test/testheap.c
Compiling ../../test/testpools.c
Compiling ../../test/testdyn.c
Compiling ../../test/testqueues.c
Compiling ../../test/testbmk.c
Compiling ../../os/hal/src/hal.c
Compiling ../../os/hal/src/adc.c
Compiling ../../os/hal/src/can.c
Compiling ../../os/hal/src/ext.c
Compiling ../../os/hal/src/gpt.c
Compiling ../../os/hal/src/i2c.c
Compiling ../../os/hal/src/icu.c
Compiling ../../os/hal/src/mac.c
Compiling ../../os/hal/src/pal.c
Compiling ../../os/hal/src/pwm.c
Compiling ../../os/hal/src/sdc.c
Compiling ../../os/hal/src/serial.c
Compiling ../../os/hal/src/spi.c
Compiling ../../os/hal/src/uart.c
Compiling ../../os/hal/src/usb.c
Compiling ../../os/hal/src/tm.c
Compiling ../../os/hal/src/mmc_spi.c
Compiling ../../os/hal/src/serial_usb.c
Compiling ../../os/hal/src/rtc.c
Compiling ../../os/hal/platforms/STM32F4xx/stm32_dma.c
Compiling ../../os/hal/platforms/STM32F4xx/hal_lld.c
Compiling ../../os/hal/platforms/STM32F4xx/adc_lld.c
Compiling ../../os/hal/platforms/STM32/ext_lld.c
Compiling ../../os/hal/platforms/STM32/gpt_lld.c
Compiling ../../os/hal/platforms/STM32/i2c_lld.c
Compiling ../../os/hal/platforms/STM32/icu_lld.c
Compiling ../../os/hal/platforms/STM32/mac_lld.c
Compiling ../../os/hal/platforms/STM32/pwm_lld.c
Compiling ../../os/hal/platforms/STM32/serial_lld.c
Compiling ../../os/hal/platforms/STM32/spi_lld.c
Compiling ../../os/hal/platforms/STM32/uart_lld.c
Compiling ../../os/hal/platforms/STM32/GPIOv2/pal_lld.c
Compiling ../../boards/ST_STM32F4_DISCOVERY/board.c
Compiling ../../os/various/lis302dl.c
Compiling ../../os/various/chprintf.c
Compiling main.c
main.c: In function 'Thread1':
main.c:189:1: warning: no return statement in function returning non-void [-Wreturn-type]
Linking build/ch.elf
Creating build/ch.hex
Creating build/ch.bin
Creating build/ch.dmp
Done
**** Build Finished ****
I took cygwin out of the path & installed yagarto tools. Auto-discover paths is enabled & code analyzer disabled. "Generate Makefiles automatically in c/c++ build properties was greyed out and disabled by default. Did the index-rebuild and then did a "build all".
As the console shows below, it did create a ch.hex ..., but still get the same build error & a warning. The error reported doesn't seem to appear in the console display, but only in the Problems Window:
ERROR:
Description: make: *** [scd_cmd_1] Error 1
Resource: ARMCM4-STM32F407-DISCOVERY
Location: [Discovery Options] page in project properties
Type: C/C++ Problem
Console Output:
**** Build of configuration Default for project ARMCM4-STM32F407-DISCOVERY ****
make all
Compiler Options
arm-none-eabi-gcc -c -mcpu=cortex-m4 -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -ffunction-sections -fdata-sections -fno-common -Wall -Wextra -Wstrict-prototypes -Wa,-alms=build/lst/ -DCORTEX_USE_FPU=FALSE -DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -MD -MP -MF .dep/build.d -I. -I../../os/ports/common/ARMCMx/CMSIS/include -I../../os/ports/common/ARMCMx -I../../os/ports/GCC/ARMCMx -I../../os/ports/GCC/ARMCMx/STM32F4xx -I../../os/kernel/include -I../../test -I../../os/hal/include -I../../os/hal/platforms/STM32F4xx -I../../os/hal/platforms/STM32 -I../../os/hal/platforms/STM32/GPIOv2 -I../../os/hal/platforms/STM32/RTCv2 -I../../boards/ST_STM32F4_DISCOVERY -I../../os/various main.c -o main.o
mkdir -p build/obj
mkdir -p build/lst
Compiling ../../os/ports/GCC/ARMCMx/crt0.c
Compiling ../../os/ports/GCC/ARMCMx/STM32F4xx/vectors.c
Compiling ../../os/ports/GCC/ARMCMx/chcore.c
Compiling ../../os/ports/GCC/ARMCMx/chcore_v7m.c
Compiling ../../os/ports/common/ARMCMx/nvic.c
Compiling ../../os/kernel/src/chsys.c
Compiling ../../os/kernel/src/chdebug.c
Compiling ../../os/kernel/src/chlists.c
Compiling ../../os/kernel/src/chvt.c
Compiling ../../os/kernel/src/chschd.c
Compiling ../../os/kernel/src/chthreads.c
Compiling ../../os/kernel/src/chdynamic.c
Compiling ../../os/kernel/src/chregistry.c
Compiling ../../os/kernel/src/chsem.c
Compiling ../../os/kernel/src/chmtx.c
Compiling ../../os/kernel/src/chcond.c
Compiling ../../os/kernel/src/chevents.c
Compiling ../../os/kernel/src/chmsg.c
Compiling ../../os/kernel/src/chmboxes.c
Compiling ../../os/kernel/src/chqueues.c
Compiling ../../os/kernel/src/chmemcore.c
Compiling ../../os/kernel/src/chheap.c
Compiling ../../os/kernel/src/chmempools.c
Compiling ../../test/test.c
Compiling ../../test/testthd.c
Compiling ../../test/testsem.c
Compiling ../../test/testmtx.c
Compiling ../../test/testmsg.c
Compiling ../../test/testmbox.c
Compiling ../../test/testevt.c
Compiling ../../test/testheap.c
Compiling ../../test/testpools.c
Compiling ../../test/testdyn.c
Compiling ../../test/testqueues.c
Compiling ../../test/testbmk.c
Compiling ../../os/hal/src/hal.c
Compiling ../../os/hal/src/adc.c
Compiling ../../os/hal/src/can.c
Compiling ../../os/hal/src/ext.c
Compiling ../../os/hal/src/gpt.c
Compiling ../../os/hal/src/i2c.c
Compiling ../../os/hal/src/icu.c
Compiling ../../os/hal/src/mac.c
Compiling ../../os/hal/src/pal.c
Compiling ../../os/hal/src/pwm.c
Compiling ../../os/hal/src/sdc.c
Compiling ../../os/hal/src/serial.c
Compiling ../../os/hal/src/spi.c
Compiling ../../os/hal/src/uart.c
Compiling ../../os/hal/src/usb.c
Compiling ../../os/hal/src/tm.c
Compiling ../../os/hal/src/mmc_spi.c
Compiling ../../os/hal/src/serial_usb.c
Compiling ../../os/hal/src/rtc.c
Compiling ../../os/hal/platforms/STM32F4xx/stm32_dma.c
Compiling ../../os/hal/platforms/STM32F4xx/hal_lld.c
Compiling ../../os/hal/platforms/STM32F4xx/adc_lld.c
Compiling ../../os/hal/platforms/STM32/ext_lld.c
Compiling ../../os/hal/platforms/STM32/gpt_lld.c
Compiling ../../os/hal/platforms/STM32/i2c_lld.c
Compiling ../../os/hal/platforms/STM32/icu_lld.c
Compiling ../../os/hal/platforms/STM32/mac_lld.c
Compiling ../../os/hal/platforms/STM32/pwm_lld.c
Compiling ../../os/hal/platforms/STM32/serial_lld.c
Compiling ../../os/hal/platforms/STM32/spi_lld.c
Compiling ../../os/hal/platforms/STM32/uart_lld.c
Compiling ../../os/hal/platforms/STM32/GPIOv2/pal_lld.c
Compiling ../../boards/ST_STM32F4_DISCOVERY/board.c
Compiling ../../os/various/lis302dl.c
Compiling ../../os/various/chprintf.c
Compiling main.c
main.c: In function 'Thread1':
main.c:189:1: warning: no return statement in function returning non-void [-Wreturn-type]
Linking build/ch.elf
Creating build/ch.hex
Creating build/ch.bin
Creating build/ch.dmp
Done
**** Build Finished ****
- Attachments
-
- My Eclipse Discovery Options:
- discovery options.JPG (66.14 KiB) Viewed 8739 times
Re: Eclipse - Chibios setup problem
Playing around a bit more...
The make which comes via yagarto tools seems to work much better than cygwin make. I made the demo code build error free by NOT selecting "Automate discovery of paths and symbols" in the Discovery Options section of project properties. Don't really understand why, but I think this is forward progress. Now onto the next step.
BTW - in my earlier frustration with Eclipse CDT I downloaded the trial version of Rowley Crossworks. Their IDE does not allow you to import a makefile to setup a new project.
The make which comes via yagarto tools seems to work much better than cygwin make. I made the demo code build error free by NOT selecting "Automate discovery of paths and symbols" in the Discovery Options section of project properties. Don't really understand why, but I think this is forward progress. Now onto the next step.
BTW - in my earlier frustration with Eclipse CDT I downloaded the trial version of Rowley Crossworks. Their IDE does not allow you to import a makefile to setup a new project.
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Eclipse - Chibios setup problem
Enable again the discovery of paths and try setting "GCC per project scanner info profile" instead of "GCC per file scanner info profile", probably it is related to that error. Discovery is useful in order to make the CDT find all the files related to the project and index them, without discovery some feature like auto-completion would not work.
Eclipse is painful initially because its complexity but it is also very powerful after you start to understand how the CDT is organized. After learning it all the other IDEs I had a chance to use feel weak in comparison, including very expensive ones.
YAGARTO used to offer a pre-configured Eclipse environment until a couple of years ago but then it was removed, I have to ask Michael why, it made things much easier.
Anyway, I definitely have to update that guide.
Giovanni
Eclipse is painful initially because its complexity but it is also very powerful after you start to understand how the CDT is organized. After learning it all the other IDEs I had a chance to use feel weak in comparison, including very expensive ones.
YAGARTO used to offer a pre-configured Eclipse environment until a couple of years ago but then it was removed, I have to ask Michael why, it made things much easier.
Anyway, I definitely have to update that guide.
Giovanni