Arduino with Debian

Hi everyone
I have Arduino clone ELEGOO UNO R3 and it has Atmega16U2 programmer with Atmega328p 28 Dip chip. I have an issue using Arduino under Debian Linux. I haven't tried under win or mac either.

/home/petty/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/home/petty/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -pm328p -carduino -P/dev/ttyACM0 -b115200 -D -Uflash:w:/tmp/arduino_build_808690/Blink.ino.hex:i
......
......
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00

I tried with different baud rates -b19200 and -b57600 and
-carduinoisp -carduinoisp -carduinoisporg -cavrisp -cavrisp2

avrdude: Error: Invalid -P value: '/dev/ttyACM0'
         Use -P usb:bus:device

avrdude done.  Thank you.
Bus 001 Device 007: ID 2341:0043 Arduino SA Uno R3 (CDC ACM)

how do we use -Pusb:001:007

avrdude: Error: Could not find USBtiny device (0x2341/0x49)

avrdude done.  Thank you.

Looks like you're trying to upload using programmer which is via the ICSP header (the 6 pin header at the side of the board, not the one next to the USB).

Why? I guess the confusion comes from the below

That's not a programmer, it's the TTL-to-USB converter.

For a normal upload via USB to an Uno, the command should look like below; this is for a windows system, you'll have to translate for linux.

"C:\Users\yourUsername\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\yourUsername\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v  -patmega328p -carduino "-PCOM37" -b115200 -D "-Uflash:w:C:\Users\yourUsername\AppData\Local\Temp\arduino-sketch-D31A7FD5D7575C0758DA028A5C8DABA7/double2float.0.3.ino.hex:i"

The relevant part: -patmega328p -carduino "-PCOM37" -b115200

2 Likes

If I try to use those parameters I still get these errors

[code]
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00

[/code]
Is it possible to check Atmega16U2 TTL-to-USB converter If it works?

Yes, use the loopback test descibed in this section of the forum.

1 Like

Did you configure your user permissions as directed in the Linux installation instructions?

Arduino IDE 1 Installation (Linux) | Arduino Documentation | Arduino Documentation

1 Like

The same issue under Windows 7. But I get some numbers in Arduino if I get “Tools > Get Board Info" and also com15 available.
BN: Arduino Uno
VID: 2341
PID: 0043
SN: 7573532......

C:\Users\Petty\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\Petty\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf -v -patmega328p -carduino -PCOM15 -b115200 -D -Uflash:w:C:\Users\Petty\AppData\Local\Temp\arduino_build_496849/Blink.ino.hex:i 

         Using Port                    : COM15
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x57
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x57
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x57
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x57
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x57

I installed under Debian 11 like this

$ sudo tar xvJf arduino-1.8.19-linux64.tar.xz -C /opt
$ sudo -E /opt/arduino-1.8.19/install.sh
....
...
..


$ ./arduino-linux-setup.sh petty

******* Add User to dialout,tty, uucp, plugdev groups *******

groupadd: group 'plugdev' already exists
groupadd: group 'dialout' already exists

******* Removing modem manager *******

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libjim0.79 libmbim-glib4 libmbim-proxy libqmi-glib5 libqmi-proxy usb-modeswitch
  usb-modeswitch-data
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  modemmanager
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 4,598 kB disk space will be freed.
(Reading database ... 293285 files and directories currently installed.)
Removing modemmanager (1.14.12-0.2) ...
Created symlink /run/systemd/system/ModemManager.service → /dev/null.
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for dbus (1.12.20-2) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...

Restarting udev


*********** Please Reboot your system ************
petty@Petty:~$ ls /etc/udev/rules.d/ -la
total 32
drwxr-xr-x 2 root root 4096 Oct 20 15:09 .
drwxr-xr-x 4 root root 4096 Oct 20 13:09 ..
-rw-r--r-- 1 petty petty  293 Oct 20 15:07 40-dfuse.rules
-rw-r--r-- 1 root root  305 Oct 20 15:09 60-objdev.rules
-rw-r--r-- 1 petty petty  170 Oct 20 15:07 90-extraacl.rules
-rw-r--r-- 1 petty petty  327 Oct 20 15:07 98-openocd.rules
-rw-r--r-- 1 petty petty  275 Oct 20 15:07 99-arduino-101.rules
-rw-r--r-- 1 petty petty  416 Oct 20 15:07 avrisp.rules
petty@Petty:~$ cat /etc/udev/rules.d/60-objdev.rules 
SUBSYSTEM!="usb_device", ACTION!="add", GOTO="objdev_rules_end"
# USBasp
#SYSFS{idVendor}=="16c0", SYSFS{idProduct}=="05dc", GROUP="users", MODE="666"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05dc", MODE="0666", SYMLINK+="USBasp"
LABEL="objdev_rules_end"

petty@Petty:~$ cat /etc/udev/rules.d/99-arduino-101.rules 

# Arduino 101 in DFU Mode

SUBSYSTEM=="tty", ENV{ID_REVISION}=="8087", ENV{ID_MODEL_ID}=="0ab6", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_CANDIDATE}="0"
SUBSYSTEM=="usb", ATTR{idVendor}=="8087", ATTR{idProduct}=="0aba", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1"
petty@Petty:~$ cat /etc/udev/rules.d/98-openocd.rules 

# Adding Arduino M0/M0 Pro, Primo UDEV Rules for CMSIS-DAP port

ACTION!="add|change", GOTO="openocd_rules_end"
SUBSYSTEM!="usb|tty|hidraw", GOTO="openocd_rules_end"

#Please keep this list sorted by VID:PID

#CMSIS-DAP compatible adapters
ATTRS{product}=="*CMSIS-DAP*", MODE="664", GROUP="plugdev"

LABEL="openocd_rules_end"
petty@Petty:~$ cat /etc/udev/rules.d/90-extraacl.rules 

# Setting serial port rules

KERNEL=="ttyUSB[0-9]*", TAG+="udev-acl", TAG+="uaccess", OWNER="petty"
KERNEL=="ttyACM[0-9]*", TAG+="udev-acl", TAG+="uaccess", OWNER="petty"

I used the install.sh from Linux Mint GUI rather than the console which should not matter but I have completed this numerous times on multiple hardware. I did not have to install using sudo.

Maybe retrace your steps from this guide:
How to Install Arduino IDE on Debian 10 - VITUX

1 Like

But the problem is also under W7 and it looks like the board is visible there. It is something with the bootloader or HW.
I would try loop-back test as sterretje wrote.

1 Like

I do not have an ELEGOO but since it has a 16U2, That chip is the USB interface for the board. This means, when you jack the USB into your PC, a Windows driver is invoked via the plug&play Windows interface. The driver then provides the necessary software connection to mimic a Com port... said Com port if correctly enumerated will appear in your Device Manager utility.
Microsoft also provides other utilities: USBview being one:
Universal Serial Bus Viewer in Windows - Windows drivers | Microsoft Learn

Discussed further here:

See section Common Issues

Are you really certain you are selecting the correct Board & submenu in the IDE?

1 Like

Everything works under Debian just like this Loop-Back Test Instructions

$ lsusb
Bus 001 Device 004: ID 2341:0043 Arduino SA Uno R3 (CDC ACM)


same thing with windows 7 also drivers are all loaded properly. But same error

[code]
System wide configuration file is "C:\Users\Petty\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

     Using Port                    : COM15
     Using Programmer              : arduino
     Overriding Baud Rate          : 115200

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x6d
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x6d

[/code]At the end I took off all the connection jumpers as usual. Reset-GND, TX-RX
I just tried with the Original Arduino Uno from the old project everything works fine. I think there is something wrong with the drivers or Elegoo device.

Drivers should be the same. There is the same USB/serial - ATmega16U2. Its FW is the only thing it could be different. How it comes that it works with lnx? A cable or some another trivial thing?
Anyway, if it works under Debian so the next step could be the bootloader. Check it again with e.g. the blink sketch. Be sure your settings are correct.
If it will not work, you can replace the bootloader with Arduino as ISP. Use the original Arduino UNO. Or, you can interchange Atmega328P MCUs between them to see what happen.

1 Like

I mean Loop-Back Test works for the both operating systems Debian and Win. I going to try Arduino as an ISP and load a Bootloader. I think your statement is reasonable. I have a CH340g usb stick with 8 yellow female plugging. Could it be used as an ISP?


pins.

No. It is USB/serial transceiver. You need USBasp board or similar, or just use another Arduino. There is tutorial on this site.

1 Like

Yes, Thank you. it works now. https://docs.arduino.cc/built-in-examples/arduino-isp/ArduinoISP I did it as it here describes. One last question is it possible to flash bootloaders ft232 and ch340g chipsets?

Great!:+1:
I don’t understand. What is about USB/serial chips and the bootloader? There is no bootloader in FT232 and CH340.

1 Like

which chip did we flash during Arduino Elegoo for the bootloader? Atmega16U2 or Atmega328p. I thought ft232 and ch340g doing same thing as Atmega16U2 does.

the answer is

1 Like

and during serial interface the loopback test? My questions can be awful sorry about that.