Hi ,
We have developed a board based on the i.mx537,We try to boot from nand flash (MT29F4G08) with u-boot-2009.08.But we got some error when boot.
We modify mx53_ard.c and mx53_ard.h ,add setup_nfc function and some Macro definition in u-boot source. also add nand device and partitions in mx53_ard.c of linux kernel. Then we download uboot.bin and uImage with MFG TOOL.
Sometimes(80%)we got noting.Another(20%),we got u-boot info in serial,u-boot can read correct Nand flash ID.But can't load kernel,the message as follow:
NAND read: device 0 offset 0x1000000, size 0x500000
UnCorrectable RS-ECC Error
UnCorrectable RS-ECC Error
.
.
UnCorrectable RS-ECC Error
5242880 bytes read: OK
## Booting kernel from Legacy Image at 70800000 ...
Image Name: Linux-<opal.wolf.henry.lee>
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3128204 Bytes = 3 MB
Load Address: 70008000
Entry Point: 70008000
Verifying Checksum ... Bad Data CRC
ERROR: can't get kernel image!
What is it that I'm still doing wrong? please help .
Thanks
lee
Our hardware interface of nand flash :
i.mx537 MT29F4G08
NANDF_ALE (ALT0)==> ALE
NANDF_CLE (ALT0)==> CLE
NANDF_CS0 (ALT0)==> CS0
PATA_DATA0 (ALT3)==>DATA0
PATA_DATA1 (ALT3)==>DATA1
PATA_DATA2 (ALT3)==>DATA2
PATA_DATA3 (ALT3)==>DATA3
PATA_DATA4 (ALT3)==>DATA4
PATA_DATA5 (ALT3)==>DATA5
PATA_DATA6 (ALT3)==>DATA6
PATA_DATA7 (ALT3)==>DATA7
NANDF_RB0 (ALT0)==> RB
NANDF_RE_B (ALT0)==>RE
NANDF_WE_B (ALT0)==>WE
NANDF_WP_B (ALT0)==>WP
When boot from nand , the BOOT_CFG pin as follow:
BOOT_MODE0==>0
BOOT_MODE1==>0 //internal boot
BOOT_CFG1_7==>1 //boot from nand
BOOT_CFG1_6==>0 //muxed on PATA pads
BOOT_CFG1_5==>0
BOOT_CFG1_4==>0 //no interleaving
BOOT_CFG1_3==>1
BOOT_CFG1_2==>0 //4 address cycles
BOOT_CFG2_7==>0
BOOT_CFG2_6==>1 //2K+64byte(4-bit ECC)
BOOT_CFG2_5==>0 //8 bit BUS width
BOOT_CFG3_7==>0 //stride size =1 block
BOOT_CFG3_6==>0 //Non LBA
BOOT_CFG3_5==>0 //Not use R/B signal
BOOT_CFG3_4==>0
BOOT_CFG3_3==>0 //4 bit ECC
BOOT_CFG3_2==>0
BOOT_CFG3_1==>1 //64 pages per block
I think you haven't burn correct image files to the NAND, the followed is a workable MFGTool config file, you can reference to it for your MFGTool:
<LIST name="MX53EVK-NAND-Linux" desc="Choose Nand as media to Flash File System">
<CMD type="find" body="BootStrap" timeout="60"/>
<CMD type="init" body="Memory" file ="mx53-evk/mx53evk.ddr.xml" />
<CMD type="load" file="mx53-evk/mx53evk.uImage" address="0x70800000"
loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" >Doing Kernel.</CMD>
<CMD type="load" file="mx53-evk/mx53evk.initramfs.cpio.gz.uboot" address="0x70B00000"
loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" >Doing Initramfs.</CMD>
<CMD type="load" file="mx53-evk/mx53evk.u-boot.bin" address="0x77800000"
loadSection="OTH" setSection="APP" HasFlashHeader="FALSE" CodeOffset ="0x0">Loading OS image.</CMD>
<CMD type="jump" > Jumping to OS image. </CMD>
<CMD type="find" body="Updater" timeout="180"/>
<CMD type="push" body="mknod class/mtd,mtd0,/dev/mtd0"/>
<CMD type="push" body="mknod class/mtd,mtd1,/dev/mtd1"/>
<CMD type="push" body="mknod class/mtd,mtd2,/dev/mtd2"/>
<CMD type="push" body="mknod block,mtdblock0,/dev/mtdblock0,block"/>
<CMD type="push" body="mknod block,mtdblock1,/dev/mtdblock1,block"/>
<CMD type="push" body="mknod block,mtdblock2,/dev/mtdblock2,block"/>
<CMD type="push" body="$ flash_eraseall /dev/mtd0">Erasing boot partition</CMD>
<CMD type="push" body="send" file="mx53-evk/u-boot.bin">Sending U-Boot</CMD>
<CMD type="push" body="$ echo 1 > /sys/devices/platform/mxc_nandv2_flash.0/ignorebad">Ignore bad block</CMD>
<CMD type="push" body="$ kobs-ng init --chip_0_device_path=/dev/mtd0 $FILE">Flashing Bootloader</CMD>
<CMD type="push" body="$ echo 0 > /sys/devices/platform/mxc_nandv2_flash.0/ignorebad">Care bad block</CMD>
<CMD type="push" body="$ flash_eraseall /dev/mtd1">Erasing Kernel partition</CMD>
<CMD type="push" body="send" file="mx53-evk/uImage">Sending Kernel Image</CMD>
<CMD type="push" body="$ nandwrite /dev/mtd1 -p $FILE">Flashing Kernel</CMD>
<CMD type="push" body="$ flash_eraseall /dev/mtd2">Erasing rootfs partition</CMD>
<CMD type="push" body="$ mkdir -p /mnt/mtdblock2"/>
<CMD type="push" body="$ mount -t jffs2 /dev/mtdblock2 /mnt/mtdblock2"/>
<CMD type="push" body="pipe tar -jxv -C /mnt/mtdblock2" file="mx53-evk/rootfs.tar.bz2">Sending and writting rootfs</CMD>
<CMD type="push" body="frf">Finishing rootfs write</CMD>
<CMD type="push" body="$ umount /mnt/mtdblock2">Unmounting rootfs partition</CMD>
<CMD type="push" body="$ echo Update Complete!">Done</CMD>
</LIST>
Hi, qiang, Thanks for quick response .
I write flash with MFG TOOL too . before that , We add nand device and partitions in mx53_ard.c of mfgware linux kernel.
When MFG linux running , we cat /proc/mtd ,It show me the correct partition like this:
dev: size erasesize name
mtd0: 01000000 00020000 "bootloader"
mtd1: 01400000 00020000 "nand.kernel"
mtd2: 10000000 00020000 "nand.rootfs"
mtd3: 0dc00000 00020000 "nand.userfs1"
The full messages in the "mfg_flash_nand_info.txt"and "ucl.xml" files attached.
I think I have two trouble :
1. Sometimes(80%) uboot can't boot itself from nand flash.
2.Others(20%),uboot can run ,but can't load kernel .
Is right ?
Thanks very much for your help!
henry
You'd better erase the mtd0 before "<CMD type="push" body="send" file="files/u-boot-mx53-opal-nand.bin">Sending U-Boot</CMD>".
Hi, Qiang ,Thanks very much !
I add command
<CMD type="push" body="$ flash_eraseall /dev/mtd0">Erasing U-boot partition</CMD>
before
<CMD type="push" body="send" file="files/u-boot-mx53-opal-nand.bin">Sending U-Boot</CMD>
and try again, but the same to before .
need I modify mxc_nand.c of u-boot2009.08 source to match mxc_nd2.c of mfgware linux2.6.35 source?
I think maybe there is some hardware issue on your board. As I remembered, this NAND had already been used on some other one's iMX53 board.
多谢强兄及时回复。我能回中文吗?我英文不好,回复可能有时候表达不准确。
Is it possible mfg linux driver don't match uboot nand driver ?
I use the opal board , It can boot from nand everytime base on winCE before. So ,maybe hardware is fine .
Your log shows there are ECC error, it seems the data in NAND is wrong. But I'm not sure which made this error.
Qiang ,thanks very much !
Yes , it tell that ECC is error, I try to modify uboot source , /driver/mtd/nand/mxc_nand.c , try to use
ecc.mode = NAND_ECC_NONE;
ecc.mode =NAND_ECC_SOFT;
ecc.mode = NAND_ECC_HW;
But it still output the same error :
Verifying Checksum ... Bad Data CRC
ERROR: can't get kernel image!
:smileyconfused:
have you had same situation?
I had never see such issue, but you should always use NAND_ECC_HW. By the way, if your WinCE is on the same board, maybe you can check the difference between Linux and WinCE BSP, such as IOMUX setting for NAND related pins; NFC clock, NAND timing parameters.
Hi, Qiang ,Thanks for your help.
Uboot always output Bad Date CRC , I print all data of kernel which be read by u-boot ,then to compare it with uImage file . I found all data are same, except NO. 2000+2048*n(n=0.1.2.3....) . (my nand page size =2048) ,the value of NO.2000 byte always is 0xff .
but I don't know why and how.
Hello,Henry,
Would you like to share schematic & BSP file in u-boot / linux with me ? Let me check it with Qiang.Li ! At the same time, Please tell us your bsp version ( linux or android / kernel version) .
My Email : weidong.sun@freescale.com
Regards,
Weidong
hello,Weidong,
Thanks for your respond .info of my board:
CPU : i.mx537
OS: linux2.6.35
bootloader:U-boot2009.08
I will send BSP to your Email after arrange . Thanks very much!
Hello,Henry,
请给我一些必要的信息!
(1)是否有代理上为你的项目提供支持和帮助。
请把代理的联络方式发邮件给我
(2)项目的基本情况
也发邮件给我。比如:
公司名称:
项目名称:
最终产品:
联系人:
项目周期:
公司地址
伟东
伟东,你好,非常感谢快速回复,相关信息已发送至你邮箱,请查收。