Pages: 1 [2] 3 4 ... 31   Go Down
Author Topic: Windows/Linux/Mac Eclipse plugin to compile and upload arduino sketches  (Read 99206 times)
0 Members and 3 Guests are viewing this topic.
Belgium
Offline Offline
Edison Member
*
Karma: 68
Posts: 1897
Arduino rocks; but with my plugin it can fly rocking the world ;-)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Monkeyknight
Thanks for trying this out on OS X. I don't own an OS X operating system so I can only help you with theory and experience from the port to OpenSuse.
The plugin code uses a full path to locate the avr-g++. For windows and Linux this means that adding avr-g++ to the path doesn't help. I guess this will be the same on  OS X. In windows avr-g++ comes packaged with the IDE. In Linux it is not. Is avr-g++ delivered as part of the IDE in OS X?
Because avr-g++ is delivered differently per OS a part of the porting includes having setting different paths.
You can however set the paths yourself. As an experienced eclipse user that should be a piece of cake.

To set the paths yourself, as a work around, you do as follows:
Locate avr-g++, GNU make, the AVR header files and AVR dude on your system. (You don't need atmel part description files)
open eclipse and go to windows->preferences->arduino->paths. You should see something like this:

In your situation there will be errors. Change the paths.
Try again and hope there are no other incompatibilities.

Important Notes
1) you will have to fix all the errors before you can save the preferences.
2) Do not open any other tabs in the preferences as this may invalidate the changes you do.
3) Best is to do the change, save, reopen the preferences, validate whether the change is done, if ok do cancel else redo.

If it works it would be nice if you told me what you had to change. This way I can modify the plugin to set these values correct.
Even better was if you changed the plugin yourself (with my help off-course).

Lots of good luck
Jantje
Logged

Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Frozen Midwest
Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

HA! Sweet!

All is great, except for some includes now!



Code:
**** Build of configuration Release for project Arduino_test_002 ****

make all
Building file: ../Arduino_test_002.cpp
Invoking: AVR C++ Compiler
avr-g++ -I"/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino" -I"/Users/nick/Documents/Home_Workspace/Arduino_test_002" -D__IN_ECLIPSE__=1 -DARDUINO=22 -Wall -Os -ffunction-sections -fdata-sections -fno-exceptions -g -mmcu=atmega328p -DF_CPU=16000000UL -MMD -MP -MF"Arduino_test_002.d" -MT"Arduino_test_002.d" -c -o "Arduino_test_002.o" "../Arduino_test_002.cpp"
In file included from ../Arduino_test_002.cpp:2:
../Arduino_test_002.h:9:22: error: WProgram.h: No such file or directory
make: *** [Arduino_test_002.o] Error 1

**** Build Finished ****


But this should be pretty simple.


I have some years of Eclipse experience, but to be honest most of the times I have used it I have not had to edit many paths. So this was not quite as obvious of an edit as it would have been to some.


* Arduino Paths.tiff (130.79 KB, 1016x535 - viewed 267 times.)
Logged

Frying boards one at a time. Sizzling components by the scores.

Frozen Midwest
Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset



The library was not building, because of some undefined refrences.

I had to add "#include <stdint.h>" to Arduino.h. I am not sure why, and in fact I am sure that I should not have to edit any of the Arduino core files.

Also I had to edit

Code:
#include "pins_arduino.h"

to

Code:
#include <pins_arduino.h>



Here are a few other edits:


* pins_include.tiff (194.47 KB, 1004x742 - viewed 267 times.)

* AVR Compiler Path.tiff (227.65 KB, 1019x742 - viewed 250 times.)

* AVRDude Conf dir.tiff (109.02 KB, 1091x577 - viewed 258 times.)
Logged

Frying boards one at a time. Sizzling components by the scores.

Frozen Midwest
Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I am not sure why, but the plugin will not take my edits for updating the avrdude path.

I edit it to point to:  /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin

But it resets it to:  /Applications/Arduino.app/Contents/Resources/Java/hardware/tools
Logged

Frying boards one at a time. Sizzling components by the scores.

Belgium
Offline Offline
Edison Member
*
Karma: 68
Posts: 1897
Arduino rocks; but with my plugin it can fly rocking the world ;-)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Monkeyknight
I see you are using Arduino 1.
The plugin is not compatible with Arduino 1. See my post on this topic in http://arduino.cc/forum/index.php/topic,81082.0.html
You should not have to edit the Arduino files. If the IDE works under OS X with these files there is no reason an eclipse plugin should have to change these files.
The only change you made that I can not explain is "I had to add "#include <stdint.h>" to Arduino.h"

On behalf of "I am not sure why, but the plugin will not take my edits for updating the avrdude path."
Have you followed the "important notes" in my previous post?

I see you are changing things in the project settings. Normally this is not needed. If you want to change it anyway it is better to change them in project properties-> C++- general > paths and symbols. Information is stored at several locations and you may undo your changes without knowing.

I'm wondering what you provided as input to the preference screen below.

Given your input it should work if you provide "/Application/Arduino.app/Contents/Resources/Java"
Can you try to change to this settings saave the preferences reopen the preferences and take a image from the avr path settings

Delete all the project (or even the workspace) selecting delete content on disk before you do a new test.
As far as I see it should work.
Best regards
Jantje
Logged

Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Frozen Midwest
Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I just did an uninstall of Eclipse and deleted all my workbenches, and reinstalled on my Mac Mini. Life is good! Now I just have to do it to my Mac Book Pro's.

This is just killer! Perfect. After a bit, I think that I am going to look into porting over to the IDE version 1.0 though. It is kind of a downer that I have to use an old version of the Arduino IDE, but I tell ya what - It's still flippin' awesome!

Many thanks to you! May your code always compile the first time.

Thanks,
Nicholas
Logged

Frying boards one at a time. Sizzling components by the scores.

Toulouse (France)
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm testing your plugin un my linux (ubuntu 11) with an arduino Nano.
I'm having some linking problems with the arduino_atmega328p autogenerated project:
  ‘init’ was not declared in this scope   main.cxx   /arduino_atmega328p/arduino   line 3   C/C++ Problem
  ‘loop’ was not declared in this scope   main.cxx   /arduino_atmega328p/arduino   line 8   C/C++ Problem
  ‘setup’ was not declared in this scope   main.cxx   /arduino_atmega328p/arduino   line 5   C/C++ Problem
  Symbol 'DDRB' could not be resolved   pins_arduino.c   /arduino_atmega328p/arduino   line 361   Semantic Error
  Symbol 'DDRC' could not be resolved   pins_arduino.c   /arduino_atmega328p/arduino   line 362   Semantic Error
  Symbol 'DDRD' could not be resolved   pins_arduino.c   /arduino_atmega328p/arduino   line 363   Semantic Error
  ...

Am I missing something?
Logged

Belgium
Offline Offline
Edison Member
*
Karma: 68
Posts: 1897
Arduino rocks; but with my plugin it can fly rocking the world ;-)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Nicholas
Are you saying the plugin work fine on OSX with Arduino IDE 0023? That would be great.

turdusmerula
The init, loop and setup sound unknown to me.
Does you code compile? if so please read the section "Eclipse tells me there are bugs in my code but it compiles ok." in the faq at http://www.baeyens.it/eclipse/Arduino%20eclipse%20plugin%20FAQ.htm
How do you get to main.cxx? I have main.cpp?

About the errors in pins_arduino.h see "There are errors and warnings in the Arduino library." in the same FAQ

Note that in 1.0 these errors have been fixed  smiley-grin

Keep me posted
Logged

Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Frozen Midwest
Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I am not positive which version it is. I didn't take a look. I will next time I boot it up though.

Thanks again!
Logged

Frying boards one at a time. Sizzling components by the scores.

Toulouse (France)
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay solved my problems. I just have to tell eclipse to exclude the main.cxx file from build and it works !

On ubuntu we have the 0022 installed and your plugins works, really great job thanks a lot  smiley

One remaining question, where can I find on eclipse the output logs emitted by the Serial.print() command? thought I'd find it in the Console window but I failed.
« Last Edit: December 04, 2011, 03:45:21 pm by turdusmerula » Logged

Belgium
Offline Offline
Edison Member
*
Karma: 68
Posts: 1897
Arduino rocks; but with my plugin it can fly rocking the world ;-)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

turdusmerula
You need a serial communication program with the eclipse plugin. I use the serial monitor from the arduino IDE.
I'll make a todo to add this to the FAQ.
Best regards
Jantje
Logged

Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Toulouse (France)
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You need a serial communication program with the eclipse plugin. I use the serial monitor from the arduino IDE.

Thats what I was doing smiley-wink
I use the cat command, it works far better than the arduino IDE in a good console emulator in Linux
Code:
cat /dev/ttyUSB0
Just make sure that the bitrate selected in eclipse is the same than the one given in the Serial.begin().
Note that the cat must be killed before trying an new burn of the arduino.
Logged

Belgium
Offline Offline
Edison Member
*
Karma: 68
Posts: 1897
Arduino rocks; but with my plugin it can fly rocking the world ;-)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

turdusmerula

Txs for the linux tip on to use cat.
I'm still working on the 1.0 compatibility.
Best regards
Jantje
Logged

Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Belgium
Offline Offline
Edison Member
*
Karma: 68
Posts: 1897
Arduino rocks; but with my plugin it can fly rocking the world ;-)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

All
1.0 compatibility is fixed.
And I wanted this thread back on top  smiley-cool
Best regards
Jantje
Logged

Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Toulouse (France)
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello Jantje. I now only use your plugin as primary tool for my projects, it is pretty stable and very usefull smiley

One thing i noticed, do not make a cancel during a burn of the arduino even if the burn is not working because the serial port remains locked (hard disconnect of the arduino seems to be enough to solve this).

And one request: would it be hard to offer the possibility to choose a different serial port for different project? for exemple to have a TX arduino project on serial 1 and RX arduino project on serial 2.

Do you know a plugin or third party tool I could use to remote debug on the arduino and do step by step?
Logged

Pages: 1 [2] 3 4 ... 31   Go Up
Jump to: