Kelvie Wong wrote:

[EMAIL PROTECTED] ~] $ flash_eraseall /dev/mtd3

Erasing 128 Kibyte @ 7e0000 -- 98 % complete.

[EMAIL PROTECTED] ~] $ cat uImage.bin > /dev/mtd3

cat: write error: Invalid argument


The problem is that the mtd driver will only accept writes with length equal a multiple of 2048, so the last write operation will always fail (unless you are very lucky with the size). To get past the problem you have to pad the uImage file with some extra 0xff.

You can write a program that does this nicely or you can just do the following hack: Run the following command for a while (stop it with ctrl-c) to generate a file containing only 0xff
 while true ; do echo -n xx | tr 'x' '\377' >> ff.file; done
The size should be at least 2048 bytes, but it does not matter if it is too big. Then pad the kernel
 cat uImage.bin ff.file > uImagePad.bin
And now you can download the kernel with
 cat uImagePad.bin > /dev/mtd3
You will still get the error message, but it is after the end of the code so it does not matter.

Tore



_______________________________________________
Openmoko community mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/community

Reply via email to