Hello Piddy Piddy,
Probably there is problem with the parameters used to generate UBI rootfs, Yocto could generate the final UBI filesystem, already including ubinize command converting, please use the file <rootfs>.ubi created by Yocto directly.
You need to specify parameters to Yocto according to your target, I cannot reserve T1040RDB DDR3 board now, I use P1010RDB as an example to show you how to decide UBI related parameters.
root@p1010rdb-pb:~# ubinfo
UBI version: 1
Count of UBI devices: 0
UBI control device major/minor: 10:59
root@p1010rdb-pb:~# ls -l /dev/mtd7
crw------- 1 root root 90, 14 Jan 1 1970 /dev/mtd7
root@p1010rdb-pb:~# flash_erase /dev/mtd7 0 0
Erasing 512 Kibyte @ 2480000 -- 65 % complete flash_erase: Skipping bad block at 02500000
flash_erase: Skipping bad block at 02580000
Erasing 512 Kibyte @ 3780000 -- 100 % complete
root@p1010rdb-pb:~# ubiattach /dev/ubi_ctrl -m 7
UBI: attaching mtd7 to ubi0
UBI: scanning is finished
UBI: empty MTD device detected
UBI: attached mtd7 (name "NAND Compressed RFS Image", size 56 MiB) to ubi0
UBI: PEB size: 524288 bytes (512 KiB), LEB size: 516096 bytes
UBI: min./max. I/O unit sizes: 4096/4096, sub-page size 4096
UBI: VID header offset: 4096 (aligned 4096), data offset: 8192
UBI: good PEBs: 110, bad PEBs: 2, corrupted PEBs: 0
UBI: user volume: 0, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 0/0, WL threshold: 4096, image sequence number: 3408886590
UBI: available PEBs: 28, total reserved PEBs: 82, PEBs reserved for bad PEB handling: 78
UBI: background thread "ubi_bgt0d" started, PID 2829
UBI device number 0, total 110 LEBs (56770560 bytes, 54.1 MiB), available 28 LEBs (14450688 bytes, 13.8 MiB), LEB size 516096 bytes (504.0 KiB)
Just add the below lines to meta-fsl-ppc/images/fsl-image-minimal.bb:
MKUBIFS_ARGS = " -m 4096 -e 516096 -c 28 "
UBINIZE_ARGS = " -p 512KiB -m 4096 -s 4096 "
IMAGE_FSTYPES = "tar.gz ext2.gz ext2.gz.u-boot jffs2 ubi"
For the value of the parameters listed above can be got the Step1 display info:
-m smallest flash I/O unit
-e logical eraseblock size( May be "logical erase block size + 1k (or 2k) = physical eraseblock size ")
-c available LEBs
-p physical eraseblock size
-s -sub-page-size=<bytes> minimum input/output unit used for UBI headers,
e.g. sub-page size in case of NAND flash
(equivalent to the minimum input/output
unit size by default)
Have a great day,
Yiping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------