public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* mtd_debug usage
@ 2006-11-21 16:26 Duke
  2006-11-21 23:05 ` Duke
  0 siblings, 1 reply; 9+ messages in thread
From: Duke @ 2006-11-21 16:26 UTC (permalink / raw)
  To: linux-mtd

Hi All,
I'm having a bit of trouble understanding the usage to mtd_debug.

With the usage format below, why would I need <offset> and <len> if
the mtdblock sizes are already known? (i.e at boot)
I always thought if I write "mtd_debug erase /dev/mtdblock2" it will
erase the entire /dev/mtdblock2 device. not so?
If not, do I specify "mtd_debug erase /dev/mtdblock2 0x0 0x600000" for
mtdblock2 where 0x0 indicated the start of the block?

When I do a write "mtd_debug write /dev/mtdblock2 0x0 0x600000 myfs.cramfs"
would it do just this?

I've seen usage where /dev/mtd2 is used instead of /dev/mtdblock2,
what is the difference here? which should it be. It seems to me that
/dev/mtd2 simply gives the node info (mtd_debug info )and
/dev/mtdblock2 is really what you want to used. Do I have this
correct?

usage: mtd_debug info <device>
       mtd_debug read <device> <offset> <len> <dest-filename>
       mtd_debug write <device> <offset> <len> <source-filename>
       mtd_debug erase <device> <offset> <len>

Thanks.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mtd_debug usage
  2006-11-21 16:26 mtd_debug usage Duke
@ 2006-11-21 23:05 ` Duke
  2006-11-22  7:42   ` Ricard Wanderlof
  0 siblings, 1 reply; 9+ messages in thread
From: Duke @ 2006-11-21 23:05 UTC (permalink / raw)
  To: linux-mtd

I've added a few comments and results below:

On 11/21/06, Duke <ezbonites@gmail.com> wrote:
> Hi All,
> I'm having a bit of trouble understanding the usage to mtd_debug.
>
> With the usage format below, why would I need <offset> and <len> if
> the mtdblock sizes are already known? (i.e at boot)
> I always thought if I write "mtd_debug erase /dev/mtdblock2" it will
> erase the entire /dev/mtdblock2 device. not so?
> If not, do I specify "mtd_debug erase /dev/mtdblock2 0x0 0x600000" for
> mtdblock2 where 0x0 indicated the start of the block?
>
> When I do a write "mtd_debug write /dev/mtdblock2 0x0 0x600000 myfs.cramfs"
> would it do just this?
>
> I've seen usage where /dev/mtd2 is used instead of /dev/mtdblock2,
> what is the difference here? which should it be. It seems to me that
> /dev/mtd2 simply gives the node info (mtd_debug info )and
> /dev/mtdblock2 is really what you want to used. Do I have this
> correct?
>
> usage: mtd_debug info <device>
>        mtd_debug read <device> <offset> <len> <dest-filename>
>        mtd_debug write <device> <offset> <len> <source-filename>
>        mtd_debug erase <device> <offset> <len>
>

cfi_cmdset_0001: Erase suspend on write enabled
3 cmdlinepart partitions found on MTD device physmap-flash.0
Creating 3 MTD partitions on "physmap-flash.0":
0x00000000-0x00040000 : "boot"
0x00040000-0x00200000 : "kernel"
0x00200000-0x00800000 : "cramfs"

When I ran mtd_debug I get the following from the above mapping:

# mtd_debug info /dev/mtd2
mtd.type = MTD_NORFLASH
mtd.flags =
mtd.size = 1835008 (1M)
mtd.erasesize = 262144 (256K)
mtd.oobblock = 1
mtd.oobsize = 0
mtd.ecctype = MTD_ECC_NONE
regions = 0

# mtd_debug info /dev/mtd1
mtd.type = MTD_NORFLASH
mtd.flags =
mtd.size = 262144 (256K)
mtd.erasesize = 262144 (256K)
mtd.oobblock = 1
mtd.oobsize = 0
mtd.ecctype = MTD_ECC_NONE
regions = 0

# mtd_debug info /dev/mtd0
mtd.type = MTD_NORFLASH
mtd.flags =
mtd.size = 262144 (256K)
mtd.erasesize = 262144 (256K)
mtd.oobblock = 1
mtd.oobsize = 0
mtd.ecctype = MTD_ECC_NONE
regions = 0

# mtd_debug info /dev/mtd3
mtd.type = MTD_NORFLASH
mtd.flags =
mtd.size = 1835008 (1M)
mtd.erasesize = 262144 (256K)
mtd.oobblock = 1
mtd.oobsize = 0
mtd.ecctype = MTD_ECC_NONE
regions = 0

# mtd_debug erase /dev/mtdblock2 0 0x600000
MEMERASE: Inappropriate ioctl for device
# mtd_debug erase /dev/mtd2 0 0x600000
Erased 6291456 bytes from address 0x00000000 in flash
# mtd_debug write /dev/mtd2 0 0x600000 myfs_cramfs
file_to_flash: fread, size 0x600000, n 0x600000
fread(): Success

However, I expected mtd3 to show no info, but it did.
Even though it said a successful write, it did not as I could not
mount from that partition.

Clearly I'm missing something here. Could someone help me understand this?

much thanks

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mtd_debug usage
  2006-11-21 23:05 ` Duke
@ 2006-11-22  7:42   ` Ricard Wanderlof
  2006-11-22 14:23     ` Duke
  0 siblings, 1 reply; 9+ messages in thread
From: Ricard Wanderlof @ 2006-11-22  7:42 UTC (permalink / raw)
  To: Duke; +Cc: linux-mtd


On Tue, 21 Nov 2006, Duke wrote:

>> I've seen usage where /dev/mtd2 is used instead of /dev/mtdblock2,
>> what is the difference here? which should it be. It seems to me that
>> /dev/mtd2 simply gives the node info (mtd_debug info )and
>> /dev/mtdblock2 is really what you want to used. Do I have this
>> correct?

mtdblock devices are normally only used with the mount/umount commands. 
For erase /dev/mtdX is required - the mtdblock devices don't support the 
required ioctls. Actually, since a while back, it's not necessary to use 
/dev/mtdblockX devices for mount/umount either since they understand 
'mtdX' directly as in  mount -t cramfs mtd1 /mnt/mountpoint .

mtdblock devices do support an automatic erase-before-write functionality 
when writing. This used to be buggy, don't know the status of this. As far 
as I'm concerned, it's of little use anyway, because if the image you are 
writing is smaller than the partition, using this feature will leave the 
end of the partition unerased which is probably not what you want. Doing 
separate erase and write operations is thus preferable IMHO.

> Creating 3 MTD partitions on "physmap-flash.0":
> 0x00000000-0x00040000 : "boot"
> 0x00040000-0x00200000 : "kernel"
> 0x00200000-0x00800000 : "cramfs"
>
> When I ran mtd_debug I get the following from the above mapping:
>
> # mtd_debug info /dev/mtd2
> mtd.size = 1835008 (1M)
>
> # mtd_debug info /dev/mtd1
> mtd.size = 262144 (256K)
>
> # mtd_debug info /dev/mtd0
> mtd.size = 262144 (256K)
>
> # mtd_debug info /dev/mtd3
> mtd.size = 1835008 (1M)

Looks like your minor numbers are screwed up for the /dev/mtd devices. 0 
and 1 seem to have the same size, as to 2 and 3. Normally mtd0 is the 
whole flash, with the first partition being in mtd1 (someone please 
correct me if I'm wrong here). mtd0/1 seems to refer to the first 256k 
boot partition, with mtd2/3 referring to the kernel partition with the 
size of 0x1c0000 = 1835008.

What does  ls -l /dev/mtd*  (and ls -l /dev/mtdblock*) say?

> # mtd_debug erase /dev/mtdblock2 0 0x600000
> MEMERASE: Inappropriate ioctl for device

You must use /dev/mtd2 for erasure.

> Clearly I'm missing something here. Could someone help me understand this?

The problem seems to have something to do with the device mapping, your 
commands look ok at least to start with.

/Ricard
--
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mtd_debug usage
  2006-11-22  7:42   ` Ricard Wanderlof
@ 2006-11-22 14:23     ` Duke
  2006-11-22 14:39       ` Duke
  2006-11-22 14:46       ` Ricard Wanderlof
  0 siblings, 2 replies; 9+ messages in thread
From: Duke @ 2006-11-22 14:23 UTC (permalink / raw)
  To: Ricard Wanderlof; +Cc: linux-mtd

On 11/22/06, Ricard Wanderlof <ricard.wanderlof@axis.com> wrote:
>
> On Tue, 21 Nov 2006, Duke wrote:
>
> >> I've seen usage where /dev/mtd2 is used instead of /dev/mtdblock2,
> >> what is the difference here? which should it be. It seems to me that
> >> /dev/mtd2 simply gives the node info (mtd_debug info )and
> >> /dev/mtdblock2 is really what you want to used. Do I have this
> >> correct?
>
> mtdblock devices are normally only used with the mount/umount commands.
> For erase /dev/mtdX is required - the mtdblock devices don't support the
> required ioctls. Actually, since a while back, it's not necessary to use
> /dev/mtdblockX devices for mount/umount either since they understand
> 'mtdX' directly as in  mount -t cramfs mtd1 /mnt/mountpoint .
>
> mtdblock devices do support an automatic erase-before-write functionality
> when writing. This used to be buggy, don't know the status of this. As far
> as I'm concerned, it's of little use anyway, because if the image you are
> writing is smaller than the partition, using this feature will leave the
> end of the partition unerased which is probably not what you want. Doing
> separate erase and write operations is thus preferable IMHO.
>
> > Creating 3 MTD partitions on "physmap-flash.0":
> > 0x00000000-0x00040000 : "boot"
> > 0x00040000-0x00200000 : "kernel"
> > 0x00200000-0x00800000 : "cramfs"
> >
> > When I ran mtd_debug I get the following from the above mapping:
> >
> > # mtd_debug info /dev/mtd2
> > mtd.size = 1835008 (1M)
> >
> > # mtd_debug info /dev/mtd1
> > mtd.size = 262144 (256K)
> >
> > # mtd_debug info /dev/mtd0
> > mtd.size = 262144 (256K)
> >
> > # mtd_debug info /dev/mtd3
> > mtd.size = 1835008 (1M)
>
> Looks like your minor numbers are screwed up for the /dev/mtd devices. 0
> and 1 seem to have the same size, as to 2 and 3. Normally mtd0 is the
> whole flash, with the first partition being in mtd1 (someone please
> correct me if I'm wrong here). mtd0/1 seems to refer to the first 256k
> boot partition, with mtd2/3 referring to the kernel partition with the
> size of 0x1c0000 = 1835008.
>
> What does  ls -l /dev/mtd*  (and ls -l /dev/mtdblock*) say?

It looks like this:

crw-r--r--    1 root     root      90,   0 Mar 22  2005 /dev/mtd0
crw-r--r--    1 root     root      90,   1 Mar 22  2005 /dev/mtd1
crw-r--r--    1 root     root      90,   2 Mar 22  2005 /dev/mtd2
crw-r--r--    1 root     root      90,   3 Mar 22  2005 /dev/mtd3
crw-r--r--    1 root     root      90,   4 Nov 22  2006 /dev/mtd4
brw-r--r--    1 root     root      31,   0 Mar 22  2005 /dev/mtdblock0
brw-r--r--    1 root     root      31,   1 Mar 22  2005 /dev/mtdblock1
brw-r--r--    1 root     root      31,   2 Mar 22  2005 /dev/mtdblock2
brw-r--r--    1 root     root      31,   3 Mar 22  2005 /dev/mtdblock3
brw-r--r--    1 root     root      31,   4 Nov 22  2006 /dev/mtdblock4

I've added the fourth block but that looks the same as the 0 and 1 blocks.


>
> > # mtd_debug erase /dev/mtdblock2 0 0x600000
> > MEMERASE: Inappropriate ioctl for device
>
> You must use /dev/mtd2 for erasure.
>
> > Clearly I'm missing something here. Could someone help me understand this?
>
> The problem seems to have something to do with the device mapping, your
> commands look ok at least to start with.
>
> /Ricard
> --
> Ricard Wolf Wanderlöf                           ricardw(at)axis.com
> Axis Communications AB, Lund, Sweden            www.axis.com
> Phone +46 46 272 2016                           Fax +46 46 13 61 30
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mtd_debug usage
  2006-11-22 14:23     ` Duke
@ 2006-11-22 14:39       ` Duke
  2006-11-22 14:46       ` Ricard Wanderlof
  1 sibling, 0 replies; 9+ messages in thread
From: Duke @ 2006-11-22 14:39 UTC (permalink / raw)
  To: Ricard Wanderlof; +Cc: linux-mtd

On 11/22/06, Duke <ezbonites@gmail.com> wrote:
> On 11/22/06, Ricard Wanderlof <ricard.wanderlof@axis.com> wrote:
> > mtdblock devices are normally only used with the mount/umount commands.
> > For erase /dev/mtdX is required - the mtdblock devices don't support the
> > required ioctls. Actually, since a while back, it's not necessary to use
> > /dev/mtdblockX devices for mount/umount either since they understand
> > 'mtdX' directly as in  mount -t cramfs mtd1 /mnt/mountpoint .
> >
> > mtdblock devices do support an automatic erase-before-write functionality
> > when writing. This used to be buggy, don't know the status of this. As far
> > as I'm concerned, it's of little use anyway, because if the image you are
> > writing is smaller than the partition, using this feature will leave the
> > end of the partition unerased which is probably not what you want. Doing
> > separate erase and write operations is thus preferable IMHO.
> >
> > > Creating 3 MTD partitions on "physmap-flash.0":
> > > 0x00000000-0x00040000 : "boot"
> > > 0x00040000-0x00200000 : "kernel"
> > > 0x00200000-0x00800000 : "cramfs"
> > >
> > > When I ran mtd_debug I get the following from the above mapping:
> > >
> > > # mtd_debug info /dev/mtd2
> > > mtd.size = 1835008 (1M)
> > >
> > > # mtd_debug info /dev/mtd1
> > > mtd.size = 262144 (256K)
> > >
> > > # mtd_debug info /dev/mtd0
> > > mtd.size = 262144 (256K)
> > >
> > > # mtd_debug info /dev/mtd3
> > > mtd.size = 1835008 (1M)
> >
> > Looks like your minor numbers are screwed up for the /dev/mtd devices. 0
> > and 1 seem to have the same size, as to 2 and 3. Normally mtd0 is the
> > whole flash, with the first partition being in mtd1 (someone please
> > correct me if I'm wrong here). mtd0/1 seems to refer to the first 256k
> > boot partition, with mtd2/3 referring to the kernel partition with the
> > size of 0x1c0000 = 1835008.
> >
> > What does  ls -l /dev/mtd*  (and ls -l /dev/mtdblock*) say?
>
> It looks like this:
>
> crw-r--r--    1 root     root      90,   0 Mar 22  2005 /dev/mtd0
> crw-r--r--    1 root     root      90,   1 Mar 22  2005 /dev/mtd1
> crw-r--r--    1 root     root      90,   2 Mar 22  2005 /dev/mtd2
> crw-r--r--    1 root     root      90,   3 Mar 22  2005 /dev/mtd3
> crw-r--r--    1 root     root      90,   4 Nov 22  2006 /dev/mtd4
> brw-r--r--    1 root     root      31,   0 Mar 22  2005 /dev/mtdblock0
> brw-r--r--    1 root     root      31,   1 Mar 22  2005 /dev/mtdblock1
> brw-r--r--    1 root     root      31,   2 Mar 22  2005 /dev/mtdblock2
> brw-r--r--    1 root     root      31,   3 Mar 22  2005 /dev/mtdblock3
> brw-r--r--    1 root     root      31,   4 Nov 22  2006 /dev/mtdblock4
>
> I've added the fourth block but that looks the same as the 0 and 1 blocks.

This is what it looks like for the following partitions (this looks
wierd to me):

cfi_cmdset_0001: Erase suspend on write enabled
4 cmdlinepart partitions found on MTD device physmap-flash.0
Creating 4 MTD partitions on "physmap-flash.0":
0x00000000-0x00040000 : "boot"
0x00040000-0x00200000 : "kernel"
0x00200000-0x00800000 : "cramfs"
0x00800000-0x01000000 : "jffs2"

#mtd_debug info /dev/mtd0
mtd.type = MTD_NORFLASH
mtd.flags =
mtd.size = 262144 (256K)
mtd.erasesize = 262144 (256K)
mtd.oobblock = 1
mtd.oobsize = 0
mtd.ecctype = MTD_ECC_NONE
regions = 0

# mtd_debug info /dev/mtd1
mtd.type = MTD_NORFLASH
mtd.flags =
mtd.size = 262144 (256K)
mtd.erasesize = 262144 (256K)
mtd.oobblock = 1
mtd.oobsize = 0
mtd.ecctype = MTD_ECC_NONE
regions = 0

#  mtd_debug info /dev/mtd2
mtd.type = MTD_NORFLASH
mtd.flags =
mtd.size = 1835008 (1M)
mtd.erasesize = 262144 (256K)
mtd.oobblock = 1
mtd.oobsize = 0
mtd.ecctype = MTD_ECC_NONE
regions = 0

#  mtd_debug info /dev/mtd3
mtd.type = MTD_NORFLASH
mtd.flags =
mtd.size = 1835008 (1M)
mtd.erasesize = 262144 (256K)
mtd.oobblock = 1
mtd.oobsize = 0
mtd.ecctype = MTD_ECC_NONE
regions = 0

#  mtd_debug info /dev/mtd4
mtd.type = MTD_NORFLASH
mtd.flags =
mtd.size = 6291456 (6M)
mtd.erasesize = 262144 (256K)
mtd.oobblock = 1
mtd.oobsize = 0
mtd.ecctype = MTD_ECC_NONE
regions = 0

#  mtd_debug info /dev/mtd5
mtd.type = MTD_NORFLASH
mtd.flags =
mtd.size = 6291456 (6M)
mtd.erasesize = 262144 (256K)
mtd.oobblock = 1
mtd.oobsize = 0
mtd.ecctype = MTD_ECC_NONE
regions = 0

#  mtd_debug info /dev/mtd6
mtd.type = MTD_NORFLASH
mtd.flags =
mtd.size = 8388608 (8M)
mtd.erasesize = 262144 (256K)
mtd.oobblock = 1
mtd.oobsize = 0
mtd.ecctype = MTD_ECC_NONE
regions = 0

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mtd_debug usage
  2006-11-22 14:23     ` Duke
  2006-11-22 14:39       ` Duke
@ 2006-11-22 14:46       ` Ricard Wanderlof
  2006-11-22 15:03         ` Artem Bityutskiy
  1 sibling, 1 reply; 9+ messages in thread
From: Ricard Wanderlof @ 2006-11-22 14:46 UTC (permalink / raw)
  To: Duke; +Cc: linux-mtd


On Wed, 22 Nov 2006, Duke wrote:

>> What does  ls -l /dev/mtd*  (and ls -l /dev/mtdblock*) say?
>
> It looks like this:
>
> crw-r--r--    1 root     root      90,   0 Mar 22  2005 /dev/mtd0
> crw-r--r--    1 root     root      90,   1 Mar 22  2005 /dev/mtd1
> crw-r--r--    1 root     root      90,   2 Mar 22  2005 /dev/mtd2
> crw-r--r--    1 root     root      90,   3 Mar 22  2005 /dev/mtd3
> crw-r--r--    1 root     root      90,   4 Nov 22  2006 /dev/mtd4
> brw-r--r--    1 root     root      31,   0 Mar 22  2005 /dev/mtdblock0
> brw-r--r--    1 root     root      31,   1 Mar 22  2005 /dev/mtdblock1
> brw-r--r--    1 root     root      31,   2 Mar 22  2005 /dev/mtdblock2
> brw-r--r--    1 root     root      31,   3 Mar 22  2005 /dev/mtdblock3
> brw-r--r--    1 root     root      31,   4 Nov 22  2006 /dev/mtdblock4
>

The minor numbers for /dev/mtdX are wrong. /dev/mtd0 should have a minor 
no. of 0, /dev/mtd1 should have 2, /dev/mtd2 should have 4 etc. The 
odd-numbered minor numbers are intended for read-only devices.

The numbers for the block devices however are correct. (Don't know why 
the numbering scheme is not the same as for the character devices but that 
seems to be the way it is.)

/Ricard
--
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mtd_debug usage
  2006-11-22 14:46       ` Ricard Wanderlof
@ 2006-11-22 15:03         ` Artem Bityutskiy
  2006-11-22 17:26           ` Duke
  0 siblings, 1 reply; 9+ messages in thread
From: Artem Bityutskiy @ 2006-11-22 15:03 UTC (permalink / raw)
  To: Ricard Wanderlof; +Cc: linux-mtd, Duke

On Wed, 2006-11-22 at 15:46 +0100, Ricard Wanderlof wrote:
> The minor numbers for /dev/mtdX are wrong. /dev/mtd0 should have a minor 
> no. of 0, /dev/mtd1 should have 2, /dev/mtd2 should have 4 etc. The 
> odd-numbered minor numbers are intended for read-only devices.

There is MKDEVS scripts an mtd-utils which can create these.

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mtd_debug usage
  2006-11-22 15:03         ` Artem Bityutskiy
@ 2006-11-22 17:26           ` Duke
  2006-11-24  9:57             ` Ricard Wanderlof
  0 siblings, 1 reply; 9+ messages in thread
From: Duke @ 2006-11-22 17:26 UTC (permalink / raw)
  To: dedekind; +Cc: linux-mtd, Ricard Wanderlof

On 11/22/06, Artem Bityutskiy <dedekind@infradead.org> wrote:
> On Wed, 2006-11-22 at 15:46 +0100, Ricard Wanderlof wrote:
> > The minor numbers for /dev/mtdX are wrong. /dev/mtd0 should have a minor
> > no. of 0, /dev/mtd1 should have 2, /dev/mtd2 should have 4 etc. The
> > odd-numbered minor numbers are intended for read-only devices.
>
> There is MKDEVS scripts an mtd-utils which can create these.
>

Thanks all,
I got it right now and it does show the correct info.

However, What does the following mean?

#mtd_debug write /dev/mtd2 0x0 0x600000 testfs_cramfs
file_to_flash: fread, size 0x600000, n 0x600000
fread(): Success

Does that mean it will write to mtd2 which starts at physical address
0x200000 (to 0x800000) or does it actually start at physical address
0x0?
 what does the n means?
I'm not writing to flash correctly so maybe I'm missing something.

Thanks.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: mtd_debug usage
  2006-11-22 17:26           ` Duke
@ 2006-11-24  9:57             ` Ricard Wanderlof
  0 siblings, 0 replies; 9+ messages in thread
From: Ricard Wanderlof @ 2006-11-24  9:57 UTC (permalink / raw)
  To: Duke; +Cc: linux-mtd


On Wed, 22 Nov 2006, Duke wrote:

> However, What does the following mean?
>
> #mtd_debug write /dev/mtd2 0x0 0x600000 testfs_cramfs
> file_to_flash: fread, size 0x600000, n 0x600000
> fread(): Success
>
> Does that mean it will write to mtd2 which starts at physical address
> 0x200000 (to 0x800000) or does it actually start at physical address
> 0x0?
> what does the n means?
> I'm not writing to flash correctly so maybe I'm missing something.

Your mtd2 partition starts at physical 0x200000, which means that when 
writing to offset 0 of that partition, you write to physical address 
0x200000.

The output from mtd_debug is not terribly lucid. It is after all more of a 
debugging tool. When it says 'file_to_flash:...' it means it didn't think 
the file was read properly. How big is your file (testfs_cramfs)? If you 
specify a size of 0x600000 then mtd_debug write will try to read 0x600000 
bytes from the file, and fail like it does above if it cannot find it all. 
The 'fread(): Success' line indicates that the read actually went well, 
but bumped into an end-of-file before all data could be read.

I would suggest using the flash_eraseall tool to first erase the 
partition, e.g. flash_eraseall /dev/mtd2, followed by a simple cat or dd 
of the image file to the device, e.g. cat testfs_cramfs > /dev/mtd2 .

/Ricard
--
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-11-24  9:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-21 16:26 mtd_debug usage Duke
2006-11-21 23:05 ` Duke
2006-11-22  7:42   ` Ricard Wanderlof
2006-11-22 14:23     ` Duke
2006-11-22 14:39       ` Duke
2006-11-22 14:46       ` Ricard Wanderlof
2006-11-22 15:03         ` Artem Bityutskiy
2006-11-22 17:26           ` Duke
2006-11-24  9:57             ` Ricard Wanderlof

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox