<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Werner Almesberger schrieb:
<blockquote cite="mid:20091020122013.GD8728@almesberger.net" type="cite">
  <pre wrap="">Matthias Huber wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Werner Almesberger schrieb:
    </pre>
    <blockquote type="cite">
      <pre wrap=""># echo -en '\x17' | dd bs=1024 count=1 conv=sync &gt;/dev/mtd4
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->[...]
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">Can you tell why it worked ?
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->
In the 0x17 case, we're trying to go from 0x0f to 0x17. That's
one bit set and one bit cleared. Clearing the 0x08 bit can be
done, and happend when trying to write the 0x17. However, the
0x10 bit can't be set (without invoking an erase cycle).

However, since NAND has an ECC, it can still correct a one-bit
error. As it happens, the ECC pattern that gets written, just
flips the 0x10 bit, so the byte in NAND is 0x07, but it gets
corrected to 0x17 - which just happens to be the value we want.

  </pre>
  <blockquote type="cite">
    <pre wrap="">i can't. it is possible that i flashed my boot with dfu-util and the
rootfs directly.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Yes, DFU follows all the NAND erasing rituals properly. The rootfs
is very tricky, because there you also have JFFS2 that tries to
hide problems from you.

For your backup system, you should at least add flash_eraseall
to the restore procedure. To make things work also for systems
that have bad NAND blocks, you would have to use nanddump and
nandwrite. (And you still have to erase explicitly - nandwrite
won't do it for you.)

- Werner
  </pre>
</blockquote>
Thank you for this information about this nand* progs.<br>
<br>
I think, this should go into the wiki, if it isn't already.<br>
<br>
</body>
</html>