<HTML>
<HEAD>
<TITLE>Mtd_debug patch</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>The attached patch to the current version of mtd_debug (grabbed on5/28/2010) adds two new capabilities:<BR>
<BR>
</SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'>usage: mtd_debug info <device><BR>
mtd_debug read <device> <offset> <len> <dest-filename><BR>
mtd_debug write <device> <offset> <len> <source-filename><BR>
<FONT COLOR="#0000FF"> mtd_debug verify <device> <offset> <cmp-filename><BR>
</FONT> mtd_debug erase <device> <offset> <len><BR>
<FONT COLOR="#0000FF"> mtd_debug blank <device> <offset> <len><BR>
</FONT></SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
mtd_debug blank ... checks that an area of flash memory if blank (all 0xFFs) ie it verifies that an erase succeeded.<BR>
mtd_debug verify ... checks that the contents of the flash memory match the specified file. Ie it verifies that a write succeeded.<BR>
<BR>
These functions allow things like:<BR>
<BR>
</SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'>#!/bin/sh<BR>
<BR>
mtd_debug erase /dev/mtd1 0 0x200000<BR>
mtd_debug write /dev/mtd1 0 0x150000 uImage<BR>
if ( mtd_debug verifiy /dev/mtd1 0 uImage ) ; then<BR>
reboot<BR>
else<BR>
# Better try again, or we will die<BR>
fi<BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
<BR>
<BR>
Both have been tested on NOR and NAND flash, and are just simple modifications to the existing file_from_flash() function.<BR>
<BR>
Steve<BR>
-- <BR>
<B>Stephen Beaver </B>| <FONT COLOR="#003F7F"><B>ANXeBusiness</B></FONT> | Engineering |219 232-8371<B> </B>| www.anx.com | <a href="beavers@anx.com">beavers@anx.com</a><BR>
</SPAN></FONT><FONT COLOR="#007D00"><FONT SIZE="1"><FONT FACE="Tahoma, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:8pt'><B>Think Green...do you really need to print this email? Reduce, reuse, recycle!</B></SPAN></FONT></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT>
</BODY>
</HTML>