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.

Need help on custom UBIFS creation

Other Parts Discussed in Thread: TPS65910

hi,

I need help on  ubifs image creation.

We are following the following link as suggested by Ti forums.

http://www.linux-mtd.infradead.org/faq/ubifs.html#L_mkfubifs

We are using SDK 8. We are using arago-base-tisdk-image-am335x-evm filesystem. 

We are using the following commands to build the ubi image.

$ mkfs.ubifs -q -r root-fs -m 2048 -e 126976-c 2047 -o ubifs.img
$ ubinize -o ubi.img -m 2048 -p 128KiB -s 512 ubinize.cfg

 

Below is our ubinize cfg file

[ubifs]
mode=ubi
image=ubifs.img
vol_id=0
vol_size=240MiB
vol_type=dynamic
vol_name=rootfs
vol_flags=autoresize

 

But here the system is crashing with this image.

But the below log is coming with the SDK 8 arago-base-tisdk-image-am335x-evm.ubi

[    2.957138] ubi_init

[    2.960445] UBI: attaching mtd9 to ubi0

[    4.321184] UBI: scanning is finished

[    4.348919] UBI: volume 0 ("rootfs") re-sized from 273 to 1924 LEBs

[    4.357185] UBI: attached mtd9 (name "NAND.rootfs", size 246 MiB) to ubi0

[    4.364422] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes

[    4.371582] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 512

[    4.378569] UBI: VID header offset: 2048 (aligned 2048), data offset: 4096

[    4.385807] UBI: good PEBs: 1968, bad PEBs: 0, corrupted PEBs: 0

[    4.392145] UBI: user volume: 1, internal volumes: 1, max. volumes count: 128

Please correct us if anything above is wrong in generation of ubifs file.

  • Thanks Biser. We are following the same links and generated the new ubifs.img with mtb-utils and ubinize.cfg with mkfs.ubifs command
    but the system is crashing .
    We given rootfs path is :SDK-08/filesystem/arago-base-tisdk-image-am335x-evm (which is an untar file).

    1. We like to verify the commands with TI technical team.
    "mkfs.ubifs -q -r root-fs -m 2048 -e 126976-c 2047 -o ubifs.img " -- is that calculation right or wrong.

    2. Back trace for the kernel panic/crash dump:

    8.287466] lis3_reg: disabling
    [ 8.290795] vbat: disabling
    [ 8.293732] regulator-dummy: disabling
    [ 8.298639] omap-gpmc 50000000.gpmc: GPMC revision 6.0
    [ 8.304062] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
    [ 8.312758] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xda
    [ 8.319546] nand: Micron MT29F2G08ABAEAWP
    [ 8.323768] nand: 256MiB, SLC, page size: 2048, OOB size: 64
    [ 8.329766] nand: using OMAP_ECC_BCH8_CODE_HW ECC scheme
    [ 8.335842] 10 ofpart partitions found on MTD device omap2-nand.0
    [ 8.342254] Creating 10 MTD partitions on "omap2-nand.0":
    [ 8.347991] 0x000000000000-0x000000020000 : "NAND.SPL"
    [ 8.357546] 0x000000020000-0x000000040000 : "NAND.SPL.backup1"
    [ 8.367431] 0x000000040000-0x000000060000 : "NAND.SPL.backup2"
    [ 8.377339] 0x000000060000-0x000000080000 : "NAND.SPL.backup3"
    [ 8.393223] 0x000000080000-0x0000000c0000 : "NAND.u-boot-spl-os"
    [ 8.403211] 0x0000000c0000-0x0000001c0000 : "NAND.u-boot"
    [ 8.413209] 0x0000001c0000-0x0000001e0000 : "NAND.u-boot-env"
    [ 8.422893] 0x0000001e0000-0x000000200000 : "NAND.u-boot-env.backup1"
    [ 8.433292] 0x000000200000-0x000000a00000 : "NAND.kernel"
    [ 8.449414] 0x000000a00000-0x000010000000 : "NAND.rootfs"
    [ 8.670935] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
    [ 8.680853] tps65910 1-002d: No interrupt support, no core IRQ
    [ 8.693614] vrtc: 1800 mV
    [ 8.697010] vrtc: supplied by vbat
    [ 8.703077] vio: at 1500 mV
    [ 8.712396] vio: supplied by vbat
    [ 8.718595] vdd_mpu: 912 <--> 1375 mV at 1100 mV
    [ 8.723726] vdd_mpu: supplied by vbat
    [ 8.730579] vdd_core: 912 <--> 1150 mV at 1100 mV
    [ 8.735847] vdd_core: supplied by vbat
    [ 8.742109] vdd3: 5000 mV
    [ 8.747256] vdig1: at 1800 mV
    [ 8.750659] vdig1: supplied by vbat
    [ 8.756605] vdig2: at 1800 mV
    [ 8.759993] vdig2: supplied by vbat
    [ 8.765905] vpll: at 1800 mV
    [ 8.769209] vpll: supplied by vbat
    [ 8.774896] vdac: at 1800 mV
    [ 8.784245] vdac: supplied by vbat
    [ 8.790107] vaux1: at 1800 mV
    [ 8.793487] vaux1: supplied by vbat
    [ 8.799373] vaux2: at 3300 mV
    [ 8.802751] vaux2: supplied by vbat
    [ 8.808646] vaux33: at 3300 mV
    [ 8.812109] vaux33: supplied by vbat
    [ 8.818145] vmmc: 1800 <--> 3300 mV at 3300 mV
    [ 8.823072] vmmc: supplied by vbat
    [ 8.830028] 1-0030 supply HPVDD not found, using dummy regulator
    [ 8.836682] 1-0030 supply SPRVDD not found, using dummy regulator
    [ 8.843199] 1-0030 supply SPLVDD not found, using dummy regulator
    [ 8.850268] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 400 kHz
    [ 8.896781] remoteproc0: wkup_m3 is available
    [ 8.901482] remoteproc0: Note: remoteproc is still under development and considered experimental.
    [ 8.910973] remoteproc0: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.
    [ 8.922243] remoteproc0: Direct firmware load failed with error -2
    [ 8.928962] remoteproc0: Falling back to user helper
    [ 8.935691] davinci_evm sound.10: Sound SANJU snd_soc_instantiate_card 1
    [ 8.942757] davinci_evm sound.10: Sound Sanju ASoC: binding TLV320AIC3X at idx 0
    [ 8.950586] davinci_evm sound.10: running for loop to find entry 1
    [ 8.957119] davinci_evm sound.10: ASoC:SANJU CODEC DAI tlv320aic3x-hifi not registered
    [ 8.965465] davinci_evm sound.10: Sound SANJU 4
    [ 8.974793] davinci_evm sound.10: snd_soc_register_card failed (-517)
    [ 8.981780] platform sound.10: Driver davinci_evm requests probe deferral
    [ 8.994477] davinci_evm sound.10: Sound SANJU snd_soc_instantiate_card 1
    [ 9.001651] davinci_evm sound.10: Sound Sanju ASoC: binding TLV320AIC3X at idx 0
    [ 9.009489] davinci_evm sound.10: running for loop to find entry 1
    [ 9.016045] davinci_evm sound.10: ASoC:SANJU CODEC DAI tlv320aic3x-hifi not registered
    [ 9.024399] davinci_evm sound.10: Sound SANJU 4
    [ 9.032903] davinci_evm sound.10: snd_soc_register_card failed (-517)
    [ 9.039795] platform sound.10: Driver davinci_evm requests probe deferral
    [ 9.048013] UBI: attaching mtd9 to ubi0

    //-------------from here it is crashing -- unable to recovery --
    // ----this is due to mismatch of calculation in the generating the ubifs image.

    [ 9.052872] UBI warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read only 64 bytes, retry
    [ 9.065076] UBI warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read only 64 bytes, retry
    [ 9.077296] UBI warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read only 64 bytes, retry
    [ 9.089495] UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read 64 bytes
    [ 9.099902] CPU: 0 PID: 1 Comm: swapper Not tainted 3.14.26-g2489c02-dirty #128
    [ 9.107628] Backtrace:
    [ 9.110263] [<c0011268>] (dump_backtrace) from [<c0011404>] (show_stack+0x18/0x1c)
    [ 9.118267] r6:cf2dc000 r5:00000040 r4:ffffffb6 r3:00000000
    [ 9.124279] [<c00113ec>] (show_stack) from [<c058d634>] (dump_stack+0x20/0x28)
    [ 9.131948] [<c058d614>] (dump_stack) from [<c03b0f70>] (ubi_io_read+0x128/0x2ec)
    [ 9.139868] [<c03b0e48>] (ubi_io_read) from [<c03b1350>] (ubi_io_read_ec_hdr+0x4c/0x1f0)
    [ 9.148415] r10:c086eb54 r9:00000000 r8:00000000 r7:cf371800 r6:00000000 r5:cf2dc000
    [ 9.156717] r4:cf35bb14
    [ 9.159404] [<c03b1304>] (ubi_io_read_ec_hdr) from [<c03b57d0>] (ubi_attach+0x140/0x1310)
    [ 9.168042] r10:c086eb54 r9:00000000 r8:cf35bb00 r7:cf2dc000 r6:00000000 r5:cf349800
    [ 9.176343] r4:cf35bb14
    [ 9.179027] [<c03b5690>] (ubi_attach) from [<c03abe04>] (ubi_attach_mtd_dev+0x5e0/0xbb0)
    [ 9.187573] r10:cf349800 r9:00000028 r8:000007ff r7:cf2dc000 r6:00000000 r5:cf349800
    [ 9.195875] r4:333337d0
    [ 9.198570] [<c03ab824>] (ubi_attach_mtd_dev) from [<c07c2eb0>] (ubi_init+0x1f4/0x2c4)
    [ 9.206932] r10:cf349800 r9:c07ddc94 r8:c07ddc94 r7:0000004c r6:c07ddc90 r5:00000000
    [ 9.215218] r4:00000000
    [ 9.217916] [<c07c2cbc>] (ubi_init) from [<c00088b8>] (do_one_initcall+0xf4/0x150)
    [ 9.225912] r10:c07d4ef0 r9:cf06c000 r8:c07c2cbc r7:000000e0 r6:00000000 r5:00000007
    [ 9.234198] r4:c07e2d6c
    [ 9.236897] [<c00087c4>] (do_one_initcall) from [<c079fbf0>] (kernel_init_freeable+0xf0/0x1b8)
    [ 9.245993] r10:c07d4ef0 r9:c07d4ee8 r8:c079f4d0 r7:000000e0 r6:c083b380 r5:00000007
    [ 9.254279] r4:c07e2d6c
    [ 9.256992] [<c079fb00>] (kernel_init_freeable) from [<c05886b0>] (kernel_init+0x14/0xf4)
    [ 9.265629] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c058869c
    [ 9.273914] r4:c083b380
    [ 9.276614] [<c058869c>] (kernel_init) from [<c000e878>] (ret_from_fork+0x14/0x3c)
    [ 9.284597] r4:00000000 r3:cf06c000
    [ 9.288937] UBI warning: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 0:2048, read only 512 bytes, retry
    [ 9.301599] UBI warning: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 0:2048, read only 512 bytes, retry
    [ 9.314267] UBI warning: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 0:2048, read only 512 bytes, retry
    [ 9.327003] UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 0:2048, read 512 bytes
    [ 9.337891] CPU: 0 PID: 1 Comm: swapper Not tainted 3.14.26-g2489c02-dirty #128
    [ 9.345618] Backtrace:
    [ 9.348224] [<c0011268>] (dump_backtrace) from [<c0011404>] (show_stack+0x18/0x1c)
    [ 9.356224] r6:cf2dc000 r5:00000200 r4:ffffffb6 r3:00000000
    [ 9.362228] [<c00113ec>] (show_stack) from [<c058d634>] (dump_stack+0x20/0x28)
    [ 9.369872] [<c058d614>] (dump_stack) from [<c03b0f70>] (ubi_io_read+0x128/0x2ec)
    [ 9.377787] [<c03b0e48>] (ubi_io_read) from [<c03b1544>] (ubi_io_read_vid_hdr+0x50/0x220)
    [ 9.386425] r10:00000000 r9:00000004 r8:cf35bb00 r7:00000000 r6:cf371600 r5:cf2dc000
    [ 9.394711] r4:ffffffff
    [ 9.397411] [<c03b14f4>] (ubi_io_read_vid_hdr) from [<c03b5870>] (ubi_attach+0x1e0/0x1310)
    [ 9.406139] r10:c086eb54 r9:00000004 r8:cf35bb00 r7:cf2dc000 r6:00000000 r5:ffffffff
    [ 9.414425] r4:ffffffff
    [ 9.417122] [<c03b5690>] (ubi_attach) from [<c03abe04>] (ubi_attach_mtd_dev+0x5e0/0xbb0)
    [ 9.425670] r10:cf349800 r9:00000028 r8:000007ff r7:cf2dc000 r6:00000000 r5:cf349800
    [ 9.433956] r4:333337d0
    [ 9.436654] [<c03ab824>] (ubi_attach_mtd_dev) from [<c07c2eb0>] (ubi_init+0x1f4/0x2c4)
    [ 9.445002] r10:cf349800 r9:c07ddc94 r8:c07ddc94 r7:0000004c r6:c07ddc90 r5:00000000
    [ 9.453302] r4:00000000
    [ 9.455997] [<c07c2cbc>] (ubi_init) from [<c00088b8>] (do_one_initcall+0xf4/0x150)
    [ 9.463979] r10:c07d4ef0 r9:cf06c000 r8:c07c2cbc r7:000000e0 r6:00000000 r5:00000007
    [ 9.472279] r4:c07e2d6c
    [ 9.474961] [<c00087c4>] (do_one_initcall) from [<c079fbf0>] (kernel_init_freeable+0xf0/0x1b8)
    [ 9.484056] r10:c07d4ef0 r9:c07d4ee8 r8:c079f4d0 r7:000000e0 r6:c083b380 r5:00000007
    [ 9.492355] r4:c07e2d6c
    [ 9.495044] [<c079fb00>] (kernel_init_freeable) from [<c05886b0>] (kernel_init+0x14/0xf4)
    [ 9.503682] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c058869c
    [ 9.511982] r4:c083b380
    [ 9.514666] [<c058869c>] (kernel_init) from [<c000e878>] (ret_from_fork+0x14/0x3c)
    [ 9.522662] r4:00000000 r3:cf06c000
    [ 9.530780] UBI warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 1:0,


    Please help us in this.

    regards,

    Vijay.
  • Hello Vijai,

    The vol_size=240MiB seems doubtful, could you change it to vol_size=200MiB then check the result.

    Best regards,
    Kemal
  • Thank you. I have already made a change and still it doesnt work.
    Here is my ubinize.cfg file :
    [ubifs]
    mode=ubi
    image=ubifs.img
    vol_id=0
    vol_size=100MiB
    vol_type=dynamic
    vol_name=rootfs
    vol_flags=autoresize

    I have also used -F flags, but still not luck. There is a crash. The Nand chipset I am using is : MT29F2G08ABAEAWP
    Thank you
  • But the value is 100MiB, have you tried with 200MiB?
  • Hi,

    Thank you for helping us. It worked.

    Totally we made three changes .As suggested by Kemal R. Shakir, we have changed the

    vol_size=200MiB in ubinize.cfg file

    and we made subpage size equal to 2048 instead of 512. 

    sudo ubinize -o ubi.img -m 2048 -p 128KiB -s 2048 ubinize.cfg (sub-page size we made equal to 2048 instead of 512) .

    To create a ubi.img, we made use of -F flag in the below command.

    sudo mkfs.ubifs -F -q -r rootfs -m 2048 -e 126976 -c 2047 -o ubifs.img