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.

CCS/AM6548: UBIFS create error

Part Number: AM6548

Tool/software: Code Composer Studio

Need support from TI on following error:

 

Error while creating OSPI.rootfs(UBIFS)  which is used to load on Flash.

Command to create ubifs is

sudo ./create-ubifs.sh

 

The syntax is

sudo ./create-ubifs.sh <image_rootfs_dir> [-o <image_name_prefix>] [-v <vol_name>]

 

I tried this command (sudo ./create-ubifs.sh <root dir> -o <image  name>​) and get error: Please see below screenshot.

Error: min.I/O unit was not specified (use -h for help)

Error: mksf.ubifs failed!

 

 

  • Update:

    We were able to find the appropriate arguments for the creation of UBIFS , 

    But now the file created after running the command is way to big 2.6 GB ( the size allocated is about 50 MB ) so what can we do to make an UBISF

    file that is </= than 50 MB ????

    Please advise!

     

     

  • Update:

    We were able to find the appropriate arguments for the creation of UBIFS , 

    But now the file created after running the command is way to big 2.6 GB ( the size allocated is about 50 MB ) so what can we do to make an UBISF

    file that is </= than 50 MB ????

    Please advise!

     

     

  • Hi Florin,

    the error you are seeing with create-ubifs.sh is due to it's missing defaults for the MKUBIFS_ARGS and UBINIZE_ARGS variables inside that script. This is a defect in our SDK and I filed an issue internally to track this (PLSDK-3104).

    I spent a bit of time with it and arrived at below parameters that allowed me to successfully build and use (boot) an OSPI image as follows:

    MKUBIFS_ARGS="-m 1 -e 130944 -c 448"
    UBINIZE_ARGS="-m 1 -s 1 -p 128KiB"

    You can find out more about those parameters here: http://www.linux-mtd.infradead.org/faq/ubifs.html#L_mkfubifs

    Now, to allow you actually to boot the AM654x from OSPI, there are a few more things you need to do that I'd like to provide for completeness sake. First, since the space in the on-board OSPI is limited (total of 64MB, also shared with U-Boot, SYSFW, etc.), you need to create a much smaller filesystem (smaller than the default targetNFS/ in the SDK) you can feed into create-ubifs.sh. Below are my steps creating such a filesystem and generating an actual UBI image you can flash into the OSPI.

    # Create work folder
    $ mkdir -p tmp/arago-tiny
    
    # Extract smaller <50MB-sized filesystem image which we use as a base for creating an UBI
    # image for programming into OSPI.
    $ sudo tar -C tmp/arago-tiny -xvf filesystem/arago-tiny-image-am65xx-evm.tar.xz
    
    # Add missing 'boot' folder artifacts (Kernel, DTBs). This is a know issue that those are
    # missing and has already been fixed on TI's internal 'next' release branches.
    $ sudo cp -vd targetNFS/boot/* tmp/arago-tiny/boot/
    
    # Build the UBI image. Note that we change the volume name to 'rootfs' otherwise it won't match
    # what U-Boot is expecting.
    $ sudo ./bin/create-ubifs.sh tmp/arago-tiny/ -v rootfs
    
    Parameters:
        image_rootfs_dir ..... "tmp/arago-tiny/"
        image_name_prefix .... "/opt/procsdk-linux-am65xx-evm-06.00.00.07/filesystem/custom-am65xx-evm-rootfs"
        vol_name ............. "rootfs"
    
    mkfs.ubifs
            root:         tmp/arago-tiny/
            min_io_size:  8
            leb_size:     130944
            max_leb_cnt:  448
            output:       /opt/procsdk-linux-am65xx-evm-06.00.00.07/filesystem/custom-am65xx-evm-rootfs.ubifs
            jrn_size:     7201920
            reserved:     0
            compr:        lzo
            keyhash:      r5
            fanout:       8
            orph_lebs:    1
            space_fixup:  0
            super lebs:   1
            master lebs:  2
            log_lebs:     4
            lpt_lebs:     2
            orph_lebs:    1
            main_lebs:    386
            gc lebs:      1
            index lebs:   5
            leb_cnt:      396
            UUID:         58230403-1553-4C91-BD7B-2EE42809075E
    Success!
    ubinize: LEB size:                  130944
    ubinize: PEB size:                  131072
    ubinize: min. I/O size:             1
    ubinize: sub-page size:             1
    ubinize: VID offset:                64
    ubinize: data offset:               128
    ubinize: UBI image sequence number: 1817218139
    ubinize: loaded the ini-file "/opt/procsdk-linux-am65xx-evm-06.00.00.07/filesystem/custom-am65xx-evm-rootfs.ubinize.cfg"
    ubinize: count of sections: 1
    
    ubinize: parsing section "ubifs"
    ubinize: mode=ubi, keep parsing
    ubinize: volume type: dynamic
    ubinize: volume ID: 0
    ubinize: volume size was not specified in section "ubifs", assume minimum to fit image "/opt/procsdk-linux-am65xx-evm-06.00.00.07/filesystem/custom-am65xx-evm-rootfs.ubifs"51853824 bytes (49.4 MiB)
    ubinize: volume name: rootfs
    ubinize: volume alignment: 1
    ubinize: autoresize flags found
    ubinize: adding volume 0
    ubinize: writing volume 0
    ubinize: image file: /opt/procsdk-linux-am65xx-evm-06.00.00.07/filesystem/custom-am65xx-evm-rootfs.ubifs
    
    ubinize: writing layout volume
    ubinize: done
    
    Success! The UBI image is available at "/opt/procsdk-linux-am65xx-evm-06.00.00.07/filesystem/custom-am65xx-evm-rootfs.ubi"
    

    I then make the image available via TFTP and load them into DDR on the AM654x EVM with the following U-Boot commands...

    => dhcp 0x80000000 custom-am65xx-evm-rootfs.ubi && sf probe && sf erase 0x800000 0x3800000 && sf update 0x80000000 0x800000 0x$filesize
    <cut>
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #############################################################
             1.7 MiB/s
    done
    Bytes transferred = 52166656 (31c0000 hex)
    SF: Detected mt35xu512aba with page size 256 Bytes, erase size 128 KiB, total 64 MiB
    SF: 58720256 bytes @ 0x800000 Erased: OK
    device 0 offset 0x800000, size 0x31c0000
    52166656 bytes written, 0 bytes skipped in 70.804s, speed 756038 B/s
    

    Then, booting from OSPI into Linux can be done as follows...

    => env set boot ubi
    => boot                                                                                                                                             
    switch to partitions #0, OK                                                                                                                         
    mmc1 is current device                                                                                                                              
    SD/MMC found on device 1                                                                                                                            
    ** Unable to read file boot.scr **                                                                                                                  
    1490 bytes read in 2 ms (727.5 KiB/s)                                                                                                               
    Loaded env from uEnv.txt                                                                                                                            
    Importing environment from mmc1 ...                                                                                                                 
    Running uenvcmd ...                                                                                                                                 
    1 bytes read in 1 ms (1000 Bytes/s)                                                                                                                 
    Already setup.                                                                                                                                      
    SF: Detected mt35xu512aba with page size 256 Bytes, erase size 128 KiB, total 64 MiB                                                                
    mtd: partition "ospi.rootfs" extends beyond the end of device "nor0" -- size truncated to 0x3800000                                                 
    ubi0: attaching mtd7                                                                                                                                
    ubi0: scanning is finished                                                                                                                          
    ubi0: attached mtd7 (name "ospi.rootfs", size 56 MiB)                                                                                               
    ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 130944 bytes                                                                                      
    ubi0: min./max. I/O unit sizes: 1/256, sub-page size 1                                                                                              
    ubi0: VID header offset: 64 (aligned 64), data offset: 128                                                                                          
    ubi0: good PEBs: 448, bad PEBs: 0, corrupted PEBs: 0                                                                                                
    ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128                                                                                  
    ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 1817218139                                                            
    ubi0: available PEBs: 0, total reserved PEBs: 448, PEBs reserved for bad PEB handling: 0                                                            
    Loading file '/boot/Image' to addr 0x80080000...                                                                                                    
    Done                                                                                                                                                
    Loading file '/boot/k3-am654-base-board.dtb' to addr 0x82000000...                                                                                  
    Done                                                                                                                                                
    ## Error: "get_overlay_ubi" not defined                                                                                                             
    ## Flattened Device Tree blob at 82000000                                                                                                           
       Booting using the fdt blob at 0x82000000                                                                                                         
       Loading Device Tree to 00000000fdeb7000, end 00000000fdecb880 ... OK                                                                             
                                                                                                                                                        
    Starting kernel ...                                                                                                                                 
                                                                                                                                                        
    [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]                                                                              
    [    0.000000] Linux version 4.19.38-g4dae378bbe (oe-user@oe-host) (gcc version 8.3.0 (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm
    -rel-8.36))) #1 SMP PREEMPT Sun Jul 7 03:42:51 UTC 2019                                                                                             
    [    0.000000] Machine model: Texas Instruments AM654 Base Board                                                                                    
    [    0.000000] earlycon: ns16550a0 at MMIO32 0x0000000002800000 (options '')                                                                        
    [    0.000000] bootconsole [ns16550a0] enabled
    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009b000000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@9b000000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009b100000, size 15 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-memory@9b100000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009c000000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@9c000000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009c100000, size 7 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-memory@9c100000, compatible id shared-dma-pool
    [    0.000000] cma: Reserved 512 MiB at 0x00000000c0000000
    <snip>
    [    2.974614] ubi0: attaching mtd6                                                                                                                 
    [    3.000640] ubi0: scanning is finished                                                                                                           
    [    3.006037] ubi0: attached mtd6 (name "ospi.rootfs", size 56 MiB)
    [    3.012160] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 130944 bytes
    [    3.019052] ubi0: min./max. I/O unit sizes: 1/256, sub-page size 1
    [    3.025254] ubi0: VID header offset: 64 (aligned 64), data offset: 128
    [    3.031792] ubi0: good PEBs: 448, bad PEBs: 0, corrupted PEBs: 0
    [    3.037806] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
    [    3.045038] ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 1817218139
    [    3.054179] ubi0: available PEBs: 0, total reserved PEBs: 448, PEBs reserved for bad PEB handling: 0
    [    3.063346] ubi0: background thread "ubi_bgt0d" started, PID 136
    [    3.064112] input: gpio-keys as /devices/platform/gpio-keys/input/input0
    [    3.076356] hctosys: unable to open rtc device (rtc0)
    [    3.174524] ALSA device list:
    [    3.177536]   No soundcards found.
    [    3.186436] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 137
    [    3.517855] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
    [    3.525288] UBIFS (ubi0:0): LEB size: 130944 bytes (127 KiB), min./max. I/O unit sizes: 8 bytes/256 bytes
    [    3.534867] UBIFS (ubi0:0): FS size: 56829696 bytes (54 MiB, 434 LEBs), journal size 7725696 bytes (7 MiB, 59 LEBs)
    [    3.545310] UBIFS (ubi0:0): reserved for root: 0 bytes (0 KiB)
    [    3.551154] UBIFS (ubi0:0): media format: w4/r0 (latest is w5/r0), UUID 58230403-1553-4C91-BD7B-2EE42809075E, small LPT model
    [    3.680565] VFS: Mounted root (ubifs filesystem) on device 0:17.
    [    3.841636] devtmpfs: mounted
    [    3.844902] Freeing unused kernel memory: 576K
    [    3.849403] Run /sbin/init as init process
    INIT: version 2.88 booting
    Framebuffer /dev/fb0 not detected
    Boot splashscreen disabled
    hwclock: can't open '/dev/misc/rtc': No such file or directory
    Mon Jul  8 01:20:18 UTC 2019
    hwclock: can't open '/dev/misc/rtc': No such file or directory
    [    5.091515] random: dd: uninitialized urandom read (512 bytes read)
    INIT: Entering runlevel: 5
    Configuring network interfaces... [    5.200112] TI DP83867 k3-cpsw-mdio:00: attached PHY driver [TI DP83867] (mii_bus:phy_addr=k3-cpsw-mdio:00, irq=POLL)
    udhcpc: started, v1.29.3
    udhcpc: sending discover
    [    6.228911] am65-cpsw-nuss 46000000.ethernet eth0: Link is Down
    [    8.277138] am65-cpsw-nuss 46000000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
    udhcpc: sending discover
    udhcpc: sending select for 192.168.1.100
    udhcpc: lease of 192.168.1.100 obtained, lease time 600
    done.
    hwclock: can't open '/dev/misc/rtc': No such file or directory
    Starting syslogd/klogd: done
    umount: /mnt/.psplash: not mounted.
    
     _____                    _____           _         _
    |  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_
    |     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
    |__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|
                  |___|                    |___|
    
    Arago Project http://arago-project.org am65xx-evm /dev/ttyS2
    
    Arago 2019.05 am65xx-evm /dev/ttyS2
    
    am65xx-evm login: root
    
    
    root@am65xx-evm:/# df -h
    Filesystem                Size      Used Available Use% Mounted on
    ubi0:rootfs              49.5M     45.8M      3.8M  92% /
    devtmpfs                  1.7G         0      1.7G   0% /dev
    tmpfs                     1.9G    384.0K      1.9G   0% /run
    tmpfs                    50.0M    320.0K     49.7M   1% /var/volatile
    
    

    Hope that helps.

    Thanks and Regards,
    Andreas