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.

PROCESSOR-SDK-AM65X: 32MB UBIFS for QSPI flash

Part Number: PROCESSOR-SDK-AM65X
Other Parts Discussed in Thread: AM6548

Hi  Team!

we have developed custom HW based on AM6548 series processor with 32MB QSPI flash. we are able to boot the HW till Bootloader and TFTP also working ....we are able to donwload the images from TFTP server.

now my issue is not able to create less size UBIFS to load into 32MB QSPI flash....

can anyone suggest from scratch how to create UBIFS with less size by using TI SDK for AM6548 series processor..

Thanks & Regards

Ram Murthy

  • Hello,

    We will need a day or so to investigate this and get back to you with some feedback. Thank you.

  • Hi !

    Thank you for your quick reply , sure we will wait for 1 more day to get the feedback on my query ...

    Thanks & Regards

    Garimella Srinivasu

  • Just wanted to tag our rep in here Barend Ungrod barend@ti.com

  • Attached some steps that shows how to create a small 20MB-sized UBI image (including Kernel and DTB) from artifacts included in the SDK, please see below. It includes showing the use of the "strip" command to reduce library sizes. I also added some comments to the different steps to make it a bit easier to follow.

    a0797059@jiji:/opt/procsdk-linux-am65xx-evm-06.01.00.08/filesystem
    $ tar -C arago-tiny-image-am65xx-evm -xvf arago-tiny-image-am65xx-evm.tar.xz
    
    # Baseline size
    a0797059@jiji:/opt/procsdk-linux-am65xx-evm-06.01.00.08/filesystem/arago-tiny-image-am65xx-evm
    $ du -h -d1
    680K    ./etc
    7.2M    ./sbin
    4.0K    ./run
    4.0K    ./tmp
    8.0K    ./home
    4.0K    ./boot
    4.0K    ./proc
    4.0K    ./dev
    1.3M    ./var
    8.9M    ./usr
    8.0K    ./mnt
    30M     ./lib
    4.0K    ./media
    4.0K    ./sys
    1.1M    ./bin
    49M     .
    
    # Strip all libraries
    $ ../../linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-linux-gnu-strip -v lib/*
    
    # Re-asses size
    $ du -h -d1
    680K    ./etc
    7.2M    ./sbin
    4.0K    ./run
    4.0K    ./tmp
    8.0K    ./home
    4.0K    ./boot
    4.0K    ./proc
    4.0K    ./dev
    1.3M    ./var
    8.9M    ./usr
    8.0K    ./mnt
    5.2M    ./lib
    4.0K    ./media
    4.0K    ./sys
    1.1M    ./bin
    25M  
    
    # Remove more stuff
    a0797059@jiji:/opt/procsdk-linux-am65xx-evm-06.01.00.08/filesystem/arago-tiny-image-am65xx-evm
    $ rm -v sbin/fsck*
    removed 'sbin/fsck'
    removed 'sbin/fsck.ext2'
    removed 'sbin/fsck.ext3'
    removed 'sbin/fsck.ext4'
    removed 'sbin/fsck.minix'
    a0797059@jiji:/opt/procsdk-linux-am65xx-evm-06.01.00.08/filesystem/arago-tiny-image-am65xx-evm
    $ rm -v sbin/mk*fs*
    removed 'sbin/mkdosfs'
    removed 'sbin/mke2fs'
    removed 'sbin/mke2fs.e2fsprogs'
    removed 'sbin/mkfs.ext2'
    removed 'sbin/mkfs.ext2.e2fsprogs'
    removed 'sbin/mkfs.ext3'
    removed 'sbin/mkfs.ext4'
    removed 'sbin/mkfs.minix'
    a0797059@jiji:/opt/procsdk-linux-am65xx-evm-06.01.00.08/filesystem/arago-tiny-image-am65xx-evm
    $ rm -v sbin/ldconfig 
    removed 'sbin/ldconfig'
    
    # Re-asses size
    a0797059@jiji:/opt/procsdk-linux-am65xx-evm-06.01.00.08/filesystem/arago-tiny-image-am65xx-evm
    $ du -h -d1
    680K    ./etc
    1.5M    ./sbin
    4.0K    ./run
    4.0K    ./tmp
    8.0K    ./home
    4.0K    ./boot
    4.0K    ./proc
    4.0K    ./dev
    1.3M    ./var
    8.9M    ./usr
    8.0K    ./mnt
    5.2M    ./lib
    4.0K    ./media
    4.0K    ./sys
    1.1M    ./bin
    19M     .
    
    # Populate Kernel and DTBs into rootfs
    a0797059@jiji:/opt/procsdk-linux-am65xx-evm-06.01.00.08
    $ cp -v targetNFS/boot/Image filesystem/arago-tiny-image-am65xx-evm/boot/
    'targetNFS/boot/Image' -> 'filesystem/arago-tiny-image-am65xx-evm/boot/Image'
    a0797059@jiji:/opt/procsdk-linux-am65xx-evm-06.01.00.08
    $ cp -v targetNFS/boot/k3-am654-base-board.dtb filesystem/arago-tiny-image-am65xx-evm/boot/
    'targetNFS/boot/k3-am654-base-board.dtb' -> 'filesystem/arago-tiny-image-am65xx-evm/boot/k3-am654-base-board.dtb'
    a0797059@jiji:/opt/procsdk-linux-am65xx-evm-06.01.00.08
    $ cp -v targetNFS/boot/k3-am654-gp.dtbo filesystem/arago-tiny-image-am65xx-evm/boot/
    'targetNFS/boot/k3-am654-gp.dtbo' -> 'filesystem/arago-tiny-image-am65xx-evm/boot/k3-am654-gp.dtbo'
    
    # Re-asses size
    a0797059@jiji:/opt/procsdk-linux-am65xx-evm-06.01.00.08
    $ du -h -d1 filesystem/arago-tiny-image-am65xx-evm/
    680K    filesystem/arago-tiny-image-am65xx-evm/etc
    1.5M    filesystem/arago-tiny-image-am65xx-evm/sbin
    4.0K    filesystem/arago-tiny-image-am65xx-evm/run
    4.0K    filesystem/arago-tiny-image-am65xx-evm/tmp
    8.0K    filesystem/arago-tiny-image-am65xx-evm/home
    13M     filesystem/arago-tiny-image-am65xx-evm/boot
    4.0K    filesystem/arago-tiny-image-am65xx-evm/proc
    4.0K    filesystem/arago-tiny-image-am65xx-evm/dev
    1.3M    filesystem/arago-tiny-image-am65xx-evm/var
    8.9M    filesystem/arago-tiny-image-am65xx-evm/usr
    8.0K    filesystem/arago-tiny-image-am65xx-evm/mnt
    5.2M    filesystem/arago-tiny-image-am65xx-evm/lib
    4.0K    filesystem/arago-tiny-image-am65xx-evm/media
    4.0K    filesystem/arago-tiny-image-am65xx-evm/sys
    1.1M    filesystem/arago-tiny-image-am65xx-evm/bin
    32M     filesystem/arago-tiny-image-am65xx-evm/
    
    # Turn rootfs into an UBI image
    # Also see e2e.ti.com/.../3138731 for
    # updates that 'create-ubifs.sh' might need
    a0797059@jiji:/opt/procsdk-linux-am65xx-evm-06.01.00.08
    $ sudo bin/create-ubifs.sh filesystem/arago-tiny-image-am65xx-evm -v rootfs
    
    Parameters:
        image_rootfs_dir ..... "filesystem/arago-tiny-image-am65xx-evm"
        image_name_prefix .... "/opt/procsdk-linux-am65xx-evm-06.01.00.08/filesystem/custom-am65xx-evm-rootfs"
        vol_name ............. "rootfs"
    
    mkfs.ubifs
            root:         filesystem/arago-tiny-image-am65xx-evm/
            min_io_size:  8
            leb_size:     130944
            max_leb_cnt:  448
            output:       /opt/procsdk-linux-am65xx-evm-06.01.00.08/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:    137
            gc lebs:      1
            index lebs:   3
            leb_cnt:      147
            UUID:         21E81922-47E1-4A06-8527-3DDECC1B5F1D
    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: 517584410
    ubinize: loaded the ini-file "/opt/procsdk-linux-am65xx-evm-06.01.00.08/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.01.00.08/filesystem/custom-am65xx-evm-rootfs.ubifs"19248768 bytes (18.3 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.01.00.08/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.01.00.08/filesystem/custom-am65xx-evm-rootfs.ubi"
    
    # Check final UBI size
    a0797059@jiji:/opt/procsdk-linux-am65xx-evm-06.01.00.08
    $ ll filesystem/*.ubi
    -rw-r--r-- 1 root root 19529728 Feb 13 17:46 filesystem/custom-am65xx-evm-rootfs.ubi

    Regards, Andreas

  • Thanks Andreas! I also wanted to echo the recommendation you made to increase the size of the QSPI flash - while we are able to fit this UBIFS, it doesn't leave much room for any other application this customer may need to implement in the future. @Garimella

  • Thank you for all your efforts Andreas!

  • Thanks everybody for closing the loop here. Also just to state the obvious, I was just trimming the filesystem to make it smaller. What you can actually trim (and what to add) will ultimately be dependent on the application/system. Just the fact we made a minimal image fit doesn't mean it'll be able to do something meaningful. So as said earlier I think 32MB are on the small side for an AM654-based system running Linux. You also want to consider about things like field-firmware updates and so on (dual image?).

    Closing this thread now. Please open another one if anything else is needed on this front.

    Regards, Andreas