Eclipse Mars and Arduino 1.6.5

I have been trying to use Eclipse Mars with the Arduino V2 addin. So far I have found this:

There is no make in arduino 1.6.5 so copy from an older version
I copied make.exe from <arduino1.0.5>/hardware/tools/avr/utils/bin
to <arduino1.6.5>/hardware/tools/avr/avr/bin

Create a new sketch and put these lines in the cpp file
pinMode(13,OUTPUT);
digitalWrite(13,HIGH);
They will be flagged by the editor for wrong parameters.
This is because the editor has found arduino.h but not
the standard C++ headers.

Open the project properties and go to C/C++General/Paths and Symbols
In the includes tab click C++ and add
\hardware\tools\avr\lib\gcc\avr\4.8.1
and then
\hardware\tools\avr\avr\include
Note that the order is important.
This should fix the editor errors

If you try to build make will not find the compiler
Go to project/properties/c-c++build/environment
Add A.RUNTIME.TOOLS.AVR-GCC.PATH with value /hardware/tools/avr

and now to make upload word add
A.TOOLS.BOSSAC.PATH with value /hardware/tools/avr

Unfortunately you have to do the path and environment changes for each new project. Does anyone know a way to make all new Arduino projects have these changes?

Also I have only tested on very simple programs. There may be other snags I have not found yet.

Further testing has shown that it is not neccessary to add the includes. Just do a build and they will be found. It is necessary to copy make.exe and add the environment variables. I should have said that I am using Windows Vista.

Hi

I am also trying to get this running on windows 8.1 64 bit, arduino 1.6.5-r5 and eclipse mars. Following the advices given above on Project/Build all make.exe crashes. It was copied from version 1.0.6. Has anyone also tried or even succeeded in installing and using the arduino plugin in eclipse mars ?

I have it running on Windows 10 64bit. I copied make.exe to hardware/tools/avr/bin and hardware/tools/avr/avr/bin. Also I set the environment variables as user environment variables rather than in Eclipse - they have a habit of disappearing in Eclipse.
When you say it crashes what do you see in the console window?

The console window is quite "clean" :

23:26:07 **** Incremental Build of configuration Release for project qqq ****
make all

23:26:13 Build Finished (took 5s.781ms)

What confuses me are the numerous environment and path variables to be set all over the place. Right now the problems window lists :

Invalid project path: Duplicate path entries found (/qqq [Include path] isSystemInclude:true includePath:C:/Program Files (x86)/arduino-1.6.5-r5/hardware/tools/avr/avr/include), path: [/qqq]. qqq pathentry Path Entry Problem

Not sure I can help with that. There are certainly a lot of environment variables set within Eclipse but as far as I can remember the only ones I have had to change are the ones I quoted. I can only suggest you look at the windows variables and see if there are conflicts with the ones set in Eclipse.

Hello
Jantje here (The guy who writes the plugin)
I'm not sure whether you use the nightly build or the lastest stable. From some comments it looks like you are using the last stable. For instance the missing A.RUNTIME.TOOLS.AVR-GCC.PATH

If so: you should know this: Arduino has come a long way since the latest stable release. For instance arduino IDE 1.6.5 added a completely new boards manager which invalidates the assumptions used in the latest stable. We are currently

As to the bunch of environment variables. I know there are lots of environment variables but you should not have to care because that is the internal workings of the plugin.
Basically the boards.txt and the platform.txt are converted to environment variables and then I add my own stuff to link it all up.
If you want to know more about it see http://blog.baeyens.it/#post22

For windows user having the make issue. on this page http://eclipse.baeyens.it/installAdvice.shtml in the windows comments, I advise to install mingw core component and copy cmake.exe to make.exe and add mingw/bin to the path. (I'm planning to make a video about that but time is missing)

Thanks for that Jantje. Yes I am using the latest stable release. It works for me - I am only really playing so I will stick with it until the next stable release. If/when I start a real Arduino project I will think again.
Thank you for all your work.

I repeated the installations, using the latest stable eclipse (mars, 64 bit for windows ) and the lower link in

http://eclipse.baeyens.it/stable-win.html

which gives version 2.2.0.1. In the earlier try I followed some advice to copy make.exe from a legacy arduino version into the folder where eclipse.exe is in. He did find this and tried to execute.
I just installed cygwin as adviced ( cygwin64, respectively ). Could anyone please go into a bit more detail what is meant by

To install make you can install make from cygwin (only install make and the core components) and add the C:/cygwinXXX/bin folder to your path.

on

Sloeber- Pre Requisites

. I am not sure if Project - Properties - C/C++ Build Environment is the right place to put hands on.

Thanks

I have not installed cygwin and it appears to worh fine.

you can not use the latest stable with Arduino IDE 1.6.5
Make may or may not be installed on your system. You only need to install it if it is not installed.
Mac and linux have "standard install options" for make.
Windows users can install make from mingw or cygwin or simply download ftp://ftp.equation.com/make/32/make.exe and place it in the path of your system.
Jantje

you can not use the latest stable with Arduino IDE 1.6.5

Jantje - You obviously know far more about this than I do but I appear to be doing just that. I have a very small program that flashes the pin 13 LED and am using an Arduino UNO. Build and load appear to work.

A bit of further testing showed Build project works if make.exe is copied into /hardware/tools/avr/bin or into directories. This works if make.exe is used from either arduino 1.0.6 or cygwin. On my system upload fails for some reason

Starting upload
using arduino loader

Launching /bin/avrdude -C/etc/avrdude.conf -patmega328p -carduino -P COM11 -b115200 -D -Uflash:w:C:\Users\whoami\workspace\qqq/Release/qqq.hex:i
Output:
upload failed

(in the workspace project folder I do not see any .hex file, project name is qqq,setup and loop functions are empty since I only want to test verification, build and upload processes ). Furthermore, I observed a variable A.RUNTIME.TOOLS.AVR-GCC.PATH disappear in Properties/C/C++Build. Adding it again solved this issue for the moment. ( I had copied the value of PATH and other variables it is composed of into a text file in order to analyse and understand it.)

If the remaining issues are related to arduino version 1.6.5-r5 I will test later. Behaviour is similar for both UNO and Mega2560.

To get make to work you have to set A.TOOLS.BOSSAC.PATH (see my original post). I also found that if I set environment variables in Eclipse they disappeared when the project settings were changed. To fix this set them in Windows. In Windows10 type env in the search box and then select "edit environment variables for your account" You can then add the two variables you need and they will be permanent.

To get make to work
My mistake - I mean upload.

Hi

Finally I managed to get it run using an Uno following the instructions in Roger_Woolletts first post.
A.RUNTIME.TOOLS.AVR-GCC.PATH I set to
C:\Program Files (x86)\Arduino\hardware\tools\avr and
A.TOOLS.BOSSAC.PATH to
C:\Program Files (x86)\Arduino\hardware\tools\avr,

both as user variables in Windows. The entries in Path and symbols I could also verify as obsolete.

On a Mega 2560 build is working, upload misses the .hex file.

I have been quite confused about how and where the needed environment variables are set. In order to be certain they will be applied I switched from restarting eclipse to rebooting windows.

Again thanks for your assistance.

Again:
If you want to use Arduino IDE 1.6.5 you should use the nightly. That does all this magic for you.
Jantje