Skip to content

Uploading to a 32u4 board fails #3910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
NicoHood opened this issue Oct 2, 2015 · 11 comments
Closed

Uploading to a 32u4 board fails #3910

NicoHood opened this issue Oct 2, 2015 · 11 comments
Labels
Type: Invalid Off topic for this repository, or a bug report determined to not actually represent a bug
Milestone

Comments

@NicoHood
Copy link
Contributor

NicoHood commented Oct 2, 2015

I tried to upload a program to a pololu 32u4 Mini LV board today and I got the following errors.
Used this PR as build, linux 64 bit.
#3896 (comment)

Uploading to a leonardo board works as expected. (with HoodLoader2.0.5 but with leonardo PID/VID)

I also tried to install the software files:
https://github.com/pololu/a-star/tree/master/add-on/pololu

Currently trying to find the reason for this bug. However the 2nd error should not happen I guess. I will report the progress here, just that you know this bug exists.

First time hitting upload:

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/linuxuser/Downloads/arduino-PR-3896-BUILD-410/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/home/linuxuser/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : avr109
         Overriding Baud Rate          : 57600
avrdude: ser_open(): can't open device "/dev/ttyACM0": Device or resource busy
avrdude: ser_send(): write error: Bad file descriptor
Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

2nd Time hitting upload:

processing.app.debug.RunnerException
    at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:130)
    at cc.arduino.UploaderUtils.upload(UploaderUtils.java:78)
    at processing.app.Sketch.upload(Sketch.java:1179)
    at processing.app.Sketch.exportApplet(Sketch.java:1153)
    at processing.app.Sketch.exportApplet(Sketch.java:1125)
    at processing.app.Editor$DefaultExportHandler.run(Editor.java:2443)
    at java.lang.Thread.run(Thread.java:745)
Caused by: processing.app.SerialException: Error touching serial port '/dev/ttyACM0'.
    at processing.app.Serial.touchForCDCReset(Serial.java:87)
    at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:119)
    ... 6 more
Caused by: jssc.SerialPortException: Port name - /dev/ttyACM0; Method name - openPort(); Exception type - Port busy.
    at jssc.SerialPort.openPort(SerialPort.java:164)
    at processing.app.Serial.touchForCDCReset(Serial.java:81)
    ... 7 more

Updates

  • A Leonardo fails with their bootloader. It could be caused by the Vendor ID or their bootloader itself/ their fuses settings.
  • The fuses are not the problem, bootloader or VID+PID left
  • Pro micro bootloader has the same problem. can be the bootloader structure or the PID.
@NicoHood
Copy link
Contributor Author

NicoHood commented Oct 2, 2015

Its an IDE bug. I recompiled my working HoodLoader2 with their VID/PID. changing the PID (+arduino VID) works but changing both gives the error above. This is "poor" 3rd party support and should be fixed.

Tested with

a-star32U4.vid.0=0x1ffb
a-star32U4.pid.0=0x0101

And sparkfun pro micro16

(Tried in an USB3 Port)

@DavidEGrayson
Copy link

Hello. I'm from Pololu Robotics & Electronics (@pololu), and I don't think this is a bug in the Arduino IDE. I suspect you just need to follow the instructions from the a-star README, which say:

The "udev-rules" directory contains a file named "a-star.rules" for Linux users.
If you copy this file to /etc/udev/rules.d/, it will tell ModemManager to not
try to access the virtual serial ports of the A-Star. This is necessary on some
systems in order to program the A-Star.

This problem could also be solved by updating ModemManager to a newer verison that includes our patch.

@NicoHood
Copy link
Contributor Author

NicoHood commented Oct 5, 2015

Cant the arduino program catch this error? However the exceptions should be fixed.

@ffissore ffissore self-assigned this Oct 6, 2015
@chrispanag
Copy link

I have the same bug exactly with my official Arduino Leonardo. I haven't been able to upload any sketches on it (I bought it yesterday)

Firstly I get this:
avrdude: ser_open(): can't open device "/dev/ttyACM2": Device or resource busy avrdude: ser_send(): write error: Bad file descriptor

And then I get this:
processing.app.debug.RunnerException at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:132) at processing.app.debug.Compiler.upload(Compiler.java:166) at processing.app.Sketch.upload(Sketch.java:1167) at processing.app.Sketch.exportApplet(Sketch.java:1141) at processing.app.Sketch.exportApplet(Sketch.java:1113) at processing.app.Editor$DefaultExportHandler.run(Editor.java:2380) at java.lang.Thread.run(Thread.java:745) Caused by: processing.app.SerialException: Error touching serial port '/dev/ttyACM2'. at processing.app.Serial.touchForCDCReset(Serial.java:92) at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:121) ... 6 more Caused by: jssc.SerialPortException: Port name - /dev/ttyACM2; Method name - openPort(); Exception type - Port busy. at jssc.SerialPort.openPort(SerialPort.java:164) at processing.app.Serial.touchForCDCReset(Serial.java:86) ... 7 more

@NicoHood
Copy link
Contributor Author

NicoHood commented Oct 6, 2015

Is it from arduino.org or from arduino.cc? Maybe their vendor ID also cause problems. This should be fixed somehow if possible. Or at least a proper error message should be printed.

@chrispanag
Copy link

It is from Arduino.org

@matthijskooijman
Copy link
Collaborator

On other thing to try: Try stopping / killing ModemManager if it is running. I've seen it cause problems by probing all serial ports that might be a modem. For a normal Uno, this only causes problems when you upload directly after plugging in, but since a Leonardo resets its USB during upload, this might cause this problem, I believe.

@chrispanag
Copy link

You were right!
See this: It fixed my problem :)

http://labs.arduino.org/Arduino+IDE+on+Linux-based+OS

@matthijskooijman
Copy link
Collaborator

Ok, closing this then.Thanks for reporting back.

@matthijskooijman matthijskooijman added the Type: Invalid Off topic for this repository, or a bug report determined to not actually represent a bug label Oct 6, 2015
@ffissore ffissore modified the milestone: Release 1.6.6 Oct 7, 2015
@ghost
Copy link

ghost commented Mar 8, 2018

@chrispanag Link is down/redirected. The solution to this problem is missing. What have you seen @chrispanag? Please share!

@ghost ghost unassigned ffissore Mar 8, 2018
@k26dr
Copy link

k26dr commented Feb 13, 2020

I managed to get it to work on Linux by running sudo arduino and running it as root.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Invalid Off topic for this repository, or a bug report determined to not actually represent a bug
Projects
None yet
Development

No branches or pull requests

6 participants