AnsweredAssumed Answered

i.MX287: I can't attach my nor flash mtd part to ubi

Question asked by h k on Nov 27, 2015
Latest reply on Dec 2, 2015 by h k

Hi all,

 

When burn the board using MFGTOOL, fails to attach mtd part. Debug trace is:

 

mx28_nor_flash spi1.0: mx28_nor_flash (32768 Kbytes)

Creating 2 MTD partitions on "mx28_nor_flash":

0x000000000000-0x000000100000 : "boot"

0x000000100000-0x000002000000 : "kernel"

UBI: attaching mtd1 to ubi0

UBI: physical eraseblock size:   4096 bytes (4 KiB)

UBI: logical eraseblock size:    3968 bytes

UBI: smallest flash I/O unit:    1

UBI: VID header offset:          64 (aligned 64)

UBI: data offset:                128

UBI error: ubi_read_volume_table: the layout volume was not found

UBI error: ubi_init: cannot attach mtd1

 

I use a Winbond nor flash(W25Q256FVFIG), kernel version is 2.6.35.3

I debug the attaching process, it seems when read flash PEB's VID header, its magic number doesn't equal to predefined macro UBI_VID_HDR_MAGIC. However the flash read operation is successful.

 

This confuse me a lot. I searched the Google, most says the filesystem should be ubinized with mtd-utils. But my situation is Kernel just initializes the ubi module, it hasn't come to the mounting of filesystem I think.

 

Has read the http://www.linux-mtd.infradead.org/faq/ubi.html#L_format_mtd, the website says I needn't to format nor flash before the attaching operation.

 

I really don't know what happened. Someone familiar with ubi or has came across similar problem?  Possible reason is also appreciated.

Thanks in advance.

 

 

#################################################################################################################

Part of the ucl.xml content is:

 

<LIST name="Singlechip NAND" desc="Install on singlechip NAND">

<CMD type="boot" body="Recovery" file="updater.sb" timeout="60" if="HabDisable">Booting update firmware.</CMD>

<CMD type="boot" body="Recovery" file="updater_ivt.sb" timeout="60" if="HabEnable">Booting update firmware.</CMD>

 

<CMD type="push" body="mknod class/mtd,mtd0,/dev/mtd0"/>                            ----------------------tool's log stops here with hint(

Panel A Start <CMD/> type="push" body="mknod class/mtd,mtd0,/dev/mtd0" file="" timeout="10" onError="" text="".

Panel A UtpUpdate Event: DeviceRemoval Msg: (null) DevState: Disconnected OpState: WAITING_FOR_DEVICE)

 

<CMD type="push" body="mknod class/mtd,mtd1,/dev/mtd1"/>

<CMD type="push" body="mknod class/misc,ubi_ctrl,/dev/ubi_ctrl"/>

<CMD type="push" body="$ flash_eraseall /dev/mtd0">Erasing rootfs partition</CMD>

<CMD type="push" body="$ flash_eraseall /dev/mtd1">Erasing rootfs partition</CMD>

<CMD type="push" body="send" file="files/imx28_ivt_linux.sb">Sending firmware</CMD>

<CMD type="push" body="$ kobs-ng init $FILE">Flashing firmware</CMD>

<CMD type="push" body="$ ubiattach /dev/ubi_ctrl -m 1 -d 0">Attaching UBI partition</CMD>

<CMD type="push" body="mknod class/ubi,ubi0,/dev/ubi0"/>

<CMD type="push" body="$ ubimkvol /dev/ubi0 -n 0 -N rootfs0 -s 224MiB">Creating UBI volumes</CMD>

<CMD type="push" body="$ ubimkvol /dev/ubi0 -n 1 -N data -m">Creating UBI volumes</CMD>

<CMD type="push" body="$ mkdir -p /mnt/ubi0; mount -t ubifs ubi0_0 /mnt/ubi0" />

<CMD type="push" body="pipe tar -jxv -C /mnt/ubi0" file="files/rootfs.tar.bz2">Transfer rootfs</CMD>

<CMD type="push" body="frf">Finish Flashing NAND</CMD>

<CMD type="push" body="$ umount /mnt/ubi0">Unmounting</CMD>

<CMD type="push" body="$ echo Update Complete!">Done</CMD>

</LIST>

 

 

----------------------------------------------kernel cmd below-------------------------------------------------------

Kernel command line: noinitrd console=ttyAM0,115200 ubi.mtd=1 root=ubi0:rootfs0 rootfstype=ubifs rw gpmi

Outcomes