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.

UBIFS on AM3517

Other Parts Discussed in Thread: AM3517

 

Hi, 

I am trying to boot an AM3517 with an UBIFS file system.

Right now I am using the file system that comes with  the 37's examples (AM37X EVM UBIFS NAND Flash Images), only to see if it works 

 

The steps that I'm following are 

1) Format the device ./ubiformat /dev/mtd/mtd4 -f ubi.img

 

Here's the output of the ubiattach

 

# ./ubiattach /dev/ubi_ctrl -m 4

UBI: attaching mtd4 to ubi0

UBI: physical eraseblock size:   131072 bytes (128 KiB)

UBI: logical eraseblock size:    129024 bytes

UBI: smallest flash I/O unit:    2048

UBI: sub-page size:              512

UBI: VID header offset:          512 (aligned 512)

UBI: data offset:                2048

UBI: attached mtd4 to ubi0

UBI: MTD device name:            "jffs2-nand"

UBI: MTD device size:            248 MiB

UBI: number of good PEBs:        1988

UBI: number of bad PEBs:         0

UBI: max. allowed volumes:       128

UBI: wear-leveling threshold:    4096

UBI: number of internal volumes: 1

UBI: number of user volumes:     1

UBI: available PEBs:             0

UBI: total number of reserved PEBs: 1988

UBI: number of PEBs reserved for bad PEB handling: 19

UBI: max/mean erase counter: 1/0

UBI: image sequence number: 155038538

UBI: background thread "ubi_bgt0d" started, PID 1766

UBI device number 0, total 1988 LEBs (256499712 bytes, 244.6 MiB), available 0 LEBs (0 bytes), LEB size 129024 bytes (126.0 KiB)

 

The output of the kernel loading is encouraging because it shows how it attaches the ubi to the mtd, more o less the same as when I do it myself from the command line.

 

NAND device: Manufacturer ID: 0x2c, Chip ID: 0xca (Micron NAND 256MiB 3,3V 16-bit)

Creating 5 MTD partitions on "omap2-nand.0":

0x000000000000-0x000000080000 : "xloader-nand"

0x000000080000-0x000000240000 : "uboot-nand"

0x000000240000-0x000000280000 : "params-nand"

0x000000280000-0x000000780000 : "linux-nand"

0x000000780000-0x000010000000 : "jffs2-nand"

UBI: attaching mtd4 to ubi0

UBI: physical eraseblock size:   131072 bytes (128 KiB)

UBI: logical eraseblock size:    129024 bytes

UBI: smallest flash I/O unit:    2048

UBI: sub-page size:              512

UBI: VID header offset:          512 (aligned 512)

UBI: data offset:                2048

UBI: attached mtd4 to ubi0

UBI: MTD device name:            "jffs2-nand"

UBI: MTD device size:            248 MiB

UBI: number of good PEBs:        1988

UBI: number of bad PEBs:         0

UBI: max. allowed volumes:       128

UBI: wear-leveling threshold:    4096

UBI: number of internal volumes: 1

UBI: number of user volumes:     1

UBI: available PEBs:             0

UBI: total number of reserved PEBs: 1988

UBI: number of PEBs reserved for bad PEB handling: 19

UBI: max/mean erase counter: 1/0

UBI: image sequence number: 155038538

UBI: background thread "ubi_bgt0d" started, PID 441

 

but I'm having a problem at mounting time 

 

VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0)

Please append a correct "root=" boot option; here are the available partitions:

1f00             512 mtdblock0 (driver?)

1f01            1792 mtdblock1 (driver?)

1f02             256 mtdblock2 (driver?)

1f03            5120 mtdblock3 (driver?)

1f04          254464 mtdblock4 (driver?)

1f05          247590 mtdblock5 (driver?)

b300         3872256 mmcblk0 driver: mmcblk

  b301           72261 mmcblk0p1

  b302         1935832 mmcblk0p2

  b303         1863540 mmcblk0p3

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

 

I reckon that is has to be something related to u-boot, to the parameters that we are passing to the kernel or the UBI support of the u-boot. Any clue?

 

I've tried with different u-boot parameters like 

 

root=/dev/mtdblock4 ubi.mtd=4

root=/dev/mtd/mtd4 ubi.mtd=4

root=ubi0 ubi.mtd=4

root=ubi0:rootfs ubi.mtd=4

 

but none of then works.

 

My u-boot parameters

 

baudrate=115200

bootfile=uImage

dieid#=7ddc000100000000015da3960400400b

ethact=DaVinci EMAC

filesize=6F2F0

ethaddr=f8:dc:7a:00:18:e3

netmask=255.255.255.0

gatewayip=192.168.3.254

serverip=192.168.3.12

ipaddr=192.168.3.17

get_kernel=run nand_kernel

mmc_kernel=mmc init; fatload mmc 1 0x80000000 uImage

nand_kernel=nand read.i 0x80000000 280000 300000

tftp_kernel=tftpboot 0x80000000 uImage

bootargs_fs_dvi=mem=256M console=ttyS2,115200n8 noinitrd root=/dev/mtdblock4 rw rootfstype=jffs2 omapfb.mode=dvi:1280x720-24@60 omapdss.def_disp=dvi

bootargs_nfs=mem=256M console=ttyS2,115200n8 noinitrd rw root=/dev/nfs nfsroot=/mnt/nfs,nolock ip=dhcp

boot_fs_dvi=run get_kernel; setenv bootargs $bootargs_fs_dvi; run addip; bootm 0x80000000

boot_nfs=run get_kernel; setenv bootargs $bootargs_nfs; run addip; bootm 0x80000000

bootcmd=run boot_ubi_nand

bootdelay=2

boot_fs_nand=run get_kernel; setenv bootargs $bootargs_fs_nand; run addip; bootm 0x80000000

bootargs_fs_mmc=mem=256M console=ttyS2,115200n8 androidboot.console=ttyS2 noinitrd root=/dev/mmcblk0p2 rw init=/init rootfstype=ext3 rootdelay=1

boot_fs_mmc=run get_kernel; setenv bootargs $bootargs_fs_mmc; run addip; bootm 0x80000000

bootargs_fs_nand=mem=256M console=ttyS2,115200n8 androidboot.console=ttyS2 noinitrd root=/dev/mtdblock4 rw init=/init rootfstype=jffs2 rootdelay=1

bootargs=mem=256M console=ttyS2,115200n8 androidboot.console=ttyS2 noinitrd root=/dev/mtdblock4 rw init=/init rootfstype=jubifs ubi.mtd=4 rootdelay=1

boot_ubi_nand=run get_kernel; setenv bootargs $bootargs_ubi_nand; run addip; bootm 0x80000000

bootargs_ubi_nand=mem=256M console=ttyS2,115200n8 androidboot.console=ttyS2 noinitrd root=ubi0:rootfs rw init=/init rootfstype=ubifs ubi.mtd=4 rootwait bootdelay=2 ethaddr=$(ethaddr) ip=192.168.3.17

stdin=serial

stdout=serial

stderr=serial

 

Thanks in advance.

 

  • Hi,

    same symptoms.Any update ?

    On my target, seems to be some sub-pages problem.

    Here the mtd test:

    insmod /mnt/usr/ko/mtd_subpagetest.ko dev=6
    [ 2257.868255]
    [ 2257.869842] =================================================
    [ 2257.876037] mtd_subpagetest: MTD device: 6
    [ 2257.880432] mtd_subpagetest: MTD device size 268435456, eraseblock size 131072, page size 2048, subpage size 512, count of eraseblocks 0, pages per eraseblock 0, OOB size 64
    [ 2257.896789] mtd_subpagetest: scanning for bad eraseblocks
    [ 2257.910980] mtd_subpagetest: block 49 is bad
    [ 2257.916381] mtd_subpagetest: block 51 is bad
    [ 2257.980743] mtd_subpagetest: block 925 is bad
    [ 2257.986236] mtd_subpagetest: block 927 is bad
    [ 2258.066802] mtd_subpagetest: scanned 2048 eraseblocks, 4 are bad
    [ 2258.073181] mtd_subpagetest: erasing whole device
    [ 2259.117248] mtd_subpagetest: erased 2048 eraseblocks
    [ 2259.122436] mtd_subpagetest: writing whole device
    [ 2259.129577] mtd_subpagetest: written up to eraseblock 0
    [ 2259.391143] mtd_subpagetest: written up to eraseblock 256
    [ 2259.654937] mtd_subpagetest: written up to eraseblock 512
    [ 2259.918640] mtd_subpagetest: written up to eraseblock 768
    [ 2260.180297] mtd_subpagetest: written up to eraseblock 1024
    [ 2260.443878] mtd_subpagetest: written up to eraseblock 1280
    [ 2260.708129] mtd_subpagetest: written up to eraseblock 1536
    [ 2260.971801] mtd_subpagetest: written up to eraseblock 1792
    [ 2261.234436] mtd_subpagetest: written 2048 eraseblocks
    [ 2261.239837] mtd_subpagetest: verifying all eraseblocks
    [ 2261.245544] mtd_subpagetest: error: read failed at 0x0
    [ 2261.251037] mtd_subpagetest: error -74 occurred
    [ 2261.255859] =================================================
    insmod: can't insert '/mnt/usr/ko/mtd_subpagetest.ko': Bad message

     

     

     

  • Yes mate, I've done it. 

    My problem was that I didn't have ubifs in my filesystems, cat /proc/filesystems.

    It was an unset flag in the kernel, be sure that all of these are alright before compiling it.

     

     

    CONFIG_MTD_UBI=y

    CONFIG_MTD_UBI_WL_THRESHOLD=4096

    CONFIG_MTD_UBI_BEB_RESERVE=1

    CONFIG_UBIFS_FS=y

    CONFIG_UBIFS_FS_LZO=y

    CONFIG_UBIFS_FS_ZLIB=y

     

     

    Cheers.