1

I have an arduino micro which I want to program from my Kubuntu 15.10 system. I installed the arduino software using apt-get, but when I try to upload the program (for test purpose I use the Basics\BareMinimum sketch) I get the following error:

Found programmer: Id = "0.00 V1"; type =  
    Software Version = 0..; Hardware Version = 0.0
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?

The proper device "Arduino Micro" is selected and also the proper port "/tty/ACM0". I found people on the internet which have the same error and could solve it by using another USB port or cable. But I tried it with two different cables and different ports and didn't manage to get it working. I even tried it on my Laptop running an older version of Kubuntu which produced the same error.

Therefore I tried the newest version of the Arduino software from the arduino homepage. With this I get a different error:

avrdude: ser_open(): can't open device "/dev/ttyACM0": Device or resource busy
avrdude: ser_send(): write error: Bad file descriptor

My user is added to the dialout group, so I should have access to the port. It is also the right port as the port disappears from the arduino menu when I unplug the board.

The arduino itself shouldn't be the problem, as I can upload the sketch from another windows laptop without problems.

EDIT: when I plug in the arduino, the following is added to the dmesg output:

[ 8390.293960] usb 1-2: new full-speed USB device number 6 using xhci_hcd
[ 8390.424861] usb 1-2: New USB device found, idVendor=2341, idProduct=8037
[ 8390.424863] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 8390.424864] usb 1-2: Product: Arduino Micro
[ 8390.424865] usb 1-2: Manufacturer: Arduino LLC
[ 8390.425283] cdc_acm 1-2:1.0: ttyACM0: USB ACM device
[ 8390.426815] input: Arduino LLC Arduino Micro as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/0003:2341:8037.0007/input/input21
[ 8390.482163] hid-generic 0003:2341:8037.0007: input,hidraw4: USB HID v1.01 Mouse [Arduino LLC Arduino Micro] on usb-0000:00:14.0-2/input2
  • Try hitting reset before upload. – Mikael Patel Jan 21 '16 at 22:56
  • Hitting the reset button also doesn't solve the problem. Not I get an "upload completed", but the arduino still has the previous program loaded. – Randrian Jan 23 '16 at 15:10
  • Which version of the IDE are you using? – Nick Gammon Jan 25 '16 at 9:37
  • I tried the one from the ubuntu package repository and one directly from the arduino.cc page. I have to look the version numbers up. – Randrian Jan 25 '16 at 12:32
  • The package version I am using is 1:1.0.5+dfsg2-2, the other I tried was 2:1.0.5+dfsg2-4. – Randrian Jan 25 '16 at 18:23
2
+50

Therefore I tried the newest version of the Arduino software from the arduino homepage.

The package version I am using is 1:1.0.5+dfsg2-2, the other I tried was 2:1.0.5+dfsg2-4.

That is not the newest version.

I think the more recent versions of the IDE are more robust - after all they have fixed reported bugs. Try 1.6.5 or 1.6.7. The version 1.0.5 is pretty old.


I too have had "upload completed" on my Leonardo (virtually the same as the Micro) when it did no such thing.

I am using Ubuntu 14.04 and don't have any problems programming my Micro with IDE 1.6.7.


When programming you should see the Tx/Rx and yellow LEDs flicker. If not, press Reset when it starts to upload and try again.


Have you followed the instructions here? Arduino Troubleshooting.


I installed the arduino software using apt-get ...

Personally I download the IDE from this page: https://www.arduino.cc/en/Main/Software


Update

I just compiled and uploaded "Blink" with IDE 1.6.7 to my Micro on Ubuntu 14.04. This is what I saw:

Forcing reset using 1200bps open/close on port /dev/ttyACM1
PORTS {/dev/ttyACM0, /dev/ttyACM1, } / {/dev/ttyACM0, } => {}
PORTS {/dev/ttyACM0, } / {/dev/ttyACM0, /dev/ttyACM1, } => {/dev/ttyACM1, }
Found upload port: /dev/ttyACM1
/home/nick/Development/arduino-1.6.7/hardware/tools/avr/bin/avrdude -C/home/nick/Development/arduino-1.6.7/hardware/tools/avr/etc/avrdude.conf -v -patmega32u4 -cavr109 -P/dev/ttyACM1 -b57600 -D -Uflash:w:/tmp/build8f287ac41038dd4edf2d64ea95be7b6f.tmp/Blink.ino.hex:i 

avrdude: Version 6.0.1, compiled on Apr 14 2015 at 19:04:16
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/home/nick/Development/arduino-1.6.7/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/home/nick/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM1
         Using Programmer              : avr109
         Overriding Baud Rate          : 57600
         AVR Part                      : ATmega32U4
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  9000  9000 0x00 0x00
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : butterfly
         Description     : Atmel AppNote AVR109 Boot Loader

Connecting to programmer: .
Found programmer: Id = "CATERIN"; type = S
    Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:
    Device code: 0x44

avrdude: devcode selected: 0x44
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9587
avrdude: reading input file "/tmp/build8f287ac41038dd4edf2d64ea95be7b6f.tmp/Blink.ino.hex"
avrdude: writing flash (4456 bytes):

Writing | ################################################## | 100% 0.33s

avrdude: 4456 bytes of flash written
avrdude: verifying flash memory against /tmp/build8f287ac41038dd4edf2d64ea95be7b6f.tmp/Blink.ino.hex:
avrdude: load data flash data from input file /tmp/build8f287ac41038dd4edf2d64ea95be7b6f.tmp/Blink.ino.hex:
avrdude: input file /tmp/build8f287ac41038dd4edf2d64ea95be7b6f.tmp/Blink.ino.hex contains 4456 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.03s

avrdude: verifying ...
avrdude: 4456 bytes of flash verified

avrdude done.  Thank you.

Can you please compare to what you get? Or post exactly what you see?


What do you see in your Port menu? This is what I see:

Port menu


Installing Arduino on a fresh Ubuntu system

I did the following steps to get Arduino up on Ubuntu 14.04, on a PC where it was not previously installed.

Download and install

Compile "blink"

  • Selected Uno device type
  • Loaded "Blink" from examples
  • Uploaded (checked Uno showed in menu as shown above)
  • Got error:

    Sketch uses 1,030 bytes (3%) of program storage space. Maximum is 32,256 bytes.
    Global variables use 9 bytes (0%) of dynamic memory, leaving 2,039 bytes for local variables. Maximum is 2,048 bytes.
    avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied
    ioctl("TIOCMGET"): Inappropriate ioctl for device
    

Check permissions, join dialout and tty groups

See owner of /dev/ttyACM*

$ ls -l /dev/ttyACM*
crw-rw---- 1 root dialout 166, 0 Feb  1 07:32 /dev/ttyACM0

Am I in that group? (No)

getent group dialout
dialout:x:20:

Add to group dialout:

$ sudo usermod -a -G dialout nick

Am I in that group? (Yes)

$ getent group dialout
dialout:x:20:nick

Try again:

avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied
ioctl("TIOCMGET"): Inappropriate ioctl for device
Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

Add to group tty:

$ sudo usermod -a -G tty nick

Check groups I am in:

$ groups nick
nick : nick adm tty dialout cdrom sudo dip plugdev lpadmin sambashare

Try again (same error).

Log out and log back in

After logging out and back in, it uploaded OK! Changed to Micro board (very similar to Leonardo) - still uploaded OK (after changing board type in IDE).

Check USB for Micro

After reset:

$ lsusb | grep Arduino
Bus 002 Device 014: ID 2341:0036 Arduino SA 

After about 3 seconds:

$ lsusb | grep Arduino
Bus 002 Device 015: ID 2341:8037 Arduino SA 
  • Did my suggestion (of using the latest IDE) help? You have a bounty on the question, but we aren't getting much feedback on the suggested solutions. – Nick Gammon Jan 28 '16 at 4:17
  • I already had the newest version. Maybe I did read the version number wrong. I downloaded the newesest version 1.6.7 again and also tried the nightly build 1.6.8 (just downloaded). But I still get avrdude: ser_open(): can't open device "/dev/ttyACM0": Device or resource busy and avrdude: ser_send(): write error: Bad file descriptor as error messages in two subsequent lines. – Randrian Jan 28 '16 at 18:08
  • In the arduino IDE (Version 1.6.7, on Kubuntu 15.10) I get: pastebin.com/a77ctPEn With avrdude in the terminal I get: pastebin.com/N7AZAhjW – Randrian Jan 28 '16 at 20:45
  • See screenshot of Port menu in my answer. – Nick Gammon Jan 28 '16 at 22:12
  • renderclonks.de/files/ScreenShotArduino.png I see nothing special or suspicious – Randrian Jan 28 '16 at 22:19
1

I have been meaning to try the Arduino IDE on Ubuntu. (I'm on Ubuntu 14.10 LTS and using an original Arduino UNO).

From the top, I installed using:

sudo apt-get update && sudo apt-get install arduino arduino-core

(from: http://playground.arduino.cc/Linux/Ubuntu)

It's the older version 1.0.5 and loaded up the basic sketch. It worked straight off the bat.

Just some quick thoughts:

Keyboard and mouse emulation

I noticed the hid-generic and was reminded of the caution on:
https://www.arduino.cc/ re codig practices for keyboard and mouse emulation

regarding coding practices for keyboard and mouse emulation. Does your old sketch utilise the keyboard/mouse libraries at all? It might come down to REALLY timing the reset perfectly.

The reset problem

Given that you're getting a communication error based on the virtual USB device in the Leonardo/Micro (single chip as opposed to the previous versions), and you're seeing it in the IDE but not via the avrdude software, have you followed the reset instructions from the above link? So back to timing the reset (emphasis mine):

In general, you upload code to the Leonardo or Micro as you would with the Uno or other Arduino boards. Click the upload button in the Arduino IDE and your sketch will be automatically uploaded onto the board and then started. This works more or less the same way as with the Uno: the Arduino software initiates a reset of the board, launching the bootloader - which is responsible for receiving, storing, and starting the new sketch.

However, because the serial port is virtual, it disappears when the board resets, the Arduino software uses a different strategy for timing the upload than with the Uno and other boards. In particular, after initiating the auto-reset of the Leonardo or Micro (using the serial port selected in the Tools > Serial Port menu), the Arduino software waits for a new virtual (CDC) serial / COM port to appear - one that it assumes represents the bootloader. It then performs the upload on this newly-appeared port.

These differences affect the way you use the physical reset button to perform an upload if the auto-reset isn't working. Press and hold the reset button on the Leonardo or Micro, then hit the upload button in the Arduino software. Only release the reset button AFTER you see the message "Uploading..." appear in the software's status bar. When you do so, the bootloader will start, creating a new virtual (CDC) serial port on the computer. The software will see that port appear and perform the upload using it. Again, this is only necessary if the normal upload process (i.e. just pressing the uploading button) doesn't work. (Note that the auto-reset is initiated when the computer opens the serial port at 1200 baud and then closes it; this won't work if something interferes with the board's USB communication - e.g. disabling interrupts.)

avrdude command line

Next, share your avrdude command line and we can see if something is odd there. As an example with my UNO I see this:

/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -v -v -v -v -patmega328p -carduino -P/dev/ttyACM0 -b115200 -D -Uflash:w:/tmp/build1362089533882735765.tmp/Blink.cpp.hex:i 

avrdude: Version 6.0.1, compiled on Oct 21 2013 at 15:55:32
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/usr/share/arduino/hardware/tools/avrdude.conf"
         User configuration file is "/home/madivad/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: Send: 0 [30]   [20] 
.... and so on ....

USB 3 vs USB 2

I probably could have put this closer to the top, but are you using a USB 2 or USB 3 port? If USB 3 are the correct drivers loaded? Have you tried a USB 2 port (if available)

Good luck

  • Thank you for your comment. I tired different USB ports, also USB 2 ports. I don't use any mouse or keyboard functions in the arduino, so this souldn't apply. I uploaded the bare minimum sketch before (using a windows laptop) to rule out problems from the previous sketch. Holding down the reset button now results in the arduino IDE pretending to upload correctly, but the sketch doesn't work (the LED doesn't blink, and it does if I upload from windows. The avrdude gives an output with "programmer is not responding": pastebin.com/iPwFK7yK – Randrian Jan 25 '16 at 18:17
1

You may find that there is a process on Ubuntu that is grabbing the newly created CDC/ACM port as soon as it enters programming mode.

With the Leonardo and Micro you have a CDC/ACM port while it's running, and when the board resets to enter programming mode that CDC/ACM port is destroyed and an entirely new one (hopefully under the same name) is created. The process modem-manager can grab that newly created CDC/ACM device thinking it's a modem and try to configure it as such, thus locking you out of the port. A similar process in Debian is brltty which tries to configure the CDC/ACM port as a braille TTY interface.

You can check to see what process has the CDC/ACM device node open if any with the lsof command:

sudo lsof /dev/ttyACM0

If you find that you do have modem-manager running on your system (I'm not sure if it's still default or not, it's been a while since I used Ubuntu, preferring the purity of Debian) it's best to completely remove it:

sudo apt-get remove modemmanager
  • sudo lsof /dev/ttyACM0 gives an empty output. – Randrian Jan 25 '16 at 18:21
  • Then nothing is locking the file at that moment then. Still, check to see if modem-manager is running: ps ax | grep -i modem – Majenko Jan 25 '16 at 18:22
  • ` 787 ? Ssl 0:00 /usr/sbin/ModemManager 4497 pts/1 S+ 0:00 grep --color=auto -i modem` so it appears to be running I think. I will try to remove it. – Randrian Jan 25 '16 at 18:24
  • I uninstalled it as well as brltty, but it didn't change anything. – Randrian Jan 25 '16 at 18:37
  • Make sure that the processes have actually gone - they may still be lingering even after uninstall. – Majenko Jan 25 '16 at 18:38
0

This is all the symptoms of not having the correct board selected in the IDE. The fact that the LEDs are flashing during uploading means it's probably not a comms issue.

I understand you wrote that you have selected the correct board already, but please double/triple-check.

I work with both UNOs and Nanos, this is a classic mistake I make all the time.

-1
sudo chmod 666 /dev/ttyACM{for your arduino board}

mine happens to be "/dev/ttyACM1" so i did

sudo chmod 666 /dev/ttyACM1
  • There are two problems here: first, the error is not one of permissions, but that the device is busy, so this won't help. The other is that this solution is not lasting - if there were an actual permission issue, you'd have to do this each time the Arduino enumerated. The correct way is to add one's user to the group which owns serial devices, which the asker seems to have already attempted to do. It's worth noting also that the question is a year and a half old. – Chris Stratton Sep 22 '17 at 5:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.