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.

AM62A7-Q1: AM62A filesystem cut off to 64MB

Part Number: AM62A7-Q1

Tool/software:

Dear expert,
In order to cost down, our customer want to cut off flash size to 64MB(include customer APP) but need change on the software to enable it. Would you please help provide guide to us? Thanks~

I can see the tisdk-tiny-image-am62axx-evm.tar.xz filesystem but seems it still beyond our expectation that totally 92MB not include customer's APP and AI model.

  • We need to figure out which components can be removed to reduce the size of your rootfs. This however depends on what your application stack needs and depends on, which is something you will need to guide.

    For this, you can examine your rootfs more closely (deeply), such as using this command...

    # du -h -d2
    
    ...or...
    
    # du -h -d3

    ...to figure out where are the biggest allocations, and think about which can be removed.

    The other thing is you can do is to review your build's manifest (at `deploy-ti/images/am62axx-evm/*manifest`) to identify packages which can be potentially removed.

    One quick thing you can try to is changing the init manager by adding the below to `conf/local.conf` to see if your system still works and what space savings you may get.

    # Reduce filesystem size by using sysvinit instead of systemd
    ARAGO_SYSVINIT = "1"

    Lastly, you can boot using a compressed Kernel image, this will help shave off like 13MB in size...

    Here's a proof of concept I just did for AM64, the results will be similar for AM62A.

    By default the Kernel size is 21.2MB...

    root@am64xx-evm:~# ls -alh /boot/Ima*
    lrwxrwxrwx    1 root     root          36 Mar  9 12:34 /boot/Image -> Image-6.12.17-ti-00771-gc85877d40f8e
    -rw-r--r--    1 root     root       21.2M Mar  9 12:34 /boot/Image-6.12.17-ti-00771-gc85877d40f8e

    ...however after compressing the kernel with gzip the size is reduced to 8.8MB (see the new file that was added)

    root@am64xx-evm:~# ls -alh /boot/Ima*
    lrwxrwxrwx    1 root     root          36 Mar  9 12:34 /boot/Image -> Image-6.12.17-ti-00771-gc85877d40f8e
    -rw-r--r--    1 root     root       21.2M Mar  9 12:34 /boot/Image-6.12.17-ti-00771-gc85877d40f8e
    -rw-r--r--    1 root     root        8.8M Mar  9 15:21 /boot/Image-6.12.17-ti-00771-gc85877d40f8e.gz

    Now when booting, we need to set two U-Boot environmental variables to designate a space that U-Boot can use for decompression purposes. And specify the new Kernel image file name...

    => env set kernel_comp_addr_r 0xb0000000
    => env set kernel_comp_size 0x10000000
    => env set name_kern Image-6.12.17-ti-00771-gc85877d40f8e.gz
    => boot

    With this the Kernel will get uncompressed during loading automatically. All the above steps can also be automated of course (including into U-Boot config, etc.)

    Another (simpler) way to do the above is load the kernel from a FIT image, by setting the U-Boot `boot_fit` environmental variable to `1`. The FIT image is already part of the rootfs, and actually already contains the kernel image in a compressed fashion. So you can just delete the `/boot/Image*` files altogether, immediately freeing up ~21MB.

    Regards, Andreas

  • Andreas,
    I think it can save some save some space but still can't meet the requirement. I want you can provide a tiny filesystem based on SDK9.2 that can include "Openvx, Opencv, gstream and edge AI components". Both of these can run some APP like inference on C7X, encode, ethernet and openCV. 

  • I think it can save some save some space but still can't meet the requirement

    Have you experimented with the suggestions I provided? How much savings were you able to achieve? Please provide details.

    I want you can provide a tiny filesystem based on SDK9.2 that can include "Openvx, Opencv, gstream and edge AI components". Both of these can run some APP like inference on C7X, encode, ethernet and openCV. 

    I think this will be an iterative development effort to get this working with whatever application needs you have and this is not something we can provide here in the context of the E2E forum. Hence I provided some steps earlier that should help you get started to do that yourself. If there's any specific aspect you are unclear about, please let me know.

    Andreas

  • Hi Andreas,

    Thanks a lot.

    I tried this step and it helps a lot.

    One quick thing you can try to is changing the init manager by adding the below to `conf/local.conf`

    the initial image tar file size is 29524240 bytes and after this step it becomes 21201912 bytes.

    The decompressed size reduce from 116MB to 67MB when I build yocto with 10.0 sdk. 

    However, we need v4l2 and edgeai tiovx apps or edgeai gstreamer to run the app. I added the following to the local.conf:

    Then use this to rebuild image:

    ~/yocto/tisdk/build$ MACHINE=am62axx-evm bitbake  tisdk-tiny-image -f

    And I get this error:

    processor@processor:~/yocto/tisdk/build$ MACHINE=am62axx-evm bitbake  tisdk-tiny-image -f
    WARNING: Duplicate inclusion for /home/processor/yocto/tisdk/sources/meta-arago/meta-arago-distro/conf/distro/include/branding-core.inc in /home/processor/yocto/tisdk/sources/meta-arago/meta-arago-distro/conf/distro/arago.conf
    WARNING: Duplicate inclusion for /home/processor/yocto/tisdk/sources/meta-arago/meta-arago-distro/conf/distro/include/branding-core.inc in /home/processor/yocto/tisdk/sources/meta-arago/meta-arago-distro/conf/distro/arago.conf
    NOTE: Started PRServer with DBfile: /home/processor/yocto/tisdk/build/cache/prserv.sqlite3, Address: 127.0.0.1:46271, PID: 2273852
    Loading cache: 100% |###############################################################################################################################################################################################################################################| Time: 0:00:04
    Loaded 11126 entries from dependency cache.
    Parsing recipes: 100% |#############################################################################################################################################################################################################################################| Time: 0:00:07
    Parsing of 7068 .bb files complete (7067 cached, 1 parsed). 11127 targets, 1753 skipped, 0 masked, 0 errors.
    NOTE: Resolving any missing task queue dependencies
    ERROR: Nothing RPROVIDES 'dropbearv4l-utils' (but /home/processor/yocto/tisdk/sources/meta-arago/meta-arago-distro/recipes-core/images/tisdk-tiny-image.bb RDEPENDS on or otherwise requires it)
    NOTE: Runtime target 'dropbearv4l-utils' is unbuildable, removing...
    Missing or unbuildable dependency chain was: ['dropbearv4l-utils']
    ERROR: Required build target 'tisdk-tiny-image' has no buildable providers.
    Missing or unbuildable dependency chain was: ['tisdk-tiny-image', 'dropbearv4l-utils']
    
    Summary: There were 2 WARNING messages.
    Summary: There were 2 ERROR messages, returning a non-zero exit code.
    

    Can you instruct us how to remove unneeded packages like python and add needed packages like v4l-utils?

    Regards,

    Adam

  • I'm currently traveling internationally so it'll take a couple of days before I can get back here.

  • Sorry I made a mistake that not putting space between two IMAGE_INSTALL. We are now able to add v4l-utils and some edgeai components into fs.

    Regards,

    Adam

  • Sorry I made a mistake that not putting space between two IMAGE_INSTALL

    Ok glad you found what the issue is, yes that's critical, and can sometimes get missed. It is because how the ":append" operator works.

    Regards,
    Andreas

  • Hi Andreas,

    Thanks for your quick response. Please keep this e2e open. We are still trying to make fs smaller.

    Regards,

    Adam

  • Adam,

    This is the minimum files required in rootfs to run full gstreamer application:

    /cfs-file/__key/communityserver-discussions-components-files/791/SDK10.0_5F00_min_2D00_rootfs.xlsx

    It is taking around 41MB. 

    We need to figure out way to generate this using yocto. Currently, we have stripped out everything that is not required.

    Thanks

    Yogesh

  • Yogesh,

    Please give the details how to generate it with Yocto and i'm not see the Linux kernel size exist in the excel. So could you confirm you are statistic all of files on you excel.