# Eclipse IDE on Windows

Hi, I’ve posted an article on my blog describing the procedure to have the Eclipse CPP environment set up on a Windows machine, but I’m stuck with some weird errors reported within Eclipse but not blocking the build process.

When I open the application.cpp file I see errors on pinMode, digitalRead, digitalWrite, analogRead and analogWrite functions: for them all the message is something like

Invalid arguments 'Candidates are: void pinMode(?, enum PinMode)'


If I open spark_wiring.h, as an example, I get errors on the basic types, like

Type 'int32_t' could not be resolved


I’m pretty sure I’m missing something very simple here, but I’m new at Eclipse CPP, your help is very welcome.

Hi @rlogiacco - I’m not particularly familiar with Eclipse so I don’t have great suggestions here, but it does seem like there’s some issue in pulling in dependencies. Are there settings for your project where you provide a list of files to be included? If so, perhaps that list is not currently including everything from all three firmware repositories?

The stdint.h types are defined in the GNU ARM toolchain. Are you using the toolchain from launchpad.net recommended in the core-firmware README?

I know @satishgn works in Eclipse on Windows at least some of the time. Can you give any guidance here Satish?

@rlogiacco, can you try this:

Select the “core-firmware” project in Project-Explorer then => “Window” => “Preferences” => “C/C++” => “Indexer” => Deselect and Select “Enable indexer” => “Apply”

@satishgn that re-index didn’t work: the indexer run for a little less than a minute but no joy. Is it possible I’ve to instruct somehow Eclipse to add some resources to the index?

Please find a screenshot of my core-firmware clone within Eclipse

rlogiacco posted a link in his blog for a better understanding for a windows setup. I have used the information for there and here to set up my environment. I also added the following lines to the makefile as per his blog.

RM = “C:\Program Files (x86)\Git\bin\rm.exe” -f
MKDIR = “C:\Program Files (x86)\Git\bin\mkdir.exe” -p

Yet when i go to the core-firmware/build folder and type make i get the following:

C:\Spark\core-firmware\build>make
Building core-common-lib
Building file: …/CC3000_Host_Driver/cc3000_common.c
Invoking: ARM GCC C Compiler
"C:\Program Files (x86)\Git\bin\mkdir.exe" -p obj/CC3000_Host_Driver/
process_begin: CreateProcess(NULL, “C:\Program Files (x86)\Git\bin\mkdir.exe” -p obj/CC3000_Host_Dri
ver/, …) failed.
make (e=2): The system cannot find the file specified.
make[1]: *** [obj/CC3000_Host_Driver/cc3000_common.o] Error 2
make: *** [check_external_deps] Error 2

C:\Spark\core-firmware\build>

I found the problem. On my system Win7 -64bit. It did not like the paths. "C:\Program Files (x86)"
I moved the following installed folders into a new folder i created "C:\Building"
GnuWin32
GNU Tools ARM Embedded
Git
dfu-util-0.6

Now i was able to run make and everything worked just fine!!!
I also was able to use the make files without modifying them for the path commands.
hope it helps someone.

@seulater actually encountered your same issue and solved it, but I forgot to update the blog post: thanks for the reminder!

@satishgn anything else i can try to fix the compilation problems?

I just followed your instructions on Eclipse Juno, the only thing I had to do to get rid of all errors and warning was to set:

Properties -> C++ Build -> Discovery Option -> GCC C++ Compiler -> Compiler invocation command
to
arm-none-eabi-g++

and

Properties -> C++ Build -> Discovery Option -> GCC C Compiler -> Compiler invocation command
to
arm-none-eabi-gcc

I also added an external run configuration for dfu-util, so that I no longer need a DOS command window:

1 Like

I like Eclipse better than Netbeans @rlogiacco, .according to your blog, you mention “2) Select GNU Autotools as Toolchain” yet i do not have this option.

@chrisb2, when you mention “Properties -> C++ Build -> Discovery Option -> GCC C++ Compiler -> Compiler invocation command” i dont have this either. Is there some plugin that i am missing ?

Maybe when you have time on here or your blog you can snap some screenshots of all the pertinent settings so we can see them.

I have created a blog post which goes through the steps with screen shots, its pretty much identical to that of @rlogiacco. They key difference is I have a slightly different ARM tools location in my environment PATH.

Howto setup Eclipse to build and flash Spark-Core firmware

1 Like

@chrisb2 If I follow your instructions and set the PATH to point to the arm-none-eabi\bin subdirectory I get an error:

arm-none-eabi-g++ -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb  -I../inc -I../../core-common-lib/CMSIS/Include -I../../core-common-lib/CMSIS/Device/ST/STM32F10x/Include -I../../core-common-lib/STM32F10x_StdPeriph_Driver/inc -I../../core-common-lib/STM32_USB-FS-Device_Driver/inc -I../../core-common-lib/CC3000_Host_Driver -I../../core-common-lib/SPARK_Firmware_Driver/inc -I../../core-communication-lib/lib/tropicssl/include -I../../core-communication-lib/src -I. -ffunction-sections -Wall -fmessage-length=0 -MD -MP -MF core-firmware.elf.d -DUSE_STDPERIPH_DRIVER -DSTM32F10X_MD -DDFU_BUILD_ENABLE  obj/src/application.o obj/src/main.o obj/src/newlib_stubs.o obj/src/spark_utilities.o obj/src/spark_wiring.o obj/src/spark_wiring_i2c.o obj/src/spark_wiring_interrupts.o obj/src/spark_wiring_ipaddress.o obj/src/spark_wiring_network.o obj/src/spark_wiring_print.o obj/src/spark_wiring_servo.o obj/src/spark_wiring_spi.o obj/src/spark_wiring_stream.o obj/src/spark_wiring_string.o obj/src/spark_wiring_tcpclient.o obj/src/spark_wiring_tcpserver.o obj/src/spark_wiring_udp.o obj/src/spark_wiring_usartserial.o obj/src/spark_wiring_usbserial.o obj/src/spark_wlan.o obj/src/stm32_it.o obj/src/usb_desc.o obj/src/usb_endp.o obj/src/usb_istr.o obj/src/usb_prop.o obj/src/wifi_credentials_reader.o obj/startup/startup_stm32f10x_md.o --output core-firmware.elf -T../linker/linker_stm32f10x_md_dfu.ld -nostartfiles -Xlinker --gc-sections  -L../../core-common-lib/build -lcore-common-lib -L../../core-communication-lib/build -lcore-communication-lib -Wl,-Map,core-firmware.map
process_begin: CreateProcess(NULL, arm-none-eabi-g++ -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb -I../inc -I../../core-common-lib/CMSIS/Include -I../../core-common-lib/CMSIS/Device/ST/STM32F10x/Include -I../../core-common-lib/STM32F10x_StdPeriph_Driver/inc -I../../core-common-lib/STM32_USB-FS-Device_Driver/inc -I../../core-common-lib/CC3000_Host_Driver -I../../core-common-lib/SPARK_Firmware_Driver/inc -I../../core-communication-lib/lib/tropicssl/include -I../../core-communication-lib/src -I. -ffunction-sections -Wall -fmessage-length=0 -MD -MP -MF core-firmware.elf.d -DUSE_STDPERIPH_DRIVER -DSTM32F10X_MD -DDFU_BUILD_ENABLE obj/src/application.o obj/src/main.o obj/src/newlib_stubs.o obj/src/spark_utilities.o obj/src/spark_wiring.o obj/src/spark_wiring_i2c.o obj/src/spark_wiring_interrupts.o obj/src/spark_wiring_ipaddress.o obj/src/spark_wiring_network.o obj/src/spark_wiring_print.o obj/src/spark_wiring_servo.o obj/src/spark_wiring_spi.o obj/src/spark_wiring_stream.o obj/src/spark_wiring_string.o obj/src/spark_wiring_tcpclient.o obj/src/spark_wiring_tcpserver.o obj/src/spark_wiring_udp.o obj/src/spark_wiring_usartserial.o obj/src/spark_wiring_usbserial.o obj/src/spark_wlan.o obj/src/stm32_it.o obj/src/usb_desc.o obj/src/usb_endp.o obj/src/usb_istr.o obj/src/usb_prop.o obj/src/wifi_credentials_reader.o obj/startup/startup_stm32f10x_md.o --output core-firmware.elf -T../linker/linker_stm32f10x_md_dfu.ld -nostartfiles -Xlinker --gc-sections -L../../core-common-lib/build -lcore-common-lib -L../../core-communication-lib/build -lcore-communication-lib -Wl,-Map,core-firmware.map, ...) failed.
make (e=2): Impossibile trovare il file specificato.


The message, in italian, clearly states a file not found error and it refers to the arm-none-eabi-g++ which is available under C:\Apps\spark\GNU Tools ARM Embedded\4.8 2013q4\bin but not under C:\Apps\spark\GNU Tools ARM Embedded\4.8 2013q4\arm-none-eabi\bin: is it possible you have two entries in your path environment?

@seulater have you installed the GNU ARM Toolchain? I’m not sure, but I believe Eclipse shows that entry if it detects the toolchain on the system… I did nothing special to have it shown.

@chrisb2 I don’t have the Properties -> C++ Build -> Discovery Option -> GCC C++ Compiler -> Compiler invocation command option either, I’m using Eclipse Kepler

I’ve nailed down my error to the very basic types, all other errors are a consequence of those Type uint16_t could not be resolved.

Please note the compilation process works perfectly and I’m able to upload the firmware to the , the issue is limited to the Eclipse editor only.

The issue is related to all the default includes, all of the following ones are failing:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdint.h>


UPDATE: I tried to use a completely fresh Eclipse and Toolchain installation without any success. Whenever I open up the application.cpp file in the Eclipse editor I get those errors.

UPDATE #2: I fixed this by manual adding arm-none-eabi/include to the C/C++ General > Paths and Symbols > Includes > GNU C++ includes list… What surprises me is it seems you guys don’t need this step. Am I doing something wrong here?

@chrisb2 , Thanks for the screen shots. I too was at the same point with the settings when i received an update to this post. Even though everything compiles ok the indexer is still messed up. For some reason i cannot get eclipse to see all the includes.

@seulater does my fix work for you?
If you need more instructions on how to apply it I’ve updated the blog post: please refer to step 5 at the end of http://rlogiacco.wordpress.com/2014/01/25/the-sparkcore-makers-meet-the-cloud/

@rlogiacco, It seems to be all working now.
Dam Windows. I have tried all these steps several times, and many other different combinations that have worked well with other things I have used. Nothing worked right. I decided this morning to revert my PC back to a virgin image and try again. Now everything is working properly.
The only thing different I did was when creating a new project and selecting external source files was that I pointed to the root of the sources so I could see all the 3 folders and their files.

Thanks guys!

@seulater just to double check, did you manually add the arm-none-eabi/include folder to the project Paths and Symbols (step 5 on my blog post)?
If you didn’t I wish to verify your installation steps against mine because I had to do that in order to fix my Eclipse editor warnings.

@chrisb2 I believe you didn’t have to manually add that folder: can you please check if it is there nevertheless? I’m considering the possibility something failed during import…

Does anybody else need that manual step?

Is it ok to have it there or am I including the wrong folder?

UPDATE I now have other errors in deeper includes, like in spark_-wiring.cpp

Multiple markers at line 57
- Symbol 'GPIO_Pin_7' could not be resolved
- Symbol 'TIM_Channel_2' could not be resolved


I believe the manual path addition is not going to solve this so I’m going for a more radical solution…

@rlogiacco, yes, I added C:\Spark\GNU Tools ARM Embedded\4.8 2013q4\arm-none-eabi\include.
One thing I noticed is that if you also add that to GNU C as well it messes up the indexer. so only add it to C++.
I also tried removing it and it does have an affect on the indexer.
Pulling in my old code to give it a run for the money, and now the indexer complains about this call.

SPI.setClockDivider(SPI_CLOCK_DIV8);

Description Resource Path Location Type
Symbol ‘SPI_BaudRatePrescaler_8’ could not be resolved application.cpp /Test/core-firmware/src line 44 Semantic Error

So close I can taste it, but still not working 100%

Thanks to everybody in this thread for the contributions, that helped me a great deal to have Eclipse setup for Core dev.

The only minor problem I seem to encounter is that I get some warnings, I don’t understand and can’t get rid of

make all
makefile:154: warning: overriding commands for target obj%.o'
makefile:146: warning: ignoring old commands for target obj%.o'
makefile:163: warning: overriding commands for target obj%.o'
makefile:154: warning: ignoring old commands for target obj%.o'
Building core-common-lib
makefile:95: warning: overriding commands for target obj%.o'
makefile:86: warning: ignoring old commands for target obj%.o'
make[1]: Nothing to be done for all'.
ECHO is off.
Building core-communication-lib
makefile:97: warning: overriding commands for target obj%.o'
makefile:88: warning: ignoring old commands for target obj%.o'
make[1]: Nothing to be done for all'.
ECHO is off.


I have changed the forward slashes in the makefile to backslashes and done the RM/MKDIR substitutes, and now I get these warnings.
It seems as if there was the path separator “” missing between “obj” and “%.o”, but why?
Are these of any interest? Has anybody an idea where they come from and how to get rid of them?

My best advice is to revert your changes to the makefiles and add <path-to-git-installation>\bin to your PATH env variable: let me know if that helps.
@ScruffR did you have to add the arm-none-eabi/include folder to the Path and Symbols? Have you encounter the additional missing symbols warnings I reported? I’m trying to understand if that’s relative to my environment or if it’s generic.
@satishgn have had to add anything to the Path and Symbols to have Eclipse properly parse all the includes? If you did it would greatly help if you could share your core-firmare settings