Hi,
Lately I wanted to use an Arduino Mega 2560 I had lying around. When I wanted to flash it didn't work. I'm getting errors like:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
I also tried using Linux Mint, but there the Serial port isn't even showing up.
The errors above are from Windows 11. Since I'm also using ESP32s there are other drivers like ch343 installed.
I also know that the Board isn't broken since my brother can flash just fine with his PC.
I'm tried Platformio and the Arduino IDE.
Did you select the correct port? I suggest that you enable verbose output during upload and disable verbose output during compilation under file/preferences in the IDE and perform an upload; as requested above, post the results here (and please use code tags when posting that output).
Did you follow all the instructions that you could find like adding yourself to the dialout group and checking the results of lsusb and dmesg ?
And which operating system is he using?
Although programming a board sounds like a programming question, I've moved your topic to the section dedicated to to board detection and upload problems.
Hi, my brother is using Nobara-Linux which is a fork of Fedora made for gamers.
Here's the output of dmesg:
[ 9.081576] IPv6: ADDRCONF(NETDEV_CHANGE): wlo1: link becomes ready
[ 11.547606] audit: type=1400 audit(1718431219.640:26): apparmor="DENIED" operation="capable" profile="/usr/sbin/cups-browsed" pid=1164 comm="cups-browsed" capability=23 capname="sys_nice"
[ 17.404625] usb 1-2: new full-speed USB device number 4 using xhci_hcd
[ 17.554107] usb 1-2: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.54
[ 17.554113] usb 1-2: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 17.554116] usb 1-2: Product: USB2.0-Serial
[ 17.571104] usbcore: registered new interface driver usbserial_generic
[ 17.571119] usbserial: USB Serial support registered for generic
[ 17.574064] usbcore: registered new interface driver ch341
[ 17.574083] usbserial: USB Serial support registered for ch341-uart
[ 17.574100] ch341 1-2:1.0: ch341-uart converter detected
[ 17.574591] usb 1-2: ch341-uart converter now attached to ttyUSB0
[ 17.589078] input: PC Speaker as /devices/platform/pcspkr/input/input19
[ 18.113325] input: BRLTTY 6.4 Linux Screen Driver Keyboard as /devices/virtual/input/input20
[ 18.115462] usb 1-2: usbfs: interface 0 claimed by ch341 while 'brltty' sets config #1
[ 18.116186] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
[ 18.116221] ch341 1-2:1.0: device disconnected
[ 23.115112] usb 1-2: usbfs: USBDEVFS_CONTROL failed cmd brltty rqt 192 rq 149 len 2 ret -71
[ 28.117613] usb 1-2: usbfs: USBDEVFS_CONTROL failed cmd brltty rqt 128 rq 6 len 255 ret -71
[ 28.119802] usb 1-2: usbfs: USBDEVFS_CONTROL failed cmd brltty rqt 192 rq 149 len 2 ret -71
[ 33.118271] usb 1-2: usbfs: USBDEVFS_CONTROL failed cmd brltty rqt 128 rq 6 len 255 ret -71
[ 33.120462] usb 1-2: usbfs: USBDEVFS_CONTROL failed cmd brltty rqt 192 rq 149 len 2 ret -71
[ 38.117839] usb 1-2: usbfs: USBDEVFS_CONTROL failed cmd brltty rqt 128 rq 6 len 255 ret -71
[ 38.120161] usb 1-2: usbfs: USBDEVFS_CONTROL failed cmd brltty rqt 192 rq 149 len 2 ret -71
[ 43.114905] usb 1-2: usbfs: USBDEVFS_CONTROL failed cmd brltty rqt 192 rq 95 len 2 ret -71
[ 48.115030] usb 1-2: usbfs: USBDEVFS_CONTROL failed cmd brltty rqt 128 rq 6 len 255 ret -71
[ 53.115278] usb 1-2: usbfs: USBDEVFS_CONTROL failed cmd brltty rqt 128 rq 6 len 255 ret -71
Mean while lsusb shows:
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 0408:5365 Quanta Computer, Inc. HP TrueVision HD Camera
Bus 001 Device 004: ID 1a86:7523 QinHeng Electronics CH340 serial converter
Bus 001 Device 003: ID 0bda:b00e Realtek Semiconductor Corp. Bluetooth Radio
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
The Flashing in verbose mode shows:
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/silas/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
User configuration file is "/home/silas/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyS4
Using Programmer : wiring
Overriding Baud Rate : 115200
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude done. Thank you.
Failed uploading: uploading error: exit status 1
In the Arduino IDE I use /dev/ttyS4, but in dmesg it says that the uart bridge is connected to /dev/ttyUSB0/ but this one isn't showing up in the IDE.
BRLTTY is a program that interfaces the Linux console with a refreshable braille display to provide accessibility for those with vision impairments. Unfortunately this program does not play nicely with other USB to serial devices like the CH340 chip on your Arduino board.
It seems there are several possible solutions to this, some of which are fairly complex. The most simple seems to be to simply uninstall BRLTTY, as described in this Adafruit tutorial:
Obviously this solution will be unacceptable if you use a braille display. Some other solutions are described here which should resolve the conflict between BRLTTY and your Arduino board without the loss of support for braille displays: