This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello Sir:
It has created UBIFS image. we used a NAND Flash (Samsung K9F4G08UOD 8bits page size: 2048).
We were using a DVRRDK_2.80.00.10 and TI814X-LINUX-PSP-04.01.00.07 development.
This have created a generator rule for UBIFS.
mkfs.ubifs -r dm8148 -F -m 2048 -e 126976 -c 1024 -o ubifs.img
echo "[ubifs]" > ubicfg.ini
echo "mode=ubi" >> ubicfg.ini
echo "image=ubifs.img" >> ubicfg.ini
echo "vol_id=0" >> ubicfg.ini
echo "vol_type=dynamic" >> ubicfg.ini
echo "vol_name=rootfs" >> ubicfg.ini
ubinize -o dm8148_ubifs -p 128KiB -m 2048 -s 2048 -O 2048 ./ubicfg.ini
U-Boot booting tag:
setenv bootargs 'console=ttyO0,115200n8 rw ubi.mtd=10,2048 rootfstype=ubifs root=ubi0:rootfs mem=128M eth=00:0C:0C:A0:FF:FA earlyprintk notifyk.vpssm3_sva=0xBFD00000'
Kernel MTD partition:
[ 1.350000] m25p80 spi1.0: w25x32 (4096 Kbytes)
[ 1.360000] Creating 5 MTD partitions on "spi_flash":
[ 1.360000] 0x000000000000-0x000000020000 : "U-Boot-min"
[ 1.370000] 0x000000020000-0x000000060000 : "U-Boot"
[ 1.380000] 0x000000060000-0x000000062000 : "U-Boot Env"
[ 1.380000] 0x000000062000-0x0000002e2000 : "Kernel"
[ 1.390000] 0x0000002e2000-0x000000400000 : "File System"
[ 1.400000] omap2-nand driver initializing
[ 1.400000] NAND device: Manufacturer ID: 0xec, Chip ID: 0xdc (Samsung )
[ 1.410000] Creating 8 MTD partitions on "omap2-nand.0":
[ 1.410000] 0x000000000000-0x000000020000 : "U-Boot-min"
[ 1.420000] 0x000000020000-0x000000260000 : "U-Boot"
[ 1.430000] 0x000000260000-0x000000280000 : "U-Boot_Env"
[ 1.430000] 0x000000280000-0x000000780000 : "Kernel_Master"
[ 1.440000] 0x000000780000-0x000000c80000 : "Kernel_Slave"
[ 1.450000] 0x000000c80000-0x000008c80000 : "File_System_Master"
[ 1.510000] 0x000008c80000-0x000010c80000 : "File_System_Slave"
[ 1.570000] 0x000010c80000-0x000020000000 : "Others"
U-Boot wartting to NAND command:
mw.b 0x81000000 0xFF 0x002000000;
tftp 0x81000000 dm8148_ubifs;
nand erase 0x00c80000 0x008000000;
nand write 0x81000000 0x00c80000 ${filesize};
...................................
I don't know I did write to NAND flash. In first booting kernel why are getting somes messages.
[ 1.680000] UBI: attaching mtd10 to ubi0 [ 1.690000] UBI: physical eraseblock size: 131072 bytes (128 KiB) [ 1.690000] UBI: logical eraseblock size: 126976 bytes [ 1.700000] UBI: smallest flash I/O unit: 2048 [ 1.700000] UBI: sub-page size: 512 [ 1.710000] UBI: VID header offset: 2048 (aligned 2048) [ 1.720000] UBI: data offset: 4096 [ 1.810000] ata1: SATA link down (SStatus 0 SControl 300) [ 2.780000] UBI: max. sequence number: 0 [ 2.840000] UBI: volume 0 ("rootfs") re-sized from 129 to 1009 LEBs [ 2.840000] UBI: attached mtd10 to ubi0 [ 2.850000] UBI: MTD device name: "File_System_Master" [ 2.860000] UBI: MTD device size: 128 MiB [ 2.860000] UBI: number of good PEBs: 1023 [ 2.870000] UBI: number of bad PEBs: 1 [ 2.870000] UBI: number of corrupted PEBs: 0 [ 2.870000] UBI: max. allowed volumes: 128 [ 2.880000] UBI: wear-leveling threshold: 4096 [ 2.880000] UBI: number of internal volumes: 1 [ 2.890000] UBI: number of user volumes: 1 [ 2.890000] UBI: available PEBs: 0 [ 2.900000] UBI: total number of reserved PEBs: 1023 [ 2.900000] UBI: number of PEBs reserved for bad PEB handling: 10 [ 2.910000] UBI: max/mean erase counter: 1/0 [ 2.910000] UBI: image sequence number: 682723 [ 2.920000] UBI: background thread "ubi_bgt0d" started, PID 53 [ 3.050000] UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 171:0, written 0 bytes [ 3.060000] UBI error: erase_worker: failed to erase PEB 171, error -5 [ 3.070000] UBI: mark PEB 171 as bad [ 3.070000] UBI: 9 PEBs left in the reserve [ 3.230000] UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 222:0, written 0 bytes [ 3.240000] UBI error: erase_worker: failed to erase PEB 222, error -5 [ 3.240000] UBI: mark PEB 222 as bad [ 3.250000] UBI: 8 PEBs left in the reserve [ 3.300000] UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 232:0, written 0 bytes [ 3.310000] UBI error: erase_worker: failed to erase PEB 232, error -5 [ 3.320000] UBI: mark PEB 232 as bad [ 3.320000] UBI: 7 PEBs left in the reserve [ 3.730000] UBIFS: mounted UBI device 0, volume 0, name "rootfs" [ 3.730000] UBIFS: file system size: 126722048 bytes (123752 KiB, 120 MiB, 998 LEBs) [ 3.740000] UBIFS: journal size: 9023488 bytes (8812 KiB, 8 MiB, 72 LEBs) [ 3.750000] UBIFS: media format: w4/r0 (latest is w4/r0) [ 3.760000] UBIFS: default compressor: lzo [ 3.760000] UBIFS: reserved for root: 0 bytes (0 KiB) [ 3.770000] VFS: Mounted root (ubifs filesystem) on device 0:12. [ 3.780000] devtmpfs: mounted [ 3.780000] Freeing init memory: 208K [ 5.100000] UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 867:0, written 0 bytes [ 5.110000] UBI error: erase_worker: failed to erase PEB 867, error -5 [ 5.120000] UBI: mark PEB 867 as bad [ 5.130000] UBI: 6 PEBs left in the reserve
so I am trying second booting my system and it is show some messages.
[ 1.340000] ata1: SATA max UDMA/133 mmio [mem 0x4a140000-0x4a150fff] port 0x100 irq 16 [ 1.350000] m25p80 spi1.0: w25x32 (4096 Kbytes) [ 1.360000] Creating 5 MTD partitions on "spi_flash": [ 1.360000] 0x000000000000-0x000000020000 : "U-Boot-min" [ 1.370000] 0x000000020000-0x000000060000 : "U-Boot" [ 1.380000] 0x000000060000-0x000000062000 : "U-Boot Env" [ 1.380000] 0x000000062000-0x0000002e2000 : "Kernel" [ 1.390000] 0x0000002e2000-0x000000400000 : "File System" [ 1.400000] omap2-nand driver initializing [ 1.400000] NAND device: Manufacturer ID: 0xec, Chip ID: 0xdc (Samsung ) [ 1.410000] Creating 8 MTD partitions on "omap2-nand.0": [ 1.410000] 0x000000000000-0x000000020000 : "U-Boot-min" [ 1.420000] 0x000000020000-0x000000260000 : "U-Boot" [ 1.430000] 0x000000260000-0x000000280000 : "U-Boot_Env" [ 1.430000] 0x000000280000-0x000000780000 : "Kernel_Master" [ 1.440000] 0x000000780000-0x000000c80000 : "Kernel_Slave" [ 1.450000] 0x000000c80000-0x000008c80000 : "File_System_Master" [ 1.510000] 0x000008c80000-0x000010c80000 : "File_System_Slave" [ 1.570000] 0x000010c80000-0x000020000000 : "Others" [ 1.680000] UBI: attaching mtd10 to ubi0 [ 1.690000] UBI: physical eraseblock size: 131072 bytes (128 KiB) [ 1.690000] UBI: logical eraseblock size: 126976 bytes [ 1.700000] UBI: smallest flash I/O unit: 2048 [ 1.700000] UBI: sub-page size: 512 [ 1.710000] UBI: VID header offset: 2048 (aligned 2048) [ 1.720000] UBI: data offset: 4096 [ 1.810000] ata1: SATA link down (SStatus 0 SControl 300) [ 3.550000] UBI: max. sequence number: 7 [ 3.570000] UBI warning: print_rsvd_warning: cannot reserve enough PEBs for bad PEB handling, reserved 8, need 10 [ 3.580000] UBI: attached mtd10 to ubi0 [ 3.590000] UBI: MTD device name: "File_System_Master" [ 3.590000] UBI: MTD device size: 128 MiB [ 3.600000] UBI: number of good PEBs: 1017 [ 3.600000] UBI: number of bad PEBs: 7 [ 3.610000] UBI: number of corrupted PEBs: 0 [ 3.610000] UBI: max. allowed volumes: 128 [ 3.620000] UBI: wear-leveling threshold: 4096 [ 3.620000] UBI: number of internal volumes: 1 [ 3.630000] UBI: number of user volumes: 1 [ 3.630000] UBI: available PEBs: 0 [ 3.640000] UBI: total number of reserved PEBs: 1017 [ 3.640000] UBI: number of PEBs reserved for bad PEB handling: 8 [ 3.650000] UBI: max/mean erase counter: 2/0 [ 3.650000] UBI: image sequence number: 1451688079 [ 3.660000] UBI: background thread "ubi_bgt0d" started, PID 53 [ 3.710000] davinci_mdio davinci_mdio.0: davinci mdio revision 1.6 [ 3.710000] davinci_mdio davinci_mdio.0: detected phy mask fffffffc [ 3.720000] davinci_mdio.0: probed [ 3.720000] davinci_mdio davinci_mdio.0: phy[0]: device 0:00, driver unknown [ 3.730000] davinci_mdio davinci_mdio.0: phy[1]: device 0:01, driver unknown [ 3.740000] usbcore: registered new interface driver cdc_ether [ 3.740000] usbcore: registered new interface driver dm9601 [ 3.750000] Initializing USB Mass Storage driver... [ 3.760000] usbcore: registered new interface driver usb-storage [ 3.760000] USB Mass Storage support registered. [ 3.770000] usbcore: registered new interface driver usbserial [ 3.770000] usbserial: USB Serial Driver core [ 3.780000] mice: PS/2 mouse device common for all mice [ 3.780000] qt602240_ts 1-004a: __qt602240_read_reg: i2c transfer failed [ 3.790000] qt602240_ts: probe of 1-004a failed with error -5 [ 3.800000] omap_rtc omap_rtc: rtc core: registered omap_rtc as rtc0 [ 3.800000] i2c /dev entries driver [ 3.810000] Linux video capture interface: v2.00 [ 3.810000] usbcore: registered new interface driver uvcvideo [ 3.820000] USB Video Class driver (v1.0.0) [ 3.820000] OMAP Watchdog Timer Rev 0x00: initial timeout 60 sec [ 3.830000] usbcore: registered new interface driver usbhid [ 3.840000] usbhid: USB HID core driver [ 3.840000] notify_init : notify drivercreated for remote proc id 2 at physical Address 0xbfd00000 [ 3.850000] TCP cubic registered [ 3.860000] NET: Registered protocol family 17 [ 3.860000] Registering the dns_resolver key type [ 3.860000] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3 [ 3.880000] Power Management for TI81XX. [ 3.890000] Detected MACID=40:5f:c2:40:f6:93 [ 3.890000] Both MAC IDs are same in e-fuse [ 3.900000] Detected MACID=da:15:4f:b8:a3:d4 [ 3.900000] omap_rtc omap_rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800) [ 3.970000] UBI error: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 3:4096, read 126976 bytes [ 4.030000] UBI error: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 3:4096, read 126976 bytes [ 4.100000] UBI error: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 4:4096, read 126976 bytes [ 4.110000] UBIFS error (pid 1): ubifs_recover_master_node: failed to recover master node [ 4.120000] List of all partitions: [ 4.120000] 1f00 128 mtdblock0 (driver?) [ 4.130000] 1f01 256 mtdblock1 (driver?) [ 4.130000] 1f02 8 mtdblock2 (driver?) [ 4.140000] 1f03 2560 mtdblock3 (driver?) [ 4.140000] 1f04 1144 mtdblock4 (driver?) [ 4.150000] 1f05 128 mtdblock5 (driver?) [ 4.150000] 1f06 2304 mtdblock6 (driver?) [ 4.160000] 1f07 128 mtdblock7 (driver?) [ 4.170000] 1f08 5120 mtdblock8 (driver?) [ 4.170000] 1f09 5120 mtdblock9 (driver?) [ 4.180000] 1f0a 131072 mtdblock10 (driver?) [ 4.180000] 1f0b 131072 mtdblock11 (driver?) [ 4.190000] 1f0c 249344 mtdblock12 (driver?) [ 4.190000] No filesystem could mount root, tried: ubifs [ 4.200000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) [ 4.210000] Backtrace: [ 4.210000] [<c004abd0>] (dump_backtrace+0x0/0x110) from [<c03fd028>] (dump_stack+0x18/0x1c) [ 4.220000] r7:c4b81000 r6:c0070c38 r5:c002ef2c r4:c058da10 [ 4.220000] [<c03fd010>] (dump_stack+0x0/0x1c) from [<c03fd08c>] (panic+0x60/0x17c) [ 4.230000] [<c03fd02c>] (panic+0x0/0x17c) from [<c0009034>] (mount_block_root+0x1e0/0x220) [ 4.240000] r3:00000000 r2:00000020 r1:c4825f78 r0:c04c08dc [ 4.250000] [<c0008e54>] (mount_block_root+0x0/0x220) from [<c00091d4>] (prepare_namespace+0x94/0x1d4) [ 4.260000] [<c0009140>] (prepare_namespace+0x0/0x1d4) from [<c0008544>] (kernel_init+0x114/0x154) [ 4.270000] r5:c0008430 r4:c058d240 [ 4.270000] [<c0008430>] (kernel_init+0x0/0x154) from [<c0070c38>] (do_exit+0x0/0x5e4) [ 4.280000] r5:c0008430 r4:00000000
I don't know why happen ? please told me how to setting U-boot env.
Thank you.
Few things to take care.
1. Erase the complete partition before writing.
2. Write the exact file size.
3. Switch to BCH8 ECC algorithm.
These steps will improve the situation, but will not solve it completely. I'm currently looking into it in a latest version of EZSDK.
Hello Thomas:
Thank you for help.
I was trying UBIFS of U-boot with BCH8 ECC algorithm.
A trying command:
U-Boot wartting to NAND command:
mw.b 0x81000000 0xFF 0x002000000;
tftp 0x81000000 dm8148_ubifs;
nand erase 0x00c80000 0x008000000;
nandecc hw 2; (add BCH8 ECC command)
nand write 0x81000000 0x00c80000 ${filesize};
[ 1.400000] NAND device: Manufacturer ID: 0xec, Chip ID: 0xdc (Samsung ) [ 1.410000] Creating 8 MTD partitions on "omap2-nand.0": [ 1.410000] 0x000000000000-0x000000020000 : "U-Boot-min" [ 1.420000] 0x000000020000-0x000000260000 : "U-Boot" [ 1.430000] 0x000000260000-0x000000280000 : "U-Boot_Env" [ 1.430000] 0x000000280000-0x000000780000 : "Kernel_Master" [ 1.440000] 0x000000780000-0x000000c80000 : "Kernel_Slave" [ 1.450000] 0x000000c80000-0x000008c80000 : "File_System_Master" [ 1.510000] 0x000008c80000-0x000010c80000 : "File_System_Slave" [ 1.570000] 0x000010c80000-0x000020000000 : "Others" [ 1.680000] UBI: attaching mtd10 to ubi0 [ 1.690000] UBI: physical eraseblock size: 131072 bytes (128 KiB) [ 1.690000] UBI: logical eraseblock size: 126976 bytes [ 1.700000] UBI: smallest flash I/O unit: 2048 [ 1.700000] UBI: sub-page size: 512 [ 1.710000] UBI: VID header offset: 2048 (aligned 2048) [ 1.720000] UBI: data offset: 4096 [ 1.720000] UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read 64 bytes [ 1.730000] UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 0:2048, read 512 bytes [ 1.740000] UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 1:0, read 64 bytes [ 1.750000] UBI error: process_eb: bad image sequence number 406315690 in PEB 1, expected 1869911453 [ 1.760000] UBI error: ubi_init: cannot attach mtd10
Why is there such a problem with ECC error (e.g. UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read 64 bytes) ?
My MTD version is 1.5.0.
I got a ubiformat tool writing to NAND, but it was okay.
===============================
A command:
flash_eraseall /dev/mtd10
/usr/sbin/ubiformat /dev/mtd10 -s 2048 -f ./dm8148_ubifs
===============================
I don't know why are different with u-boot command to nand and ubiformat to nand ?
reference URL:
http://processors.wiki.ti.com/index.php/UBIFS_Support
http://processors.wiki.ti.com/index.php/DM814x_AM387x_PSP_U-Boot
http://processors.wiki.ti.com/index.php/EZSDK_Fast_Boot_Streaming_Video#Creating_the_UBI_Image
The BCH8 implementation is wrong. It calculates the ECC wrong. I'm trying to fix it during my free time. Please mail me @ renjith.thomas@pathpartnertech.com, I'll mail you the patch for enabling Hamming code. I'm unable to attach here as my Silverlight plugin is not working.