-
Notifications
You must be signed in to change notification settings - Fork 338
ATMEGA32U4: uploading via USB bootloader and ModemManager on Linux #65
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
Comments
Just chiming in to say I've been battling this issue on Kubuntu 18.04.2 first with Arduino 1.8.8 and then 1.8.9 and purging ModemManager didn't change anything. The ATMEGA32U4 boards I'm attempting to program are the Pro Micro Beetle inwhich the bootloader says it's a GenuinoMicro. I had deleted my ~/.arduino15 directory upon installing Arduino IDE 1.8.9 which didn't help but strangely, when I moved that out of the way and replaced the old ~/.arduino15 directory I was able to get one upload to complete. Dozens of attempts afterwards would not work. |
I'll spin up a Kubuntu 18.04.2 VM with Arduino 1.8.9 tonight and see if I can reproduce this... fingers crossed ;) The board I have is a Arduino Micro clone (5v), which has the official Arduino bootloader, so hopefully that doesn't exhibit different behavior |
Thanks, I'll boot a custom Lubuntu 18.04.2 iso and try it there too. The board I'm using is the 5V, ACROBOTIC PRO Micro Beetle ATmega32u4 Development Board Arduino-Compatible Nano Micro | USB-A UPDATE: that didn't work either. I killed the ModemManager first thing and then ran Arduino IDE 1.8.9 and just ran the Blink sample sketch and it would not upload. chmod'ed /dev/ttyACM0 to 777 and even ran Arduino as root but it wouldn't upload. Tried v1.6.13 and that didn't work either. UPDATE(2): I installed PlatformIO into Atom after having to manually create the virtualenv but I was able to program the Pro Micro Beetle. It worked surprisingly well as this is the first time I've seen PlatformIO. |
Sorry, couldn't reproduce that on my end. The board I'm using is one of these... I didn't even kill modemmanager on the Kubuntu VM... it didn't seem to cause any issues yet... although that could be something to do with the VM as well. I also didn't install the udev rules, which I did expect to need to do. I did add the user to the |
Thanks, I had tried to save you some time and posted updates to my original posting stating that I got PlatformIO to work. I too didn't change the plugdev rules but did remove ModemManager and it worked like a charm. |
Thanks for that ;) I wasn't sure if it was a one off, or was consistently working, and also gave me a chance to try the 1.8 beta of the vscode extension on another linux variant ;) At least you've been able to get it working, that's the important thing! :) |
Yes, getting the software uploaded and with a platform I can work out the software in was the goal. And with that the solution now has me dipping my toes into the PlatformIO waters. I had originally thought this post was another Arduino git issue. Gotta love the Internet and how things can lead from one thing to another. Thanks for the guidance. |
I've since realised it should be possible to simply add a udev rule to instruct modem-manager to stop being a PITA, so will close this issue as I have done a PR against the udev rules which would negate this issue entirely. platformio/platformio-core#2966 |
So, it appears there is an issue in Debian Buster and Ubuntu 18.04.2 already, and more Linux distros will follow suit due to a change in behaviour in the ModemManager package exposing a bug in the firmware used on ATMEGA32U4 USB bootloaders, so boards like the Arduino Micro and Sparkfun Pro Micro are affected, just to name two... would adding something to the FAQ be more appropriate than to each boards page?
I found it mentioned here after banging my head against errors for a good half hour, and trying to craft udev rules to stop it, to no avail: arduino/Arduino/issues/7690 . If this PR is committed, the underlying issue will be resolved, but that won't fix all the boards already out in the wild. arduino/ArduinoCore-avr/pull/92 And this is the issue to follow to see if a workaround is done on ModemManagers end...
e.g. Something like the below?
error: programmer did not respond to command: set addr
- Newer versions of ModemManager are known to cause this error when trying to upload to your Arduino Micro or Sparkfun Pro Micro (and potentially more ATMEGA32U4 based boards) if trying to use the built in USB bootloader. The upload is prone to failure, corrupting the upload, and may require you to use an In Circuit Serial Programmer in order to re-write the device bootloader.A temporary fix is to run
sudo systemctl stop ModemManager
from a terminal prompt, which will last until you reboot your computer. The more permanent solution is to runsudo systemctl disable ModemManager
. Unless you use mobile broadband you may not even notice it's disabled.The text was updated successfully, but these errors were encountered: