[U-Boot-Users] Safe firmware updates

Ian Ridge ian.ridge at apdcomms.com
Fri Feb 17 13:19:17 CET 2006


Thanks for your comments


>In message
<9D8FC3304AA0924E9CD0A211DFEDCBAB0164D7AF at bespin.apdcomms.co.uk> >you
wrote:
>> 
>> We are implementing facility for automatic firmware upgrades (either
the
>> Linux uImage or cramfs) on our embedded device. However there is a
.> requirement that the device is not broken by (the user for example)
>> disconnecting the power supply at any stage during the flash update.

>This is not new. It's actually a astandrard requirement.

>> In the absence of a backup battery, I guess the boot loader would
have
>> to be modified to cope with this. Has anybody produced a solution
>> already?

>There is no need to change anything. U-Boot is perfectly  capable  of
>supporting such requirements.


That's great news, but how?

>> 4) 'update' routine checks specified flash location for new upgrade
>> image with valid CRC. If no image found or has bad CRC it returns,
>> control passes to next command in bootcmd, and Linux boots normally.
>> 
>> 5) 'update' routine erases target area of flash, and then copies
content
>> of upgrade image to target location.

>Why would you do that if the new image is already in flash? 

I considered of doing it like this because we have limited flash space
and need to re-use a flash partition normally usually for logging data.
We haven't got enough space to store 2 copies of the uImage, and 2
copies of the cramfs file system. We could automatically change the
mtdparts parameter in bootargs after each update to reflect this, but
this would mean a change to u-boot and its getting too complicated
again.

>Just swap
>boot addresses...

I understand I could put a second bootm command in bootargs to
automatically switch boot address, but how would I swap cramfs file
systems in a safe way? The flash partition used for the cramfs is
currently specified using 'root=/dev/mtdblock2' in bootargs, but I don't
see how to make u-boot change this to say 'root=/dev/mtdblock3
automatically'.
 
DISCLAIMER: 
 
The information contained in this message is for the intended addressee only  
and may contain confidential and/or privileged information. If you are not the  
intended addressee, please delete this message and notify the sender; do not  
copy or distribute this message or disclose its contents to anyone. This email  
has been scanned by our Anti Virus software before leaving the premises. APD  
Communications takes no responsibility for any damage or loss caused by any  
undetected virus being inadvertently transmitted with this message.




More information about the U-Boot mailing list