Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Arduino upload problem from Eclipse CDT / Ubuntu(Can't get rid of AVRDude error, while I can upload from Arduino IDE)
Arduino upload problem from Eclipse CDT / Ubuntu [message #1760689] Mon, 01 May 2017 22:02 Go to next message
Franc ZijderveldFriend
Messages: 5
Registered: May 2017
Location: Netherlands
Junior Member
Hi,

I recently saved an old laptop (Core2) by removing Windows Vista and installing Ubuntu 16.04 LTS (32 bit). I installed Arduino IDE: with this I can compile and upload sketches into my Arduino Uno.

Then I installed Eclipse Neon CDT and the Arduino Plugin. I can compile, I see that a HEX file is created, but I cannot upload.

When I created a connection, I could not select any COM ports. Instead I typed /dev/ttyACM0 into the field. This does not seem to work. Instead of a port ID, AVRDude uses a Baud rate setting as the target address.

My build console show this message:
Quote:

avrdude: Version 6.3, compiled on Jan 17 2017 at 06:01:25
Copyright (c) 2000-2005 Brian Dean, http : //www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "/home/franc/.arduinocdt/packages/arduino/tools/avrdude/6.3.0-arduino9/etc/avrdude.conf"
User configuration file is "/home/franc/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : -b115200
Using Programmer : arduino
avrdude: ser_open(): can't open device "-b115200": No such file or directory

avrdude done. Thank you.


It appears I need to find a way to configure how Eclipse calls on AVRDude. I haven't been able to find this.

BTW: I also installed Arduino IDE, Eclipse CDT and the Arduino Plugin on the Windows10 laptop I use at work. In this case I could select the right COM port during creation of the connection and upload works fine.

I'd like to get the Ubuntu configuration working as well (so I can have a permanent set-up at home.) Can anybody push me in the right direction?
Re: Arduino upload problem from Eclipse CDT / Ubuntu [message #1761312 is a reply to message #1760689] Tue, 09 May 2017 15:52 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
The serial ports on Linux are not named like COMxxx.

In Ubuntu, the first USB serial line is /dev/ttyUSB0. When the USB hardware is connected, you should be able to list it with ls -l /dev/ttyU*.

It is possible that the connection is handled totally differently in Linux. Please read the avrdude manual on the Ubuntu (man avrdude).


--

Tauno Voipio
Re: Arduino upload problem from Eclipse CDT / Ubuntu [message #1761345 is a reply to message #1761312] Wed, 10 May 2017 05:34 Go to previous messageGo to next message
Franc ZijderveldFriend
Messages: 5
Registered: May 2017
Location: Netherlands
Junior Member
Hi Tauno,

thanks for your help.

Quote:
The serial ports on Linux are not named like COMxxx.

In Ubuntu, the first USB serial line is /dev/ttyUSB0. When the USB hardware is connected, you should be able to list it with ls -l /dev/ttyU*.

It is possible that the connection is handled totally differently in Linux. Please read the avrdude manual on the Ubuntu (man avrdude).


I tried to understand man avrdude, but that is out of my league. It assumes I already know about lots of abbreviations and hardware/driver related issues in Linux. As of yet, I'm not a frequent Linux user.

What puzzles me is that the simple Arduino IDE -on the same computer- actually does upload to my Arduino Uno. From its settings I can see that it uses avrdude over /dev/ttyACM0.

I would expect that Eclipse with the Arduino plug-in should be able to use the same hardware and drivers. It appears that it uses different settings.
I don't want to become an expert on avrdude, I just want to use Eclipse as an IDE for Arduino. The dialog to create a connection in Eclipse/Arduino, imho, does not work as expected. It specifically asks for a COM port and gives no options to choose from.
Re: Arduino upload problem from Eclipse CDT / Ubuntu [message #1761393 is a reply to message #1761345] Wed, 10 May 2017 13:35 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
You have to climb some learning and setup ladder to use Eclipse for Arduino.

Sorry, I cannot give direct instructions, as I have programmed my AVR's and ARM's on bare metal only, without the Arduino libraries in between.

It is possible that the Arduino USB hardware creates a port /dev/ttyACM0.

Please check it:

1. Before connecting Arduino
lsusb
ls -l /dev/ttyA*

2. After connecting Arduino
lsusb
ls -l /dev/ttyA*

Please post the results.

--

-Tauno


--

Tauno Voipio
Re: Arduino upload problem from Eclipse CDT / Ubuntu [message #1761417 is a reply to message #1761393] Wed, 10 May 2017 19:50 Go to previous messageGo to next message
Franc ZijderveldFriend
Messages: 5
Registered: May 2017
Location: Netherlands
Junior Member
Tauno Voipio wrote on Wed, 10 May 2017 15:35
You have to climb some learning and setup ladder to use Eclipse for Arduino.

Sorry, I cannot give direct instructions, as I have programmed my AVR's and ARM's on bare metal only, without the Arduino libraries in between.

It is possible that the Arduino USB hardware creates a port /dev/ttyACM0.

Please check it:

1. Before connecting Arduino
lsusb
ls -l /dev/ttyA*

2. After connecting Arduino
lsusb
ls -l /dev/ttyA*

Please post the results.

--

-Tauno


Thanks again for trying to help me out. I understand I have to learn how to use the tool. In Windows, it took me about 20 minutes to get things working. I'm a bit disappointed in Linux at this stage.

Anyway, here are the results that you asked me to post. Before connecting Arduino:
Quote:
franc@Jarvis:~$ lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 064e:a103 Suyin Corp. Acer/HP Integrated Webcam [CN0314]
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
franc@Jarvis:~$ ls -l /dev/ttyA*
ls: cannot access '/dev/ttyA*': No such file or directory
franc@Jarvis:~$


After connecting Arduino:
Quote:
franc@Jarvis:~$ lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 003: ID 2341:0043 Arduino SA Uno R3 (CDC ACM)
Bus 005 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 064e:a103 Suyin Corp. Acer/HP Integrated Webcam [CN0314]
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
franc@Jarvis:~$ ls -l /dev/ttyA*
crw-rw---- 1 root dialout 166, 0 May 10 21:06 /dev/ttyACM0


So you are right: Arduino USB hardware creates a port ttyACM0. It's not clear to me what this means for using Eclipse in stead of Arduino IDE. I always have my UNO connected, so the port was available during installation of Eclipse and the plug-in.

Apart from these results, I also attached three screendumps, showing that the Arduino IDE nicely detects and uses the ttyACM0 port that is created by the Arduino USB hardware, and that Eclipse CDT with the Arduino plug-in does not. Btw I typed the /dev/ttyACM0 in that screenshot by hand. After saving and reopening the properties, the field is empty once more.

Your help is surely appreciated.
Re: Arduino upload problem from Eclipse CDT / Ubuntu [message #1761611 is a reply to message #1761417] Thu, 11 May 2017 13:41 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
Are you starting avrdude as an external tool?
It seems that the command line is incorrect.

For Arduino Uno internal bootstrap It should look like:

avrdude -F -v -pm328p -cstk500v1 -P/dev/ttyACM0 -b19200 -D -Uflash:w:"file.hex":i

Explanation:

# -F: ignore signature
# -p: part, ATmega168
# -c: programmer, STK500 v.1
# -P: port
# -b: bit rate
# -D: no auto-erase
# -U: memtype:op:filename[:format], flash, write, Intel hex

Have you tried generating /home/franc/.avrduderc? There are instructions in the avrdude documentation chapter 4.

Have you tried running avrdude on the console, outside Eclipse?

--

-TV


--

Tauno Voipio
Re: Arduino upload problem from Eclipse CDT / Ubuntu [message #1763336 is a reply to message #1761611] Fri, 12 May 2017 19:59 Go to previous messageGo to next message
Franc ZijderveldFriend
Messages: 5
Registered: May 2017
Location: Netherlands
Junior Member
Hi Tauno,

thanks again for your efforts.

Before your latest hints and tips, I didn't try to generate a .avrduderc file, or type the command in a terminal.

While figuring out what exactly to type in a command line, I accidentally hovered above a part of the Eclipse build console and it popped-up the entire command line that it uses to upload the hex file. You can find a picture of the screen in the attachment.

The command line says:
sh -c "/home/franc/.arduinocdt/packages/arduino/tools/avrdude/6.3.0-arduino9/bin/avrdude" "-C/home/franc/.arduinocdt/packages/arduino/tools/avrdude/6.3.0-arduino9/etc/avrdude.conf" -v -patmega328p -carduino -P -b115200 -D "-Uflash:w:./LeegProject.hex:i"

I ran this from a command line and got the same error message I got when trying to upload from Eclipse.

I then changed the command line by adding /dev/ttyACM0 directly behind the -P, and adjusting the paths to a call from my home directory :
"./.arduinocdt/packages/arduino/tools/avrdude/6.3.0-arduino9/bin/avrdude" "-C./.arduinocdt/packages/arduino/tools/avrdude/6.3.0-arduino9/etc/avrdude.conf" -v -patmega328p -carduino -P/dev/ttyACM0 -b115200 -D "-Uflash:w:./WorkspaceEclipse/LeegProject/build/UNO_ttyACM0/LeegProject.hex:i"

This works: so your conclusion that the command line that Eclipse uses is incorrect is confirmed. I now also know what the command line should be.

Still, I like to use the Eclipse IDE to compile and upload my code by the press of a button, as it does from Windows.
It seems that the Arduino plugin is constructing the command line from my project settings, but as it doesn't allow me to enter /dev/ttyACM0 as the port address, it has nothing to fill in after -P.

Can I override the missing port address from .avrduderc? Or is there a way to let the Arduino plug-in in Eclipse detect the /dev/ttyACM0 port so I can select it in the connection dialog?

Thanks again,
Franc

Re: Arduino upload problem from Eclipse CDT / Ubuntu [message #1763353 is a reply to message #1763336] Sat, 13 May 2017 08:02 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
There are basically two Arduino toolsets in Marketplace: Eclipse IDE for Arduino 2.0 and Sloeber v.4. I guess that you have the former.

There is a discussion chain in <https://marketplace.eclipse.org/content/eclipse-c-ide-arduino> having a thread of your issue. Follow it.

--

-TV


--

Tauno Voipio

[Updated on: Sat, 13 May 2017 08:04]

Report message to a moderator

Re: Arduino upload problem from Eclipse CDT / Ubuntu [message #1763356 is a reply to message #1763353] Sat, 13 May 2017 10:03 Go to previous messageGo to next message
Franc ZijderveldFriend
Messages: 5
Registered: May 2017
Location: Netherlands
Junior Member
Conclusion: it was a bug, it was already fixed, and all I had to do was to search for updates. Another lesson learned: even on fresh installs, always check for updates first...

Thank you very much, Tauno, for your time and perseverance in helping me to get rid of this problem.

Franc

Re: Arduino upload problem from Eclipse CDT / Ubuntu [message #1833658 is a reply to message #1760689] Tue, 20 October 2020 13:56 Go to previous message
Atle Ramsli is currently offline Atle RamsliFriend
Messages: 1
Registered: October 2020
Junior Member
Select project properties.
The Port field is probably blank.

Set it to /dev/ttyUSB0
(or whichever port you're using)
Previous Topic: Sloeber plug-in setup failure
Next Topic:meson build
Goto Forum:
  


Current Time: Thu Oct 10 18:18:34 GMT 2024

Powered by FUDForum. Page generated in 0.03828 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top