Score:0

Can't find the USB port that USBasp programer is using in Ubuntu 22.04

de flag

I'm trying to set up everything to make some projects using Atmega microcontroller. The problem starts when I'm trying to flash compiled program to microcontroller because I need to specify port on which my USBasp is connected. The command goes like this, for example.

avrdude -c usbasp -p m32 -P /dev/ttyUSB0 -b 19200 -U flash:w:led.hex

This -P parameter which is port should look something like this /dev/ttyUSB0, but there is nothing like that in the /dev directory.

enter image description here

What is even worse is that when I plug in or unplug my USBasp programmer nothing at all changes when I list everything in /dev using ls command. If I unplug my mouse for example and plug it in again every time ls command reacts to changes, but nothing at all with my USBasp programmer.

enter image description here

I don't think that its broken coz other commands do recognize it for example lsusb

enter image description here

I have tried everything Google throws at me, but I just cant seem to find this port to specify when writing data using programmer. I'm using Ubuntu 22.04.

When I run sudo journalctl --follow device is getting recognized and I'm getting this information, but it doesn't do anything good because it doesn't give me this path /dev/ttyUSB* or something similar.

enter image description here

When I run ls -1 /dev >dev.before and ls -1 /dev >dev.after there were absolutely 0 difference between those files.

When I'm running this command udevadm monitor --property and adding programmer I'm getting this text that repeats itself with little differences 3 times.

UDEV  [1624.578178] add       
/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0 (usb) ACTION=add  
DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0  
SUBSYSTEM=usb DEVTYPE=usb_interface PRODUCT=16c0/5dc/102 TYPE=255/0/0  
INTERFACE=0/0/0  
MODALIAS=usb:v16C0p05DCd0102dcFFdsc00dp00ic00isc00ip00in00 SEQNUM=3937  
USEC_INITIALIZED=1624577910 ID_USB_CLASS_FROM_DATABASE=Vendor Specific  
Class ID_VENDOR_FROM_DATABASE=Van Ooijen Technische Informatica  
ID_MODEL_FROM_DATABASE=shared ID for use with libusb  
ID_PATH=pci-0000:00:14.0-usb-0:2:1.0  
ID_PATH_TAG=pci-0000_00_14_0-usb-0_2_1_0  
  
UDEV  [1624.585799] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-2  
(usb) ACTION=bind DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-2  
SUBSYSTEM=usb DEVNAME=/dev/bus/usb/001/021 DEVTYPE=usb_device  
DRIVER=usb PRODUCT=16c0/5dc/102 TYPE=255/0/0 BUSNUM=001 DEVNUM=021  
SEQNUM=3938 USEC_INITIALIZED=1624574304 ID_VENDOR=www.fischl.de  
ID_VENDOR_ENC=www.fischl.de ID_VENDOR_ID=16c0 ID_MODEL=USBasp  
ID_MODEL_ENC=USBasp ID_MODEL_ID=05dc ID_REVISION=0102  
ID_SERIAL=www.fischl.de_USBasp ID_BUS=usb ID_VENDOR_FROM_DATABASE=Van  
Ooijen Technische Informatica ID_MODEL_FROM_DATABASE=shared ID for use  
with libusb ID_PATH=pci-0000:00:14.0-usb-0:2  
ID_PATH_TAG=pci-0000_00_14_0-usb-0_2  
ID_FOR_SEAT=usb-pci-0000_00_14_0-usb-0_2 MAJOR=189 MINOR=20  
TAGS=:uaccess:seat: CURRENT_TAGS=:seat:

I was hoping that DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0 this could be the "port", but there is no such a thing as , /devices directory.

I used avrdude -P usb to specify port and it worked. I'm glad it does, but still would be interesting to know why I couldn't find the port path for this controller. I found the answer in this question.

sleepyhead avatar
in flag
ttyACM and ttyS are common devices to try, I would also look at the first to see if te kernel found a tty
waltinator avatar
it flag
You can find the device name by watching `sudo journalctl --follow` as you connect your device. OR `ls -1 /dev >dev.before`, connect the device, wait 10 seconds, `ls -1 /dev >dev.after;diff dev.{before,after}`. Then, look at the system logs `sudo journalctl /dev/devicename`.
abu-ahmed al-khatiri avatar
in flag
can you check udev rules of atmega8 using this command `udevadm monitor --property`? if it is not there, you need to create new udev rules. check this https://www.fischl.de/usbasp/ .
etrusks avatar
de flag
Ty guys, ill check everything when ill get to work
etrusks avatar
de flag
i edited my question guys
meuh avatar
cn flag
You should move your last edit into an answer, and then accept it. As the link you added says, this device isn't a fully compliant serial port, so the kernel cannot create a `/dev/ttyACM0` or similar, as it wouldn't work properly.
Score:0
de flag

I used avrdude -P usb to specify port and it worked. I found the answer in this question.

Here is the screenshot of original answer

enter image description here

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.