Arduino Forum

Forum 2005-2010 (read only) => Software => Bugs & Suggestions => Topic started by: glasspusher on Oct 18, 2007, 07:13 pm

Title: AVR Bootloader burn error in Arduino 9 and 10
Post by: glasspusher on Oct 18, 2007, 07:13 pm
Hi,I have an AVR ISPMKII USB dongle and when I try to burn my bootloader to my NG board with a 168 chip on it, I always get the following error:

avrdude: stk500v2_command(): command failed
avrdude: initialization failed, rc=-1
        Double check connections and try again, or use -F to override
        this check.


Any ideas? It clearly sees my dongle,just can't do anything with it. Lights do blink...

Any and all info, much appreciated.

Dave

Title: Re: AVR Bootloader burn error in Arduino 9 and 10
Post by: mellis on Oct 18, 2007, 07:37 pm
Can you use the AVRISP mkII to burn any other chips?  Those things seem to die surprisingly easily.
Title: Re: AVR Bootloader burn error in Arduino 9 and 10
Post by: glasspusher on Oct 18, 2007, 08:40 pm
Things are better- I didn't realize the board had to be powered as well as the mkII, so it burned the boot loader. However, I'm using a 168 with an old NG board, and it doesn't work after burning the new bootloader. I'm going to see if I can find an old bootloader to try on it...


Dave
Title: Re: AVR Bootloader burn error in Arduino 9 and 10
Post by: glasspusher on Oct 18, 2007, 08:41 pm
what things die easily? The mkII or the 168 chips? ;)
Title: Re: AVR Bootloader burn error in Arduino 9 and 10
Post by: glasspusher on Oct 18, 2007, 08:56 pm
Also, it took about 10 minutes to burn the boot loader. Maybe put in the avr messages as it's doing this, 10 minutes is a long time for an app to be unresponsive. I remember it taking this long from the command line when I did it last year, but it worked. It also seems to take about as long from the command line now.
Title: Re: AVR Bootloader burn error in Arduino 9 and 10
Post by: mellis on Oct 18, 2007, 09:22 pm
The mkII's seem to die relatively easily.  Did you have NG selected in the Boards menu when you burned the bootloader?  If you had Diecimila selected, you'll have the bootloader with a very short timeout, since it's intended for boards that auto-reset.  You should be able to burn the NG bootloader from the IDE.

And yea, there should probably be some sort of progress notification as you burn the bootloader.
Title: Re: AVR Bootloader burn error in Arduino 9 and 10
Post by: glasspusher on Oct 18, 2007, 10:08 pm
Hi Mellis,
Yeah, I tried burning the bootloader as the 168 on an NG board, but so far NG ;) It looks like my mkII is still working, the lights still do their thing and I don't get any error messages, but who knows?

I have 4 diecimila boards on order, they should should be here next week, so even if this doesn't work I won't be out of commision too long.

One other thing I've noticed in my 10 months or so away from this stuff- the sketches I had from version 7, when re-compiled with 8, 9 or 10 are much smaller and didn't work on the NG boards I had with Atmega8 chips. Any ideas?

Thanks!

Dave
Title: Re: AVR Bootloader burn error in Arduino 9 and 10
Post by: mellis on Oct 18, 2007, 11:15 pm
The smaller size is because of some optimizations we did in Arduino 0008.  Did you have the "Arduino NG or Older w/ ATmega8" board selected when you compiled and uploaded the sketches?
Title: Re: AVR Bootloader burn error in Arduino 9 and 10
Post by: DojoDave on Nov 04, 2007, 12:44 pm
Dave,

same problem here:

avrdude: stk500v2_command(): command failed
avrdude: initialization failed, rc=-1
        Double check connections and try again, or use -F to override
        this check.



Have tried for both mega8 and mega168 on Windows XP. I am gonna try with the good old command line and report back to the forum ;-)

/d
Title: Re: AVR Bootloader burn error in Arduino 9 and 10
Post by: mellis on Nov 04, 2007, 07:07 pm
Are you using an AVR ISP mkII also?  Let us know how the command line tests turn out.
Title: Re: AVR Bootloader burn error in Arduino 9 and 10
Post by: yerg2k on Nov 08, 2007, 04:17 pm
Hello,
I have yesterday received my AVRISP mkII and had troubles using the builtin arduino burn bootloader function which uses avrdude.

The error I'm getting is,
avrdude: usbdev_open(): did not find any USB device "usb"

I did however find this guide useful:
http://www.arduino.cc/playground/Learning/Burn168

This resulted in success burning my blank mega168 using an older arduino NG. Maybe being able to manually verify fuse bits and such, made it seem more likely to work.

Please note the following from the above link:
Quote
8. Click the "Board" panel, set and write the ISP frequency. If this is a virgin chip you must select 125.0 kHz. If you have already flashed this chip you can set it to 2.0 Mhz without issues. It will be a long day of programming if you don't take this step, as burning at 1.049 Khz takes forever.


This explains why some such as glasspusher experienced extremely long burntimes. Appropriately setting this frequency sped things up quite a bit.

GL
Title: Re: AVR Bootloader burn error in Arduino 9 and 10
Post by: mellis on Nov 08, 2007, 06:34 pm
yerg2k: what operating system are you using?
Title: Re: AVR Bootloader burn error in Arduino 9 and 10
Post by: leKuk on Nov 18, 2007, 09:04 pm
just wanted to throw in that i'm successfully burning bootloaders to atmega168s using an mkII + an arduinoNG on an Intel Macbook running 10.4.9
thank you very much for this feature. if it does not work for anyone and you're sure that your mkii is not dead, check those 3 things mentioned before:

- arduino has to get power from an external source (wall plug)
- set the power source jumper on your arduino accordingly
- plug-in the ICSP-cable correctly.

if the programmers shows the green light (instead of red or orange or blinking or something ) the hardware part should be fine. Start the arduino application _now_ and begin burning your bootloader (or sketch soon :-).

the arduino app seemed frozen when i did it the first times, not telling me something new for a couple of minutes, just a "burning bootloader". the process takes something like 5-10 minutes on this machine, but it works. After some lightshow, the programmer shows the green light again, and arduino tells me "Done burning bootloader". No other messages in between, which you just have to know.



Title: Re: AVR Bootloader burn error in Arduino 9 and 10
Post by: mellis on Nov 19, 2007, 03:04 am
If it's that slow, you might want to speed it up with AVR studio under windows.  I don't remember what the setting is called - some type of clock or timing parameter that seems to be set somewhat randomly by default.
Title: Re: AVR Bootloader burn error in Arduino 9 and 10
Post by: leKuk on Nov 19, 2007, 05:16 am
well i did burn my first bootloaders under AVR Studio and it was _much_ faster. is there any way to speed it up from within arduino? or do you recommend using AVR studio? i don't really mind the ten minutes for the handful burns that i do.

ps:

how does the board-selection in version 0010 work? i can't get the Diecimila bootloader burned on an atmega168 (inside an arduinoNG). burning completes successfully, but the chip is useless. it just continously blink on pin13. if i select the ArduinoNG as a board and bootloader everything works fine. just with the old bootloader, which doesn't timeout on invalid data, or does it?
with version 0009 i had no problems burning each with the same hardware setup!?

//kuk
Title: Re: AVR Bootloader burn error in Arduino 9 and 10
Post by: mellis on Nov 19, 2007, 05:51 am
Hmm, I think there's a way to change a setting on the AVRISP itself from within AVR Studio in a way that it persists when you use avrdude too.  

The NG bootloader that comes with Arduino 0010 also times out on invalid data; if you've got an NG, you want the NG bootloader.  They only difference between it and the Diecimila one is the number of blinks on startup (3 instead of 1) and a longer timeout.  That continuous blinking is actually the Diecimila repeatedly timing out, restarting, and flashing the LED once on startup.