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] Compiler/TDA2E: The steps to enable the early-boot late attach use-case in vision SDK 3.7 Linux

Part Number: TDA2E

Tool/software: TI C/C++ Compiler

Hi,

Can I know all the steps to enable the early-boot late attach use-case in vision SDK Linux?

  • Hi,

    Follow the below steps to enable the Early-boot usecase in vision SDK

    The below steps are validated with the tda2xx platform for vision SDK 3.7 & we used ubuntu 14.04 host machine for a build

    Refer the vision_sdk/docs/Linux/VisionSDK_Linux_UserGuide.pdf (Chapter 3.4: Build Linux Vision SDK for fast boot (Early boot and late attach of remote cores) ) or follow the below below steps to enable early-boot use-case.

    Steps for Build

    • Download the vision SDK
    cd ~/
    /* Download the SDK */
    wget https://software-dl.ti.com/processor-sdk-vision/esd/TDAx/vision-sdk/03_07_00_00//exports/PROCESSOR_SDK_VISION_03_07_00_00_setuplinux.bin
    chmod +x PROCESSOR_SDK_VISION_03_07_00_00_setuplinux.bin
    /* Recommending to install the SDK in the home directory [ /~ ] */
    ./PROCESSOR_SDK_VISION_03_07_00_00_setuplinux.bin  

    • Do the below changes in the vision_sdk/build/Rules.make

    MAKECONFIG?=tda2xx_evm_linux_all # The supported config is tda2xx_evm_linux_all, tda2px_evm_linux_all, tda2ex_evm_linux_all, etc

    • Add the below changes in vision_sdk/apps/configs/$MAKECONFIG/cfg.mk file

    EARLY_USECASE_ENABLE=yes

    • Install the package needed for the build
    sudo apt-get install -y ssh corkscrew gawk sed u-boot-tools dos2unix dtrx git lib32z1 lib32ncurses5 lib32bz2-1.0 libc6-i386 libc6:i386  libstdc++6:i386 libncurses5:i386 libz1:i386 libc6-dev-i386 device-tree-compiler mono-complete lzop

    • Install the A15 compiler, Linker
    cd ~/PROCESSOR_SDK_VISION_03_07_00_00/ti_components/os_tools/linux/linaro/
    wget https://releases.linaro.org/components/toolchain/binaries/5.3-2016.02/arm-linux-gnueabihf/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar.xz
    tar -xvf gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar.xz

    • Git setup is needed to clone the Kerenel, U-boot & SGX component, etc

    • Clone the Kernel, U-boot & SGX component, etc 
    cd ~/PROCESSOR_SDK_VISION_03_07_00_00/vision_sdk/build/
    ./hlos/scripts/linux/setup_linux.sh

    • Download and untar file system
    cd ~/PROCESSOR_SDK_VISION_03_07_00_00/ti_components/os_tools/linux/targetfs/
    chmod 777 ../targetfs/
    wget https://software-dl.ti.com/processor-sdk-vision/esd/TDAx/vision-sdk/03_07_00_00//exports/tisdk-rootfs-image-dra7xx-evm_vsdk_3_7.tar.xz --no-check-certificate
    tar xf tisdk-rootfs-image-dra7xx-evm_vsdk_3_7.tar.xz
    rm tisdk-rootfs-image-dra7xx-evm_vsdk_3_7.tar.xz
    

    • Apply the earlyboot-kernel-patches for kernel
    cd ~/PROCESSOR_SDK_VISION_03_07_00_00/ti_components/os_tools/linux/kernel/omap/
    /* The below one command is needed only for the VSDK 3.7 SDK to reset the Git commit */
    git reset --hard 9e4a96e876ff8cfffe8694f38f27635dfbc18f3f
    git am ../linux-kernel-addon/earlyboot-kernel-patches/*

    • By default, the early-boot use-case is enabled with the LVDS camera setup so if you don't have the setup, recommending to create your own usecase in the flollowing director
    /* Here the Early use-case is defined */
    ~/PROCESSOR_SDK_VISION_03_07_00_00/vision_sdk/apps/src/rtos/usecases/early_capture_late_weston

    • Build the code
    cd ~/PROCESSOR_SDK_VISION_03_07_00_00/vision_sdk/build/
    make linux
    make linux_install
    make -s -j depend
    make -s -j

    Steps to Run the Demo

    • Insert the SD card to host machine & create FAT32 & ext4 partion then copy all the required files to boot.
    cd ~/PROCESSOR_SDK_VISION_03_07_00_00/ti_components/os_tools/linux/targetfs/
    tar cvf tisdk-rootfs-image-dra7xx-evm.tar.xz ./*
    mv tisdk-rootfs-image-dra7xx-evm.tar.xz ~/PROCESSOR_SDK_VISION_03_07_00_00/vision_sdk/binaries/apps/tda2xx_evm_linux_all/hlos/linux/boot/
    cd ~/PROCESSOR_SDK_VISION_03_07_00_00/vision_sdk/build/
    sudo ./hlos/scripts/linux/mksdboot.sh --device /dev/<parent_device_name> --appname <MAKEAPPNAME> --makeconfig <MAKECONFIG>
    # ex: sudo ./hlos/scripts/linux/mksdboot.sh --device /dev/sdc --appname apps --makeconfig tda2xx_evm_linux_all
    

    • Only when the above steps are completed run the early-boot-update.sh utility, or else the system boot will fail due to missing dependencies.
    ./hlos/scripts/linux/early-boot-update.sh <makeconfig> <path to target FS> <path to boot-partition>
    # Ex: ./hlos/scripts/linux/early-boot-update.sh tda2xx_evm_linux_all ~/PROCESSOR_SDK_VISION_03_07_00_00/ti_components/os_tools/linux/targetfs /media/gaviraju/boot

    • Change the SYS-BOOT switch setting to SD boot mode

    • Refer the user-guide to know the board setup & capture pin setup for LVDS use-case

    • Insert the SD card into the board & make sure the UART terminal ready then power on the board

    • Now you will see the camera captured O/P on the display & you should see the log as below for SD boot mode
    reading single-stage-boot.dtb
    reading uImage
    reading uImage
    [    0.000000] Booting Linux on physical CPU 0x0
    [    0.000000] Initializing cgroup subsys cpuset
    [    0.000000] Initializing cgroup subsys cpu
    [    0.000000] Initializing cgroup subsys cpuacct
    [    0.000000] Linux version 4.4.84+ (x1046101local@udx1046101) (gcc version 5.3.1 20160113 (Linaro GCC 5.3-2016.02) ) #2 SMP PREEMPT Thu Jul 16 18:33:30 IST 2020
    [    0.000000] CPU: ARMv7 Processor [412fc0f2] revision 2 (ARMv7), cr=30c5387d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
    [    0.000000] Machine model: TI DRA742
    [    0.000000] bootconsole [earlycon0] enabled

    • Launch the Linux application to view the late use-case O/P, here weston background is the late use-case
    cd /opt/vision_sdk/
    ./vision_sdk_load.sh
    ./apps.out
    • Now you will see the weston background on the O/P display


     

    • You will notice the below log after launching the Linux apllication (apps.out)
    [HOST] [IPU2  ]      1.576459 s:  DISPLAY: Create in progress !!!
    [HOST] [IPU2  ]      1.577099 s:  DISPLAY: Create Done !!!
    [HOST] [IPU2  ]      1.675983 s:  DISPLAY: Start in progress !!!
    [HOST] [IPU2  ]      1.676075 s:  DISPLAY: Start Done !!!
    

    • The above log indicates the early use-case is started displaying the O/P at 1.67 seconds

    Thanks

    Gaviraju