Flashing wrong image into partition using DFU

Harald Welte laforge at openmoko.org
Sun Mar 4 02:54:26 CET 2007


[moving this to openmoko-uboot where it belongs]

On Sat, Mar 03, 2007 at 09:53:54PM -0300, Werner Almesberger wrote:
> > If somebody really permanently breaks his device and is without debug
> > board, he will have to send it in.  I think the probability of this
> > happening is really low.
> 
> dfu-util -a 1 -D uImage  is all it really takes ;-)

then let's add some safeguard against this.  Actually, I was originally
planning to use some additional per-file headers that would be sent
transparently to u-boot, which can then do some verification.  For
convenience, we could just use the uboot uImage header.  If it's the
bootloader or rootfs, we strip that header before flashing.  If it's the
kernel, we keep it.

DFU actually specifies something like this.  It also has error handling
for that case (i.e. we can report back that this file is not suitable
for the device).  This is also useful for u-boot revisions that don't
match the hardware revision (prevenging Bv2 uboot to be flashed to Bv3
device, etc).

> Selection by name would be safer, but I'm not sure how well this
> works. E.g., for me, -l never yields more this:
> Found Runtime: [0x1457:0x5119] devnum=7, cfg=0, intf=2, alt=0, name="USB Device Firmware Upgrade"

this is because you cannot list interfaces in DFU mode until you have
switched from Runtime to DFU.  Since that switching is intrusive, and a
number of DFU devices cannot switch back from DFU to Runtime easily
(like we can), there is no way of implementing this nicely.

However, matching partition names with some argument from the
commandline is not a problem at all, given that at that point we know
that we actually want to do up/download, i.e. more than just listing.

So I'm happy to accept a patch that allows altsetting-by-name.  Keep in
mind that this is completely optional in the standard, so we still have
to accept numbers.

-- 
- Harald Welte <laforge at openmoko.org>          	        http://openmoko.org/
============================================================================
Software for the world's first truly open Free Software mobile phone



More information about the openmoko-uboot mailing list