@@ -429,6 +429,8 @@ int main(int argc, char * const argv[])
if (writeoob) {
int i, start, len;
+ int tags_pos = 0;
+
oobreadbuf = writebuf + meminfo.writesize;
// Read more data for the OOB from the input if there isn't enough in the buffer
@@ -470,8 +472,8 @@ int main(int argc, char * const argv[])
start = ecclayout.oobfree[i].offset;
len = ecclayout.oobfree[i].length;
memcpy(oobbuf + start,
- oobreadbuf + start,
- len);
+ oobreadbuf + tags_pos, len);
+ tags_pos += len;
}
/* Write OOB data first, as ecc will be placed in there*/
oob.start = mtdoffset;
The tool mkyaffs2image doesn't know the oob layout of a NAND flash, so it puts the yaffs2 tags at the offset 0 of oob area. When nandwrite writes the image into NAND flash, it should put the yaffs2 tags at the right position according to the NAND oob layout. Signed-off-by: Stanley.Miao <stanley.miao@windriver.com> --- nandwrite.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)