Using Arduino IDE 1.8.19 on Manjaro Linux with LTS kernel 6.1.23-1. I want to upload code on the Pololu A-Star 32U4 Micro but I always get the following error: avrdude: ser_open(): can’t open device “/dev/ttyACM0”: Permission denied
This is what’s working:
the board appears as /dev/ttyACM0
arduino IDE can see the board, and can identify it (showing proper ID window)
This is what I have already tried to solve the problem:
I added myself to the “uucp” group with sudo usermod -a -G uucp $USER (logout and reboot) without success
I tried sudo chmod a+rw /dev/ttyACM0 - no success
I tried with other microcontrollers (Arduino Nano, Teensy 4.0) and uploading code was no problem.
I read this post in the forum and I added the line "USB_DENYLIST=“1ffb:2300 1ffb:0101” to /etc/tlp.d/00-template.conf without totally understanding though.
Hi Patrick,
disabling ModemManger did not change the error message but I noticed that the LED on the microcontroller is now blinking when I upload the code.
groups
sys tty lock network power vboxusers uucp lp disk wheel hazet
The output of those commands looks okay. Just in case your membership in the uucp group has not taken full effect, can you try rebooting your computer? Then can you post the full, verbose output when you try to upload to the board?
I have done the reboot it did not help though.
Here’s the verbose output:
Sketch uses 10318 bytes (35%) of program storage space. Maximum is 28672 bytes.
Global variables use 463 bytes (18%) of dynamic memory, leaving 2097 bytes for local variables. Maximum is 2560 bytes.
Forcing reset using 1200bps open/close on port /dev/ttyACM0
PORTS {/dev/ttyACM0, /dev/ttyUSB0, } / {/dev/ttyUSB0, } => {}
PORTS {/dev/ttyUSB0, } / {/dev/ttyACM0, /dev/ttyUSB0, } => {/dev/ttyACM0, }
Found upload port: /dev/ttyACM0
/home/hazet/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/home/hazet/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600 -D -Uflash:w:/tmp/arduino_build_405425/sketch_jan26a.ino.hex:i
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/home/hazet/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
User configuration file is "/home/hazet/.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": Permission denied
Problem uploading to board. See https://support.arduino.cc/hc/en-us/sections/360003198300 for suggestions.
avrdude done. Thank you.
It seems like there is probably something on your computer connecting to the bootloader’s serial port (perhaps briefly) and preventing it from being used by AVRDUDE. I suggest you try running commands like ps auxw to see all your computer’s processes and stop any of them that might be using serial ports.
Another work around you could try is following the “bootloader-before-uploading” procedure in the “Reviving using the Arduino IDE” section of the A-Star 32U4 user’s guide, which might work if whatever program is using the serial port disconnects quickly and does not leave the bootloader in a bad state.
Figuring out which of the processes use serial ports is not something I could do off the cuff. However, I tried the “bootloader-before-uploading” procedure you mentioned - but again no success. Thank you for your help even tough I could not find a solution. I would still be interested to find a solution if you or someone else has more ideas I could try. For now I have to keep up my productivity and I decided to work with a windows machine to finish this project.