I've observed something very interesting.
I've breadboarded an AT90USB1286 that has factory loaded Atmel DFU
bootloader. If I plug it to USB while holding the HWB button then
instead of booting to DFU mode it runs the actual firmware that has
been loaded through DFU beforehand.
I've also made a PCB centered around an ATmega8U2 to which I've loaded
the LUFA DFU bootloader through ISP and the VirtualSerial demo through
DFU. Now, if I hold down HWB and power it up through USB then it
boots into DFU mode.
I personally like the LUFA way better. Can you confirm this difference?
Thanks!
--
László Monda <http://monda.hu>
Let me correct you here Dean, I think this should happen on reset, not
on power on.
> which isn't quite the same thing; the
> behaviour is a difference between the Atmel and LUFA DFU bootloader in
> regards to the HWB condition. The Atmel code will have something akin
> to:
>
> if (!(MCUSR & (1 << PORF)))
> Run_Application();
>
> Which aborts the bootloader if it was a power on reset source. Other
> possibilities would be to only run in response to an external reset or
> to abort if the reset source was from the JTAG.
I wonder whether the DFU specifcation defines the expected behaviour
regarding the HWB condition.
There's a relevant issue: I didn't touch the fuses, yet the LUFA DFU
bootloader gets activated automatically upon reset. I guess it
shouldn't happen when BOOTRST is unprogrammed.
I stand corrected. It's definitely not a major issue.
>> I wonder whether the DFU specifcation defines the expected behaviour
>> regarding the HWB condition.
>
> I doubt it - HWB is an Atmel invention, and not part of an official
> USB standard IIRC.
Ah, so it's a de-facto thing. Ok then.
What about the last issue that I've mentionied? (Let me quote that again.)
> For more options, visit this group at http://groups.google.com/group/lufa-support?hl=en.
Yes, exactly.
> This isn't happening for me on my
> USBKEY, but it may be an issue on other boards depending on what's
> connected to the HWB line. If you're referring to the bootloader being
> activated while manually pulling down the HWB line on poweron, you can
> use the code I posted earlier to abort if the bootloader starts
> without an external physical reset.
Thanks for the advice! I'll look into this issue whether it happens
with the next version of my board.
> For more options, visit this group at http://groups.google.com/group/lufa-support?hl=en.