Today I bought my first Arduino development board (Mega 2560 rev3).
Since I'm a newbie to the Arduino world I would like to request help on how I can restore/burn the Arduino factory bootloader?
I would like to do this using AVR Studio IDE + AVRISP MKII if possible.
I have tried, with Arduino IDE 1.0.2, to "burn the bootloader" but I'm always getting the following error message:
avrdude: usbdev_open(): did not find any USB device "usb"
I'm using Windows 7 where I have AVR Studio 6 IDE and Arduino IDE 1.0.2 installed and I also have an AVRISP MKII programmer.
Can anyone help me on this matter?
Iirc, avrisp mk II needs different firmware, or different drivers, depending on whether you use it with avrdude (arduino), or the Atmel tools. Check avr freaks.net...
MKii driver has been discussed here.
Is located in the arduino files.
Search for "Jungo" for threads on how install the libusb for arduino in place of default jungo driver.
Thanks for the tips.
It seems that the error that I get when using the Arduino IDE is driver related.
The Arduino MKII drivers and the Jungo drivers are incompatible. I have tested in my friend laptop using only the Arduino tools and it worked fine.
Since I need to have the AVR Studio IDE, is it possible to burn the Arduino bootloader using this IDE?
If yes, how can I do it?
You may have to remove/uninstall the Jungo driver & install the MKii driver so they don't conflict.
I load 328 & 1284 boards with mine using the IDE.
I burn a bootloader first to set the fuses, and then use File:Upload Using Programmer to load the sketch and leave out the bootloader when I want sketches to start immediately after a reset.
Yes, that is one option and it must work. Since I need to have the AVR Studio installed and its related drivers, is it possible to burn the Arduino bootloader using the AVR Studio? If yes, how can I do it?
I'm trying to fire up my version of AVR Studio5.1 to check - it doesn't seem to want to recognize my MKii since I changed the drivers for it to work with the IDE. Downloading 6.0 to see if that fixes it.
Sounds about right tho. Fuses look to agree with the settings in boards.txt:
mega2560.name=Arduino Mega 2560 or Mega ADK
mega2560.upload.protocol=wiring
mega2560.upload.maximum_size=258048
mega2560.upload.speed=115200
mega2560.bootloader.low_fuses=0xFF
mega2560.bootloader.high_fuses=0xD8
mega2560.bootloader.extended_fuses=0xFD
mega2560.bootloader.path=stk500v2
mega2560.bootloader.file=stk500boot_v2_mega2560.hex
mega2560.bootloader.unlock_bits=0x3F
mega2560.bootloader.lock_bits=0x0F
mega2560.build.mcu=atmega2560
mega2560.build.f_cpu=16000000L
mega2560.build.core=arduino
mega2560.build.variant=mega
That's why I do this in the IDE:
Burn the bootloader, which sets the fuses
Download the sketch via File: Upload Using Programmer, wipes out the bootloader, leaves the fuses, and the sketch starts immediately after a reset.
Need the LibUSB-Win32 Devices driver for AVRISPmkII to show up in Device Manager for the MKii to work in the IDE.
I stopped using AVR Studio because it takes too long to start up, and I don't need that strong of an environment for the kind of programming I do.
Some versions of the AVRISPmkII programmer can be made to work under both libusb and Atmel Jungo. All you need is to install the libUSB-Filter utility. Then run the Filter Wizard and add AVRISPmkII to it.
Again it only works with some versions of AVRISPmkII. I have this working with the Atmel AVRISPmkII programmer and also some other clone versions.