Burn bootloader programmes fuse but not flash with AVRISPmkII and Arduino 1.5.6

Hi,

I am using Arduino 1.5.6-r2 BETA and trying to burn bootloader from Arduino IDE on my Arduino UNO.
There seems to be 2 avrdude commands executed consecutively, one is to erase device, unlock boot section, program fuse and the next one is for programming the flash and lock the bootsection.
The first one is successful and the second fails with error message that "avrdude: usbdev_open(): did not find any USB device "usb""

This sequence is mentioned the platforms.txt, I tried changing the tools.avrdude.erase.pattern in this file to include the flash programming as well and could confirm that flash programming itself works and the issue is to do with sending 2 avrdude commands consecutively.

What could be the reason? Is there some configuration that should be changed to have the usb connection successful for consecutive commands?

Best Regards,
NNS

I seem to recall that problem analysis mention on the forum in the past, but for the life of me I can't think of the solution or what to search on. If you have another arduino board laying around you might consider loading it with the arduinoiSP sketch and wiring it to your target board and see if it suffers the same or not.

I ran into this same issue from last year since IDE 1.5.2.

http://forum.arduino.cc/index.php?topic=171000.0

It is still an issue with the current IDE 1.5.7. However, I have been successfully burning bootloader with the AVRISPmkII by using avrdude-6.1. It appears they have changed or fixed this back-to-back timing issue with the latest avrdude version.

Check out the Windows binary http://download.savannah.gnu.org/releases/avrdude/avrdude-6.1-mingw32.zip or source code http://download.savannah.gnu.org/releases/avrdude/avrdude-6.1.tar.gz.