Maker Pro
Maker Pro

avrdude: ser_open(): can't set attributes for device "/dev/ttyS0": Inappropriate ioctl for device a

I have a avr isp programmer which I wish to program to Atmega16 microprocessor. I have avrdude installed in my linux device and following a tutorial I have used the command

avrdude -c avrisp -p m16

and I got this error message.

avrdude: ser_open(): can't set attributes for device "/dev/ttyS0": Inappropriate ioctl for device

avrdude done. Thank you.


how do I get over this problem.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
I have no experience with this, but maybe I can point you at some things to try.

Have you tried starting avrdude using sudo? There is a chance you don't have access to the device. If sudo makes it work, then you can either continue to use that (somewhat dangerous) or you can modify the access to the device.

If that doesn't work:

You first need to determine if the device is identified as /dev/ttyS0 (or connected to the device identified as /dev/ttyS0).

Is it a USB device? If so, do an

ls -l /dev/tty*

before and after you insert the device. The difference will be the device that is created when the USB interface is identified.

If nothing appears, it is possible that the device does not get identified as a serial device. You can look at the entire /dev directory before and after (redirecting it to a file and using diff to show the difference is a good idea as the /dev directory is large) plugging it in.

If this doesn't work, you might have to do a

tail -f /var/log/syslog
In my case I see:

Jun 14 09:25:33 clovernet kernel: [3174067.732017] usb 3-1: new low speed USB device using uhci_hcd and address 2
Jun 14 09:25:33 clovernet kernel: [3174067.904020] usb 3-1: New USB device found, idVendor=16c0, idProduct=05dc
Jun 14 09:25:33 clovernet kernel: [3174067.904026] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Jun 14 09:25:33 clovernet kernel: [3174067.904030] usb 3-1: Product: USBasp
Jun 14 09:25:33 clovernet kernel: [3174067.904034] usb 3-1: Manufacturer: www.fischl.de
Jun 14 09:25:33 clovernet kernel: [3174067.904181] usb 3-1: configuration #1 chosen from 1 choice

so I know it's being identified (the same messages appear in kern.log and messages, both of which may have less noise in a busy system.

An lsUSB both before and after insertion shows that whilst it's being connected to bus 3 device 1, it becomes bus 3 device 4. (yours will differ)

An lsusb -v -s 3:4 gives you detailed information

I'm going to stop here because I'm talking about a USBasp device, and you're talking about an avrisp, and they're different.

This page has more information: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=printview&t=83748

I'm sure I have an avrisp device somewhere... I never use it any more because I find the USBasp is simply more convenient.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
This might also be worth a read. And this has a full list of detailed instructions that you may already have (at least partially) performed to get as far as you have.
 
Top