[ELDK] mmap: first byte always wrong

Alberto Caballero alberto.kavan at gmail.com
Fri Nov 26 08:28:36 CET 2010


Hi,

At my project, I will have a data configuration file stored in the board
Flash memory using an U-Boot filesystem image. At the initialization stage,
I read the image from the Flash and store it in the Linux filesystem.

Of course at the U-Boot prompt I am able to check that image header at Flash
is correctly stored and all the bytes has the right values. I was wondering
if this has something to do with first access to mapped memory.

When Linux initializes it creates a series of MTD partitions by its own. Now
the data in the Flash will be overlapped in two partitions so I will try to
use just one of them.

Regarding the mmap usage, I was able to check with another board with
another PowerPC processor using ELDK also, and in this case there is no
issue with Flash access.

Regards,

Alberto

2010/11/26 Stefano Babic <sbabic at denx.de>

> On 11/26/2010 12:42 AM, Alberto Caballero wrote:
> > Hi all,
> >
> > I have updated my kernel configuration, and now, during the
> initialization,
> > the CFI Flash memory is recognized and some partitions are done, althoug
> I
> > am still unable to run my code.
> >
> > Which kernel options do I have to set up and which ones not?
>
> Well, this is hard to answer. It depends on your hardware, which feature
> you need in your project, an so on.
>
> By the way, why are you attempting to access to the flash without using
> the MTD subsystem ? You can open the /dev/mtd* file, depending on the
> partition you want to read, and you do not need to mmap() the flash. You
> could easy test if your flash is correctly read with usual linux tool,
> for example:
>
>        dd if=/dev/mtd0 | hexdump -C | head -10
>
> 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