[ELDK] mmap: first byte always wrong

stefano babic sbabic at denx.de
Sat Nov 27 21:03:10 CET 2010


Am 27.11.2010 17:33, schrieb Alberto Caballero:
> Hi Stefano,
> 
> I am trying to read the Flash using the predefined MTD partitions.
> Although my board it is not the Sequoia one, the Memory Map for the NOR
> Flash memory is the same.
> 
> I am using the partitions scheme defined at the
> drivers/mtd/maps/sequoia.c file, although I will update it with my own
> scheme.

Check if your flash chips have the same geometry as in the sequoia
board, and avoid to have sectors crossing two partitions.

> 
> After booting the system, only "mtd" and "mtd1" are present at /dev
> folder.

Device nodes are automatically created only if you are using udev or
devtmpfs. However, you can add the device nodes you need with mknod.

> As far as I have found at the Internet, I can use a filesystem
> over those partitions

correct, it is the normal usage ;-)

> or use them as a character device. But I have not
> found yet how to create a device for the MTD partitions. Should I have
> to create a new character device at /dev folder and then mount the MTD
> partitions?

No, to use a filesystem you have to create a block device. You have to
check if your kernel has configured to support mtd block device, too.
You can check your /proc/devices, mtdblock is usually registered with
major device number 31.

> 
> If I try the provided command "dd if=/dev/mtd1 | hexdump -C"I get a
> kernel panic error, so this mtd1 device is not correct.

This should not happen and it looks like your flash is misconfigured or
your kernel is broken.

It should never happen that a kernel panic is generated simply running
user space applications.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================


More information about the eldk mailing list