Olimex Support Forum

Microcontrollers => AVR => Topic started by: xi on June 24, 2016, 04:44:53 PM

Title: Olimex AVR ISP MKII error in USB receive
Post by: xi on June 24, 2016, 04:44:53 PM
Hello,

I know this is a common problem: avrdude 6.x doesn't work with Olimex AVR ISP MKII, so I am doing this post for giving a few more informations for those who are still stuck with this issue.

Writing |                                                    | 0% 0.00savrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_send(): wrote -5 out of 1 bytes, err = Input/output error
avrdude: stk500_send_mk2(): failed to send command to serial port
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: stk500v2_recv_mk2: error in USB receive

*Question for Olimex: my AVR-ISP-MK2 from Olimex worked on windows with stk500.exe software before this firmware upgrade. Will it still work after the upgrade? (I can't verify currently, but I would prefer that my colleague can still use it on windows ::))
Title: Re: Olimex AVR ISP MKII error in USB receive
Post by: xi on June 24, 2016, 06:21:14 PM
In addition to what I wrote: to access the programmer as a non-root user, you have to add udev rules ... and the procedure given in the user's manual are unlikely to work on a "normal" recent Linux system (Mageia 5 for me, most likely the same for Fedora and RedHat).

So, to get the udev rules working:
- as root, create a file named /etc/udev/rules.d/avrisp.rules

- put the following into the file:
SUBSYSTEM!="usb", ACTION!="add", GOTO="avrisp_end"

# Atmel Corp. JTAG ICE mkII
ATTR{idVendor}=="03eb", ATTR{idProduct}=="2103", MODE="0666", GROUP="dialout"
# Atmel Corp. AVRISP mkII
ATTR{idVendor}=="03eb", ATTR{idProduct}=="2104", MODE="0666", GROUP="dialout"
# Atmel Corp. Dragon
ATTR{idVendor}=="03eb", ATTR{idProduct}=="2107", MODE="0666", GROUP="dialout"

LABEL="avrisp_end"

(note the differences with the ubuntu version : ATTR must be used everywhere, and MODE value allow any user to use the programmer. If you want to be more subtle, you can let MODE="660" and add the user(s) that need to access the programmer to the group "dialout" ...)

- Still as root, you have to reload the rules, and AFAIK, udev is no more a service but is integrated into systemd, so restarting the "udev" service wont work, you have to use udevadm command:
udevadm control --reload-rules
udevadm trigger

- Then your programmer should work as a non root user :)
Title: Re: Olimex AVR ISP MKII error in USB receive
Post by: LubOlimex on June 27, 2016, 02:47:07 PM
Thank you for the great post and the detailed guide! I will point Linux users to it for sure!

Salut,
Lub/OLIMEX