Ubuntu – How to know the USB port

command linedebuggingusb

I'm working on a project with an ATmega1280 (Atmel) board. I want to take a look at the stack, so I'm trying to do an OCD (On Chip Debugging).
In the tutorial it says:

Use this AVRDUDE command to program the fuses on the ATMega1280 to enable OCD and JTAG:

avrdude -P <port> -c <programmer> -p m1280 -U hfuse:w:0x1a:m -v

Replace port with the port to which your programmer is connected, and programmer with the programmer type.

At this point, my question is: How can I find out the port of the USB in Kubuntu?

Best Answer

  • I usually list the files in /dev, plug in the device, list the files in /dev again, and look to see which special file appeared. You could also redirect the output of each listing to two different files and use diff to show you which special file appeared when you plugged in the device:

    ls /dev > notplugged
    # plug in device
    ls /dev > plugged
    diff notplugged plugged
    

    Once you know what file corresponds to the device (it's usually something like /dev/ttyUSB0), you just use that file in place of <port>.

    Edit: Apparently dmesg can tell you which device file corresponds to your device. Run dmesg | grep tty after plugging in your device. The device file should be apparent in one of the lines.

  • Related Question