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.

[FAQ] How to generate Linux Appimage for Linux SBLs in MCU+ SDK

Devices covered: AM64x, AM62x, AM62A

The Linux SBLs from the MCU+ SDK support booting the Linux from PSDK. These Linux SBLs require a Linux Appimage to boot the Linux. It is noted that this Linux Appimage is generated using the ATF, OPTEE and A53 U-Boot SPL binaries from PSDK.

This FAQ addresses how to get these binaries, the other tools required and the steps to generate Linux Appimage.

  • The steps to generate the Linux Appimage are:

    Required Tools Installation → Getting the Unsigned Binaries → Editing the Config file → Generating the Linux Appimage

    Required Tools Installation

    To generate the Linux Appimage, we require the following tools: 1) PSDK and 2) GCC AARCH64 Compiler

    1) PSDK

    The PSDK can be installed using the device's PSDK page. It is recommended to go with the PSDK version >= 8.6 for the reasons to become clear later.

    It is noted that the PSDK can only be installed in Linux OS. For Windows users, the solution is to install and run the WSL or Linux Virtual Machine. Afterwards, the PSDK can be installed in these environments and then the required components binaries can be copied to Windows.

    2) GCC AARCH64 Compiler

    The GCC AARCH64 Compiler can be installed using the following guide in MCU+ SDK setup page: GCC AARCH64 Compiler

    It is noted that the compiler should be installed in the ${HOME}/ti for Linux or C:\ti for Windows. More importantly, the compiler folder structure in the extracted directory should like this

    gcc-arm-9.2-2019.12-mingw-w64-i686-aarch64-none-elf
    ├── .build_flags
    ├── aarch64-none-elf
    ├── bin
    ├── include
    ├── lib
    ├── libexec
    └── share

    Getting the Unsigned Binaries

    The MCU+ SDK requires the unsigned binaries of the three components (ATF, OPTEE & A53 SPL) required to build Linux Appimage. The PSDK used to and now also come with the prebuilt unsigned binary of A53 U-Boot SPL. Starting with v8.6, the PSDK also comes with the unsigned binaries of ATF & OPTEE.

    The mapping between the component and the respective unsigned binary name required for Linux Appimage is:

    Component Unsigned Binary Name (PSDK v8.6) Unsigned Binary Name (PSDK >=v9.0)
    ATF bl31.bin.unsigned bl31.bin
    OPTEE bl32.bin.unsigned bl32.bin
    A53 U-Boot SPL u-boot-spl.bin* u-boot-spl.bin*

    Note: The asterisk in A53 SPL binary name evaluates to device specific suffix. Like for AM64x, the A53 SPL prebuilt image name is u-boot-spl.bin-am64xx-evm

    These prebuilt binaries can be found at the following path: <PSDK PATH>/board-support/prebuilt-images

    Editing the Config file

    Now that the unsigned binaries are ready, it's time to edit, if required, the config file to update the variables containing path and names of the ATF, OPTEE & A53 SPL unsigned binaries. Everything else in the config file remains the same.

    The Linux Appimage generation tool in MCU+ SDK is located under <MCU+ SDK PATH>/tools/boot/linuxAppimageGen. We will work in the same directory to generate the Linux Appimage.

    The location of the config file (config.mak) vary depending on the device and it is as follows:

    Device Config file (config.mak)
    AM64x <MCU+ SDK PATH>/tools/boot/linuxAppimageGen
    AM62x, AM62AX <MCU+ SDK PATH>/tools/boot/linuxAppimageGen/board/<board-type>

    In this config.mak file, update the path to the folder where the previously mentioned unsigned binaries of ATF, OPTEE & A53 SPL are present. Also, if required, update the name of binaries in the config file.

    Generating the Linux Appimage

    Now that, everything is in place, it's time to run the final command to generate the Linux Appimage.

    The below command should be run from the <MCU+ SDK PATH>/tools/boot/linuxAppimageGen directory.

    Device Command for Windows Command for Linux
    AM64x gmake -s all make -s all
    AM62X, AM62A gmake -s BOARD=<board-type> all make -s BOARD=<board-type> all

    The gmake command comes with the CCS installation while the make command for Linux already comes with Linux OS. Please note the above command assumes the path to the build tool (gmake or make) is present in the PATH environment variables of the system.

    The above command will generate the Linux Appimage. If the DEVICE_TYPE in MCU+ SDK is set to GP then the MCU+ SDK will generate both the GP and HS-FS Linux Appimage identified by linux.appimage and linux.appimage.hs_fs. However, if DEVICE_TYPE is set to HS for HS-SE boards, the MCU+ SDK will generate the HS-SE Linux Appimage identified by the name linux.appimage.hs.

    Best Regards,

    Prashant