Cross compiling mtd-utils for Android and pread errors

Ketil Froyn ketil at froyn.name
Fri Oct 29 08:35:42 EDT 2010


Hi,

I'm trying to cross compile the mtd-utils package for Android, and I
was wondering if anyone has been able to do this before, because I'm
finding it difficult.

I have a working cross compiler toolchain (works with agcc, a wrapper
that takes care of all the necessary compiler flags) but I'm having
trouble getting this working to compile mtd-utils. I have been able to
compile single programs manually with the agcc wrapper, for example:

agcc -I include -o nanddump nanddump.c

but when I transfer this executable to the device and run it, I get:

/ # /sdcard/nanddump -a /dev/mtd/mtd0
ECC failed: 0
ECC corrected: 0
Number of bad blocks: 0
Number of bbt blocks: 0
Block size 131072, page size 2048, OOB size 56
Dumping data starting at 0x00000000 and ending at 0x0a5c0000...
pread: Unknown error: 0
/ #

or

/ # /sdcard/nanddump -f /sdcard/testdump /dev/mtd/mtd0
ECC failed: 0
ECC corrected: 0
Number of bad blocks: 0
Number of bbt blocks: 0
Block size 131072, page size 2048, OOB size 56
Dumping data starting at 0x00000000 and ending at 0x00040000...
pread: Not a typewriter
/ #

I'm grateful for any tips that can nudge me in the right direction.

Cheers, Ketil



More information about the linux-mtd mailing list