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-J721E: Custom DM image in u-boot in SDK 10

Part Number: PROCESSOR-SDK-J721E

Tool/software:

Hi,

I'm trying to migrate our software from SDK 8 to SDK 10.   I notice that the U-boot build in SDK 10 uses binman, where it did not in SDK 8.

We build our own MCU1_0 image and therefore we rebuild u-boot in order to incorporate it.

On SDK 8, that looks like this:

    export DM=/path/to/custom_dm
make -C /opt/ti-processor-sdk-linux-j7-evm-08_05_00_08/board-support/u-boot-2021.01+gitAUTOINC+7996ed51f1-g7996ed51f1
         CROSS_COMPILE=/opt/ti-processor-sdk-rtos-j721e-evm-08_05_00_11/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-
        ATF=/path/to/bl31.bin
        TEE=/path/to/bl32.bin
         O=/path/to/builddir

On SDK 10, we have renamed ATF to BL31 and added TI_DM (per https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-jacinto7/10_00_00_08/exports/docs/linux/Foundational_Components/U-Boot/UG-General-Info.html#build-u-boot), to get this:

    make -C /opt/ti-processor-sdk-linux-j7-evm-08_05_00_08/board-support/u-boot-2021.01+gitAUTOINC+7996ed51f1-g7996ed51f1
         CROSS_COMPILE=/opt/ti-processor-sdk-rtos-j721e-evm-08_05_00_11/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-
        BL31=/path/to/bl31.bin
        TEE=/path/to/bl32.bin
         TI_DM=/path/to/custom_dm
        O=/path/to/builddir

However, this appears to be not working correctly for the TI_DM variable, as I get the following warning:

    Image 'ti-dm' is missing optional external blobs but is still functional: blob-ext

And indeed, it does seem to have packed zero bytes (which we can see at BINMAN_VERBOSE=3):

    Writing image to './ti-dm.bin'
    Wrote 0x0 bytes
    Image 'ti-dm' is missing optional external blobs but is still functional: blob-ext

    /binman/ti-dm/blob-ext (ti-dm/j721e/ipc_echo_testb_mcu1_0_release_strip.xer5f):
    Missing blob

    Pack completed after 1 pass(es)

As far as I can tell, this is due to some disconnect between the "-a ti-dm-path" option to binman setting the "ti-dm" filename, not the "ti-dm/blob-ext" filename - and the former (default ti_dm.bin) is never supposed to exist.

Can someone please let me know what is the correct way to specify a custom DM image such that the A72 u-boot build is happy?

Many Thanks,

Ross O'Connor

  • I can make the error go away by setting BINMAN_INDIRS to the prebuild-images folder in the Linux SDK, but that causes it to completely ignore my DM binary:

    Writing image to './ti-dm.bin'
    Wrote 0x36cf0 bytes
    Pack completed after 1 pass(es)

    Where 0x36cf0 is 224496 bytes, which is the size of the default IPC echo test binary in pre-built-images, not the size of my own DM image (despite setting TI_DM= on the make command line).

  • go away by setting BINMAN_INDIRS to the prebuild-images folder in the Linux SDK,

    Okay. Did you copy the custom DM binary to the  pre-built-images/ti-dm/j721e folder?

    - Keerthy

  • No, the SDK is a read-only shared resource for our build, so we cannot modify it.

    That's why we're setting TI_DM on the command line, per the instructions in the SDK documentation.

  • The DM is getting picked up from that path and hence you see the default DM.

    - Keerthy

  • But this is a direct quote from the SDK 10 documentation for U-Boot:

    It is also possible to pick up a custom DM binary by adding TI_DM argument pointing to the file. If not provided, it defaults to picking up the DM binary from BINMAN_INDIRS. This is only applicable to devices that utilize split firmware.

    "If not provided", it says, and I am providing TI_DM - so it should use mine.

  • Hi Ross,

    We did reproduce the issue with relative paths. Can you try with absolute paths? We see no issue with using TI_DM with absolute path and it worked for us.
    Let us know if you still face issues.

    - Keerthy

  • Hi Keerthy,

    I was only ever using absolute paths, so it definitely doesn't work for me.

    I'll try and put a shell script together that replicates the problem and you can see if it works for you.

    Although there might be a small delay as today's my last day before Christmas break.

    Cheers,

    Ross

  • Hi Keerthy,

    This script reproduces the issue against SDK 10 installed (read-only) in /opt.

    8422.uboot_issue.sh.txt
    #!/usr/bin/bash -e
    
    PSDKR_PATH=/opt/ti-processor-sdk-rtos-j721e-evm-10_00_00_05
    PSDK_LINUX_PATH=/opt/ti-processor-sdk-linux-adas-j721e-evm-10_00_00_08
    
    ATF_DIR=$PSDK_LINUX_PATH/board-support/trusted-firmware-a-2.10+git
    UBOOT_DIR=$PSDK_LINUX_PATH/board-support/ti-u-boot-2024.04+git
    PREBUILT_DIR=$PSDK_LINUX_PATH/board-support/prebuilt-images
    CC_R5F=$PSDKR_PATH/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-
    CC_A72=$PSDKR_PATH/arm-gnu-toolchain-13.2.Rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-
    
    BUILD_DIR=$(readlink -f out)
    
    rm -fR $BUILD_DIR && mkdir -p $BUILD_DIR
    
    echo '*** Building ATF'
    make -sC $ATF_DIR BUILD_BASE=$BUILD_DIR/atf CROSS_COMPILE=$CC_A72 ARCH=aarch64 PLAT=k3 TARGET_BOARD=generic SPD=opteed BUILD_TYPE=release K3_USART=0 BL32_BASE=0x9e800000 PRELOADED_BL33_BASE=0x80080000 K3_HW_CONFIG_BASE=0x82000000 DEBUG=0
    
    # Don't have source for TEE
    echo '*** Building TEE'
    mkdir -p $BUILD_DIR/tee
    cp $PREBUILT_DIR/bl32.bin $BUILD_DIR/tee/bl32.bin
    
    # Any old junk for DM just to prove the point
    echo '*** Building DM'
    mkdir -p $BUILD_DIR/dm
    dd if=/dev/random of=$BUILD_DIR/dm/mcu1_0.bin bs=1024 count=200 status=none
    
    # Uboot A72
    echo '*** Building U-Boot A72'
    make -sC $UBOOT_DIR ARCH=arm CROSS_COMPILE=$CC_A72 HOSTCFLAGS="-Wno-stringop-overread" DTC_FLAGS="-Wno-unit_address_vs_reg -Wno-avoid_default_addr_size -Wno-reg_format" TEE=$BUILD_DIR/tee/bl32.bin BL31=$BUILD_DIR/atf/k3/generic/release/bl31.bin TI_DM=$BUILD_DIR/dm/mcu1_0.bin BINMAN_INDIRS=$PREBUILT_DIR BINMAN_VERBOSE=3 O=$BUILD_DIR/uboot/a72 j721e_evm_a72_defconfig
    
    make -sC $UBOOT_DIR ARCH=arm CROSS_COMPILE=$CC_A72 HOSTCFLAGS="-Wno-stringop-overread" DTC_FLAGS="-Wno-unit_address_vs_reg -Wno-avoid_default_addr_size -Wno-reg_format" TEE=$BUILD_DIR/tee/bl32.bin BL31=$BUILD_DIR/atf/k3/generic/release/bl31.bin TI_DM=$BUILD_DIR/dm/mcu1_0.bin BINMAN_INDIRS=$PREBUILT_DIR BINMAN_VERBOSE=3 O=$BUILD_DIR/uboot/a72 | tee $BUILD_DIR/uboot/a72.log
    
    PREBUILT_SIZE=$(stat --printf="%s" $PREBUILT_DIR/ti-dm/j721e/ipc_echo_testb_mcu1_0_release_strip.xer5f)
    CUSTOM_SIZE=$(stat --printf="%s" $BUILD_DIR/dm/mcu1_0.bin)
    USED_SIZE=$(fgrep -A1 ti-dm.bin $BUILD_DIR/uboot/a72.log |grep Wrote |cut -f2 -d' ')
    
    echo Size of original pre-build DM is $PREBUILT_SIZE bytes
    echo Size of custom DM is $CUSTOM_SIZE bytes
    echo Size of DM used by BINMAN is $(($USED_SIZE)) bytes
    
    (( $USED_SIZE == PREBUILT_SIZE )) && echo Binman used the PREBUILT image incorrectly
    (( $USED_SIZE == CUSTOM_SIZE )) && echo Binman used the CUSTOM image correctly
    

    When I run it, I get the output:

    Size of original pre-build DM is 224496 bytes
    Size of custom DM is 204800 bytes
    Size of DM used by BINMAN is 224496 bytes
    Binman used the PREBUILT image incorrectly

    Can you tell me what we need to change to make it work properly?

    Thanks,

    Ross

  • Ross,

    Thanks for the script. I will checkout the script to reproduce and get back to you.

    Thanks,
    Keerthy

  • Hello Ross,

    We are able to recreate the using your script. We will revert back to you once we have an update. Thanks for your patience.

    Best Regards,

    Keerthy 

  • Hello Ross,

    It seems like script is picking up wrong size.

    This is because the script is checking the A72 build log for ti-dm.bin which is not what is eventually written to the FIT image.

    So what is packed is not ti-dm.bin.

    Once your tispl.bin is generated, Please try:

    mkimage -l tispl.bin

    That will give the exact size of DM that is packed in tispl.bin.

    Best Regards,
    Keerthy

  • Hi Keerthy,

    Let me go off and check this, because the device doesn't boot when the DM is only specified using DM=, but it does boot when I copy it in to that folder, so there's something wrong with the generated files.  It might be an issue with my replication script - I'll get back to you.

    Cheers,

    Ross