Problems with UBIFS boot

      Problems with UBIFS boot

      Hello,
      I have an ARM Stone A9 and I'm trying to boot the standard filesystem. I did the following steps:

      1) I downloaded the "rootfs_std-fsimx6-V2.0.ubifs" file from download area
      2) In the device - mtdpartsarmStoneA9 # mtdparts

      device nand0 <gpmi-nand>, # parts = 7
      #: name size offset mask_flags
      0: NBoot 0x00040000 0x00000000 1
      1: UserDef 0x000c0000 0x00040000 0
      2: Refresh 0x00040000 0x00100000 1
      3: UBoot 0x000c0000 0x00140000 1
      4: UBootEnv 0x00040000 0x00200000 1
      5: Kernel 0x005c0000 0x00240000 1
      6: TargetFS 0x07800000 0x00800000 0

      active partition: nand0,0 - (NBoot) 0x00040000 @ 0x00000000

      defaults:
      mtdids : nand0=gpmi-nand
      mtdparts: none

      3) nand erase.part TargetFS

      NAND erase.part: device 0 offset 0x800000, size 0x7800000
      Skipping bad block at 0x00c80000
      Skipping bad block at 0x01900000
      Erasing at 0x7fe0000 -- 100% complete.
      OK

      4) Create UBI part: "ubi part TargetFS"

      armStoneA9 # ubi part TargetFS
      UBI: attaching mtd1 to ubi0
      UBI: physical eraseblock size: 131072 bytes (128 KiB)
      UBI: logical eraseblock size: 126976 bytes
      UBI: smallest flash I/O unit: 2048
      UBI: VID header offset: 2048 (aligned 2048)
      UBI: data offset: 4096
      UBI: empty MTD device detected
      UBI: create volume table (copy #1)
      UBI: create volume table (copy #2)
      UBI: attached mtd1 to ubi0
      UBI: MTD device name: "mtd=6"
      UBI: MTD device size: 120 MiB
      UBI: number of good PEBs: 958
      UBI: number of bad PEBs: 2
      UBI: max. allowed volumes: 128
      UBI: wear-leveling threshold: 4096
      UBI: number of internal volumes: 1
      UBI: number of user volumes: 0
      UBI: available PEBs: 945
      UBI: total number of reserved PEBs: 13
      UBI: number of PEBs reserved for bad PEB handling: 9
      UBI: max/mean erase counter: 1/0

      5) Create volume: "ubi create rootfs"

      armStoneA9 # ubi create rootfs
      No size specified -> Using max size (119992320)
      Creating dynamic volume rootfs of size 119992320

      6) Upload FS: 'tftp rootfs_std-fsimx6-V2.0.ubifs'

      ...
      ########################################
      #################################################################
      #################################################################
      #
      6 MiB/s
      done
      Bytes transferred = 57266176 (0x369d000)

      7) Write to volume: 'ubi write $loadaddr rootfs $filesize'

      Writing to volume rootfs ... OK, 57266176 bytes stored

      Source: fs-net.de/assets/download/docu…FSiMX6_FirstSteps_eng.pdf

      Now, I set current bootargs:
      1) run .rootfs_ubifs
      2) run set_bootargs
      3) Saveevn

      The current "bootargs" are:
      bootargs=console=ttymxc1,115200 login_tty=ttymxc1,115200 mtdparts=gpmi-nand:256k(NBoot)ro,768k(UserDef),256k(Refresh)ro,768k(UBoot)ro,256k(UBootEnv)ro,5888K(Kernel)ro,-(TargetFS) rootfstype=ubifs ubi.mtd=TargetFS root=ubi0:rootfs ro
      bootcmd=run kernel; bootm

      But, when i try to boot using "reset" (i.e.) I recive the following error message:

      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 256 mtdblock0 (driver?)
      1f01 768 mtdblock1 (driver?)
      1f02 256 mtdblock2 (driver?)
      1f03 768 mtdblock3 (driver?)
      1f04 256 mtdblock4
      (driver?)
      1f05 5888 mtdblock5 (driver?)
      1f06 122880 mtdblock6 (driver?)
      Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
      [<8013252c>] (unwind_backtrace+0x0/0x13c) from [<806e7ad0>] (panic+0x74/0x19c)
      [<806e7ad0>] (panic+0x74/0x19c) from [<80008d1c>] (mount_block_root+0x16c/0x220)
      [<80008d1c>] (mount_block_root+0x16c/0x220) from [<80008f50>] (prepare_namespace+0x8c/0x184) ..........

      What I could doing wrong? :P I'm sure that the solution is very simple, but I find it... :oops: :oops: :oops: :oops:

      Thanks a lot
      Best regards.

      EDIT 1:
      I found this UBI error in the log:
      Creating 7 MTD partitions on "gpmi-nand":
      0x000000000000-0x000000040000 : "NBoot"
      0x000000040000-0x000000100000 : "UserDef"
      0x000000100000-0x000000140000 : "Refresh"
      0x000000140000-0x000000200000 : "UBoot"
      0x000000200000-0x000000240000 : "UBootEnv"
      0x000000240000-0x000000800000 : "Kernel"
      0x000000800000-0x000008000000 : "TargetFS"
      GPMI NAND driver registered. (IMX)
      UBI: attaching mtd6 to ubi0
      UBI: physical eraseblock size: 131072 bytes (128 KiB)
      UBI: logical eraseblock size: 126976 bytes
      UBI: smallest flash I/O unit: 2048
      UBI: VID header offset: 2048 (aligned 2048)
      UBI: data offset: 4096
      UBI: empty MTD device detected
      UBI: max. sequence number: 0
      UBI: create volume table (copy #1)
      UBI error: ubi_scan_get_free_peb: no free eraseblocks
      UBI error: ubi_init: cannot attach mtd6

      NOTE 2:
      I've updated to uImage_fsimx6.V2.0 (the default linux Kernel image from FS 2.0) and the log message (referred in NOTE 1) has changed:
      7 cmdlinepart partitions found on MTD device gpmi-nand
      Creating 7 MTD partitions on "gpmi-nand":
      0x000000000000-0x000000040000 : "NBoot"
      0x000000040000-0x000000100000 : "UserDef"
      0x000000100000-0x000000140000 : "Refresh"
      0x000000140000-0x000000200000 : "UBoot"
      0x000000200000-0x000000240000 : "UBootEnv"
      0x000000240000-0x000000800000 : "Kernel"
      0x000000800000-0x000008000000 : "TargetFS"
      GPMI NAND driver registered. (IMX)
      UBI: attaching mtd6 to ubi0
      UBI: physical eraseblock size: 131072 bytes (128 KiB)
      UBI: logical eraseblock size: 126976 bytes
      UBI: smallest flash I/O unit: 2048
      UBI: VID header offset: 2048 (aligned 2048)
      UBI: data offset: 4096
      UBI: max. sequence number: 492
      UBI error: ubi_read_volume_table: the layout volume was not found
      UBI error: ubi_init: cannot attach mtd6

      Post was edited 2 times, last by “mgsalinero” ().

      Yes, it is very important to not mix code from fsimx-V1.x and fsimx-V2.x. This even includes NBoot! With fsimx6-V2.x you'll need at least NBoot VN25.

      By the way since christmas 2015, we already have the release fsimx6-V2.1 online. So if you are switching to a newer version anyway, then please use V2.1. It has quite a few improvements over V2.0.

      Your F&S Support Team
      F&S Elektronik Systeme GmbH
      As this is an international forum, please try to post in English.
      Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.