2007/3/26, Aubrey Li <[EMAIL PROTECTED]>:
On 3/26/07, Erwin Authried <[EMAIL PROTECTED]> wrote: > Am Montag, den 26.03.2007, 10:54 +0800 schrieb Yue Han: > > Hi Mr. Li, > > I'm using uclinxu-2.4.19 which doesn't has the flash_tools cmd(include > > flash_eraseall mkfs.jffs2 .etc). So I made them out of > > mtd-snapshot-20040730.tar.bz2. > > > > Unfortunately, I got the error what I mentioned before. > > > > In the light of your prompt, I dig into mtdchar.c and > > flash_eraseall.c, > > I used printk to trace the bug and found it DO jump from mtd_ioctl(). > > > > I find the function mtd_open() and mtd_ioctl() implemented like this: > ... > > > > So, I pin the problem on the function mtd_ioctl() 's parameter > > doesn't match. > > But when I check other uclinux-dist who has flash_tools, I saw the > > same implement and call method. > > > > Ohh..I have no clue to fix it again, please give me some hint. > > Thank you! > > > > The ioctcl calls are correct. I think that the problem comes from using > different mtd kernel header files when you build flash_eraseall. Using > an old kernel like 2.4.19 is rather bad, I think there were a lot of > bugs fixed in MTD since. > Erwin is right. Look at the running result,
Yes, It is a tried and true method. Thank you. =========
# ./flash_eraseall /dev/mtd2 MTD_open MTD_ioctl MTD_ioctl Invalid ioctl 80084d0b (MEMGETINFO = 40204d01) ./flash_eraseall /dev/mtd2: MTD get bad block failed: Inappropriate ioctl for device ========= That means the parameter passed into mtd_ioctl is 80084d0b, but MEMGETINFO = 40204d01, the two value doesn't match. I think it's caused by the different header files. ELDK from www.denx.de seems to support mips. Go to see if something is useful for you. And another choice is try to erase your flash by bootloader. If you are using u-boot, you just have to erase the partition by a single "erase" command.
In fact, I didn't have the u-boot. My bootloader and cpu is provided by the third party which doesn't has any technologist to support me now :-(. Worse luck to say, I can't do any modification to it. Because of my bootloader doesn't support config root parameter(root=/dev/XXX), I add ROOT_DEV = MKDEV(31, 1) into init() in init/main.c . Does manually create ROOT_DEV(not use /dev/mtdX in fs.img directly )can affect my flash can't write? When I fixed the ioctl error, flash_eraseall bring the below to me: ========= # ./flash_eraseall -j /dev/mtd2 MTD_open MTD_ioctl [EMAIL PROTECTED] ` 0`--ph0 �`dopete.MTD_write Last[0] is 19 Last[1] is 19 Last[2] is 19 Last[0] is 1 Last[1] is 1 Last[2] is 1 Last[2] is 1, datum is 85 =================== -Aubrey _______________________________________________ uClinux-dev mailing list [email protected] http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by [email protected] To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
_______________________________________________ uClinux-dev mailing list [email protected] http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by [email protected] To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
