Hi all, I have a mega 2560 I want to put the arduino bootloader back on to.
I have an AVRISP mkII (Olimex)
I have tried a couple different drivers with no luck, though I can read device signatures in Microchip Studio.
I did select the AVRISP mkII as the programmer, though the output says its looking for an STK500?
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\Upstage\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"
Using Port : usb
Using Programmer : stk500v2
avrdude: usbdev_open(): did not find any USB device "usb" (0x03eb:0x2104)
avrdude done. Thank you.
Failed chip erase: uploading error: exit status 1
Any help appreciated,
-Peter
Hi @check_1_2. This error is caused by using an "AVRISP mkII" driver that is not compatible with the "AVRDUDE" tool used by Arduino IDE for this operation. The incompatible "Jungo" driver is installed by Microchip Studio, setting you up for pain once you switch to using AVRDUDE.
My recommendation is to switch to using the "libusbK" driver.
You can do that easily with the "Zadig" driver installation tool:
- Connect the "AVRISP mkII" programmer to your computer with a USB cable.
- Download the "Zadig" driver installation tool from this website:
http://zadig.akeo.ie/
- Run the downloaded file to start "Zadig".
- Select "AVRISP mkII" from the drop-down menu in the "Zadig" window.
If it doesn't show up on the menu, then select Options > List all devices from the Zadig menus and check again.
- Click the ▴ button to the right of the "Driver" selection field until you see "libusbK".
- Click the "Replace Driver" button.
An "Installing Driver..." dialog will now appear.
- Wait for the driver installation process to finish.
- Click the "Close" button in the "Driver Installation" dialog.
- Close the "Zadig" window.
In case you for some reason want to continue using Microchip Studio in addition to AVRDUDE/Arduino IDE, you might be interested in the technique described here for the coexistence of both drivers:
https://www.avrfreaks.net/s/topic/a5C3l000000UWk8EAG/t139658?comment=P-1495916
This is normal and expected. The "AVRISP mkII" programmer definition is configured to use the stk500v2 protocol in the avrdude command generated by Arduino IDE:
https://github.com/arduino/ArduinoCore-avr/blob/1.8.6/programmers.txt#L11
avrispmkii.name=AVRISP mkII
avrispmkii.communication=usb
avrispmkii.protocol=stk500v2
The generated command works perfectly once you have the right driver installed, so the use of this protocol has nothing to do with the error you encountered.