Windows/Linux/Mac Eclipse plugin to compile and upload arduino sketches

Hello Jantje,

I thought I would pop along to say hi and again a huge thanks for your fantastic plugin to allow us to program our Arduino's using Eclipse.
I couldn't imagine having to use the Arduino IDE again, scary.

I have version 1.2.5.5 of your plugin running on OSX, but a question,
I am still using Arduino 1.0.1, can I move to 1.0.2 or preferably 1.0.3?

Met vriendelijke groet :slight_smile:
Paul

Paul
Thanks for the nice words.
I havn't done any real testing with 1.0.2 and 1.0.3 but I have done quick testing and havn't seen any problems.
So it should be ok.
Best regards
Jantje

Thank you for all the hard work on this plugin! I was able to get up and compiling in about 15 min thanks this plugin.

I have been having one issue however. The only way I can upload to my Arduino Micro, is to do the following:

  1. Goto Window> Preferences >Arduino>Arduino and check Disable RXTX
  2. Unplug the Arduino Micro and plug it back in
  3. Press the AVR upload button. <--Must be done within a few seconds of plugging the Arduino back in.

If I do not do the above, all that happens is I get a message box showing eclipse is running AVRDude. I can not cancel and there are no messages in the console view, it just hangs there indefinitely.

I am running Linux Mint and Eclipse Indigo.

yoda2nd
Thanks for the nice words on the plugin. I do not own a micro nor do I own Linux mint so I can't say I have tested this setup.
Are you using the 64 or 32 bit version of eclipse indigo?
Which version of the Arduino IDE are you using?
Are you using the serial monitor of the plugin?
In your boards.txt file do you have the following line?

micro.upload.disable_flushing=true

If so and you are not using the serial monitor than the plugin ignores the com port completely.
I also wonder why you have to select

Goto Window> Preferences >Arduino>Arduino and check Disable RXTX

For every upload. This is a global setting. Setting it only set a global flag.
Can you post an image of eclipse when you see the "message box showing eclipse is running AVRDude"
Best regards
Jantje

Hi yoda2nd,
perhaps you already did, but you may look at this page for further info: http://arduino.cc/en/Guide/ArduinoLeonardoMicro#toc4. I don't have a micro, but I understand that before uploading the sketch the Arduino IDE resets the micro, which creates a new virtual port (the micro has no separate controller for serial communication). I understand that in the IDE the timing between the reset and the launch of avrdude is based on some previous trial and error, not "exact science".

This explains why disconnecting the micro works for you (a reset should produce the same effect), and the fact that you have to find a timing that works for you before pressing upload, allowing for the new virtual port to be recognized by your OS, but with the micro still running the bootloader. The most likely reason why avrdude hangs is that it's trying to communicate with a micro that is already past the bootloader stage.

I take this opportunity to thank Jantje for his excellent plugin. Nice to know he's still monitoring this thread.

@spatula
Thanks for pointing to the link.
@all
I indeed have special code for the leonardo upload (I do own a Leonardo). As the micro like the leonardo has no dedicated usb chip it probably needs this code as well.
The easiest way to test this hypothesis is as follows:
Change in your boards.txt

leonardo.name=Arduino Leonardo

to

leonardo.name=Real Arduino Leonardo

and

micro.name=Arduino Micro

to

micro.name=Arduino Leonardo

Then select the board "Arduino Leonardo" as your board in the project properties (it is actually the micro)
And try again.
If this works it proves the hypothesis because I actually test on the name of the board.
Looking at the 1.5.2 boads.txt file I would think the esplora and the lilipad USB have the same issue.

Best regards
Jantje

Thanks for such a quick response.

Are you using the 64 or 32 bit version of eclipse indigo?
Which version of the Arduino IDE are you using?
Are you using the serial monitor of the plugin?

I am using:

64bit Eclipse Indigo
Arduino 1.0.1

And I am not using the serial monitor.

Linux Mint is a fork of Ubuntu with no Unity, it should work just the same as if it were run on Ubuntu.

In your boards.txt file do you have the following line?
Code:
micro.upload.disable_flushing=true

If so and you are not using the serial monitor than the plugin ignores the com port completely.

I have been using the default boards.txt file from 1.0.1, so there is no Micro listed. I have been using the Leonardo configuration from the boards.txt file and it works fine in the IDE. The micro was not added to the boards.txt file until 1.0.2, so I could try giving 1.0.2 whirl if you want.

I have checked the Leonardo settings and upload.disable_flush is set to true and setting it to false has no effect.

I wonder if perhaps the timing between opening and closing the serial port and running ARVDude is different for the Leonardo than the Micro ?

I also wonder why you have to select
Quote
Goto Window> Preferences >Arduino>Arduino and check Disable RXTX
For every upload. This is a global setting. Setting it only set a global flag.

When Disable RXTX is selected, does the plugin not try and reset the arduino?

Can you post an image of eclipse when you see the "message box showing eclipse is running AVRDude"

There is a different variant file for micro and leonardo so I would not use leonardo to program a micro.
So try with arduino IDE 1.0.2 and enabled RXTX

When Disable RXTX is selected, does the plugin not try and reset the arduino?

Not at all. How do you go from "disabling RXTX" to "resetting"?
When you disable RXTX the plugin stops doing all com port actions. So no reset before upload (you have to press the reset button yourself) and no serial monitor. How can the plugin still upload? Because the plugin starts avrdude who does the com port actions.

Best regards
Jantje

PS If you fiddle around like you are; it is nice to warn the reader in advance.

Sorry for taking so long to get back.

I tried upgrading to 1.0.2 and I am able to upload to the micro with RXTX enabled However I still have to reset the micro before upload (press the reset button).

Nice to hear you're got it working with the reset work around.
I have a micro now but I don't get it to work on my redhat :frowning:
Best regards
Jantje

For those owning a due and those wanting to use Arduino IDE 1.5.2 beta for other reasons:
I have released beta V2 that supports Arduino IDE 1.5.2. beta.
Read more at http://blog.baeyens.it/#post4

If you do not need Arduino IDE 1.5.2 beta and you already use the plugin I advice to stick to the plugin version as described at Arduino Eclipse IDE named Sloeber - Welcome! untill Arduino IDE 1.5.X is no longer beta.

For people starting with the plugin V2 can be considered.

Best regards
Jantje

Hello Jantje, thank you very much for your great plugin!

I have tested it successfully with gentoo linux now. My environment:

Portage 2.1.11.55 (default/linux/amd64/13.0, gcc-4.6.3, glibc-2.15-r3, 3.7.10-gentoo x86_64)
dev-util/eclipse-sdk-3.7.1-r11 (Indigo, seden overlay)
dev-embedded/arduino-1.0.3-r1
dev-java/icedtea-bin-7.2.3.6
sys-devel/crossdev-20120721 ('-r1' include my local patch for using multilib on AVR's)
-->cross-avr/avr-libc-1.8.0
-->cross-avr/gcc-4.6.3
-->cross-avr/binutils-2.20.1-r1
dev-embedded/avrdude-5.11.1 ('-r1' include my local patch for higher timout in case of manual reset)
!!But for my very first tests avrdude is used from Arduino-IDE!!
Arduino Eclipse Extension 1.2.4 installed via "http://www.baeyens.it/eclipse/update"

Arduino NG rev.c (tested with Blink.cpp und DoubleCounter.cpp)
Arduino Mega2560 rev. 1 (tested with Blink.cpp und DoubleCounter.cpp)
Arduino Pro Mini328 5V/16MHz (not tested yet)

For some further improvements for linux users here example entries for udev rules (will always get device "/dev/arduino"):
#Bus 005 Device 004: ID 2341:0010 Arduino SA Mega 2560 (CDC ACM)
#ATTRS{manufacturer}=="Arduino (www.arduino.cc)"
#ATTRS{product}=="Arduino Mega 2560"
SUBSYSTEMS=="usb", ATTRS{product}=="Arduino Mega 2560", ATTRS{manufacturer}=="Arduino (www.arduino.cc)", NAME="ttyACM%n", SYMLINK+="arduino"

#Bus 005 Device 006: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
#ATTRS{manufacturer}=="FTDI"
#ATTRS{product}=="FT232R USB UART"
SUBSYSTEMS=="usb", ATTRS{product}=="FT232R USB UART", ATTRS{manufacturer}=="FTDI", NAME="ttyUSB%n", SYMLINK+="arduino"

Good Luck, Thomas

Now I have made some pictures of my running configuration (gentoo linux) to share with you, because I have found only pictures from Windows's and Mac's. Eventually someone could need this to getting started on linux.

Good Luck, Thomas

Thomas
Thanks for the feedback and sharing the images.
For those watching the images. With version 2 of the plugin only the first image is valid. The other configuration pages originated from avrEclipse and no longer exist in V2.

Best regards
Jantje

Hello Jantje, after some further playing around I have some questions and suggestions.

1.) Is there a possibility to configure the name of the automatically generated library f.e. "Arduino_Mega_2560_or_Mega_ADK" --> I would prefer the name "000b_ArduinoMega2560_Core". This will force the libraries to be listed on first position, before all other projects.

2.) Using "Serial Monitor View" give me only "/dev/ttyS0" (instead of "/dev/ttyACM0"), but "/dev/ttyS0" up to "/dev/ttyS3" is already in use on my linux box (eventually on all gentoo linux systems). Is this configurable or hard coded? Eventually you could add "/dev/arduino" in the search list? Than linux users could map any device using the udev rules to "/dev/arduino".

3.) Arduino-Configuration page, renaming suggestion: "test serial dll" --> "test serial library (rxtx)" would be better understandable for linux, mac and windows users

Again, Thank you for the great work! I had fiddling around with the old AVR-Plugin two days without success. Your's worked after 1 hour.

Let me know how I can help you improving the plugin.

Some ideas:
-testing with gentoo (at the moment only indigo is possible)
-write an wiki for gentoo users --> http://en.gentoo-wiki.com
-make some usability test (I'm an usability engineer) --> create issues at git
-translation to german language
-make some small bugfixes
-make a donation for an picaxe :blush:

Thomas

gen2thomas:
1.) Is there a possibility to configure the name of the automatically generated library f.e. "Arduino_Mega_2560_or_Mega_ADK" --> I would prefer the name "000b_ArduinoMega2560_Core". This will force the libraries to be listed on first position, before all other projects.

Version 2 no longer has a separate Arduino project. There is a Arduino folder in each and every sketch and a library folder containing the imported libraries. If this is really important I would advice to go to V2. However this functionality relies on CDT 1.8.1 which needs Juno.
The only option I can think of is to download the code and do the mod yourself.
https://github.com/jantje/arduino-eclipse-plugin/blob/master/it.baeyens.arduino.common/src/it/baeyens/arduino/common/ArduinoConst.java

public static final String CoreProjectNamePrefix = ""; //used to be arduino_ but when chaging from MCU to board replaced by nothing

As you are using version 1.2.4 you do not want this version but the one tagged with Release 1.2.4

gen2thomas:
2.) Using "Serial Monitor View" give me only "/dev/ttyS0" (instead of "/dev/ttyACM0"), but "/dev/ttyS0" up to "/dev/ttyS3" is already in use on my linux box (eventually on all gentoo linux systems). Is this configurable or hard coded? Eventually you could add "/dev/arduino" in the search list? Than linux users could map any device using the udev rules to "/dev/arduino".

I know what you are talking about :~
This is actually a rxtx feature. Arduino has its own version of the rxtx dll. The problem you mention is a Linux only issue and has recently been discussed on the developers list. The only correct way to find the serial devices is to look at /dev/serial. The Arduino team is looking at https://github.com/ffissore/java-simple-serial-connector as a replacement for rxtx. I have not yet (and I'm not planning to) look at what the impact will be on the eclipse plugin.
Workaround is to add following line to your eclipse.ini file

-Dgnu.io.rxtx.SerialPorts=/dev/ttyACM0:/dev/ttyACM1:/dev/ttyACM2:/dev/ttyACM3:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyUSB2:/dev/ttyUSB3:/dev/ttyUSB4:/dev/arduino

gen2thomas:
3.) Arduino-Configuration page, renaming suggestion: "test serial dll" --> "test serial library (rxtx)" would be better understandable for linux, mac and windows users

Is your objection against the word dll or the lack of rxtx.

gen2thomas:
Let me know how I can help you improving the plugin.

Some ideas:
-testing with gentoo (at the moment only indigo is possible)
-write an wiki for gentoo users --> http://en.gentoo-wiki.com
-make some usability test (I'm an usability engineer) --> create issues at git
-translation to german language
-make some small bugfixes
-make a donation for an picaxe :blush:

Help is welcome. There are however some things to keep in mind.

  1. I'm not planning to release any more V1 versions (Normally Arduino IDE 1.0.3 should have been the last V1 Arduino IDE release.)
  2. V2 is a complete rewrite (both for my plugin as for the Arduino IDE)
  3. I have not foreseen translation functionality in the plugin.
  4. Due to health constraints there is no time for me to spend on the plugin in the coming months. Even adding a picaxe donation button will have to wait.

Best regards
Jantje

Hello Jantje, Thank you for your answers!
I will test your suggestions to solve my little problems.

Q: 1.) Is there a possibility to configure the name of the automatically generated library f.e. "Arduino_Mega_2560_or_Mega_ADK" --> I would prefer the name "000b_ArduinoMega2560_Core". This will force the libraries to be listed on first position, before all other projects.
A: The only option I can think of is to download the code and do the mod yourself.

Now I have modified a little bit the file "Boards.txt" (/usr/share/arduino/hardware/arduino/) which is used to generate the names. Sketch was compilable, downloadable and seems to work.

Jantje:
I would advice to go to V2. However this functionality relies on CDT 1.8.1 which needs Juno.

Yes, that is an problem actually for gentoo users - unfortunately there is no official release for eclipse Juno. Also the Indigo, I'm using, is from an overlay (seden) but quite stable. For the future do you plan to separate the V1 and V2 update site or is this already the case? If yes, how to use it?

Jantje:
The problem you mention is a Linux only issue and has recently been discussed on the developers list.

Please can you post an link to follow this discussion.

Jantje:
Is your objection against the word dll or the lack of rxtx.

The word 'dll' is the name for the file extension/suffix of the library used in windows environment (Dynamic Link Library?). Linux and possible Mac users don't know about that (linux extensions are f.e. ".a", ".so" for libraries).

Jantje:
Even adding a picaxe donation button will have to wait.

Oh sorry, this was only a joke. I hope your answer also.

Jantje:
Help is welcome.

HOW can I help you? Please give me some notes.

Best regards, Thomas

Hey Jantje,

I don't know if it's the right place here for asking for your help, but I don't know further anymore.

When I run avrdude from within eclipse it always gives me:
"AVRDude does not support the project target MCU [ATmega32U4]".
But on the other hand if I'm typing in the exact same command from within console it works fine

avrdude	-patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600 -Uflash:w:testSerial.hex:a

It makes no difference whether I check the box "use custom configuration file" in the avrdude preferences and giving him the right config file.
I'm using ubuntu 12.10 64 bit with an arduino leonardo.

Do you have any clue about this?

Thanks, Sh4kE

@SH4kE
Try which avrdude and see whether it is the Arduino provided avrdude you are running on the command line.
If it is not the same that explains your problem.

@gen2thomas

For the future do you plan to separate the V1 and V2 update site or is this already the case? If yes, how to use it?

V1 and V2 are on different update sites. This to avoid unwanted upgrades. V2 update site is at
http://www.baeyens.it/eclipse/V2

Please can you post an link to follow this discussion.

The discussion was/is on the Arduino developers mailing list. I do not know whether there is a HTML history version.

The word 'dll' is the name for the file extension/suffix of the library used in windows environment (Dynamic Link Library?). Linux and possible Mac users don't know about that (linux extensions are f.e. ".a", ".so" for libraries).

For me this is a typical cross platform naming discussion. I'll consider writing "Dynamic Link Library" or just "Library". We'll see what happens in 1.5.3 with rxtx.

I hope your answer also.

No joke.

HOW can I help you? Please give me some notes.

Following options you propose are very helpfull

-write an wiki for gentoo users --> http://en.gentoo-wiki.com
-make some usability test (I'm an usability engineer) --> create issues at git

Other things I could use help with are

Note that the website is on github, but I need to check whether that is the latest version.

Best regards
Jantje

Loving V2 so far, just ironing out a few bugs...

1.) The upload ignores build configurations and always tries to upload from the "Release" Directory no matter what build configuration is active.

2.) The only way I've got my Leonardo to work is by setting the project preferences to the bootloader com port then doing a manual reset on upload, if I use the normal com port setting, then upload resets the board (the board led starts flashing and windows re-aquirres the bootloader port) but the process then errors saying "Leonardo upload port is not appearing after reset"

3.) Currently I've not got my Due to work, compile goes fine, upload appears to work fine, but after upload the due freezes and can;t be reset, the only way to make it come back to life is to upload something from the Arduino IDE, then it will work properly - I'm still investigating this one...

As you've said your ill (Get well!) and not going to have much time, do you have V2 on Github so I could take a look?

Deeply appreciate all the work you've done and will be "buying you an arduino" when next month's paycheck comes in, as being able to work in a sensible IDE is wonderful!

Thanks in advance!