public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Blair Barnett <bbarnett@dash.net>
To: Cliff Brake <cliff.brake@gmail.com>
Cc: MTD mailing list <linux-mtd@lists.infradead.org>
Subject: Re: what are correct sumtool and nandwrite options for NAND flash?
Date: Thu, 14 Feb 2008 12:44:04 -0800	[thread overview]
Message-ID: <1203021844.5507.29.camel@bbarnett-desktop> (raw)
In-Reply-To: <f96d234e0802141129w2a1691dfy949caec909fc25f1@mail.gmail.com>

On Thu, 2008-02-14 at 14:29 -0500, Cliff Brake wrote:
> Hello,
> 
> I'm trying to determine the correct sumtool, and nandwrite options for
> the following NAND flash device:
> 
> root@cm-x270:/usb/tmp$ mtd_debug info /dev/mtd5
> mtd.type = MTD_NANDFLASH
> mtd.flags = MTD_CAP_NANDFLASH
> mtd.size = 67108864 (64M)
> mtd.erasesize = 131072 (128K)
> mtd.writesize = 2048 (2K)
> mtd.oobsize = 64
> regions = 0
> 
> My question is how do I get the OOB data into the flash image, and
> convince nandwrite to use it.  I have been doing the following:
> 
> sumtool -i <input_file> -o <output_file> -e  -p;
> flash_eraseall -j /dev/mtd5
> nandwrite /dev/mtd5 <output_file>
> 
> I'm not sure what happens to the OOB data in the input image file when
> I use the above method?  Is it simply mixed up in the image and not
> actually written to the 64 byte OOB space?  The above method seems to
> work, so I have ignored it thus far.
> 
> My question is should I be using the nandwrite -o option?  Looking at
> the source it does not look like the OOB data gets written to the OOB
> region unless this option is used.
> 
> if I try:
> nandwrite -o /dev/mtd5 <output_file>
> 
> I get the following:
> Input file is not page aligned
> Data was only partially written due to error
> : Success
> 
> Appreciate any pointers as to the correct way to do this.
> 
> Thanks,
> Cliff
> 

Hi Cliff,

sumtool doesn't create an image with embedded OOB data by default. You
can check for yourself by doing a hexdump of the image and looking at
the data that is placed at 2049 (1 byte after the first 2k page. If OOB
data is there, it will be obvious. If it's (as I surmise) the next 2k
page, then no oob data is embedded in the image.

I think what you want is 

sumtool -e 131072 -c  -p -i <input_file> -o <output_file>
nandwrite -o -j /dev/mtd5 <output_file>

-blair

      parent reply	other threads:[~2008-02-14 20:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-14 19:29 what are correct sumtool and nandwrite options for NAND flash? Cliff Brake
2008-02-14 20:34 ` Andrey Yurovsky
2008-02-14 20:44 ` Blair Barnett [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1203021844.5507.29.camel@bbarnett-desktop \
    --to=bbarnett@dash.net \
    --cc=blair@dash.net \
    --cc=cliff.brake@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox