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-AM57X: Issue with sourcing the environment

Part Number: PROCESSOR-SDK-AM57X


Tool/software:

Hello,

I've found the issue with the SDK, which I downloaded from here.

As it's described documentation I'm supposed to `source ./setupenv.sh` script, which fails with the following error:

Error!! Don't run pdksetupenv.sh, source it

The reason for the failure is this line in pdksetupenv.sh:

if [[ "$(basename -- "$0")" == "pdksetupenv.sh" ]]; then

It works only if you execute ./setupenv.sh, but when you source it, then $0 is expanded to `pdksetupenv.sh` instead, which is not what is supposed to happen. When this snippet is changed to

(return 0 2>/dev/null)
if [ $? -ne 0 ]; then

then it works as expected.

I couldn't find the proper place to report it, that's why I'm posting it here.

Environment: Ubuntu 24.04

  • Thank you Vyacheslav,

    Is this in reference to SDK 9.3?

    josue@jz-ws:~/data/sdk_s/am57x/processor_sdk_rtos_am57xx_09_03_00_00/pdk_am57xx_1_0_21/packages$ uname -a
    Linux jz-ws 6.8.0-65-generic #68~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 15 18:06:34 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
    josue@jz-ws:~/data/sdk_s/am57x/processor_sdk_rtos_am57xx_09_03_00_00/pdk_am57xx_1_0_21/packages$ source ./pdk
    pdkAppImageCreate.bat  pdkAppImageCreate.sh   pdkProjectCreate.bat   pdkProjectCreate.sh    pdksetupenv.bat        pdksetupenv.sh
    josue@jz-ws:~/data/sdk_s/am57x/processor_sdk_rtos_am57xx_09_03_00_00/pdk_am57xx_1_0_21/packages$ source ./pdksetupenv.sh
    /home/josue/data/sdk_s/am57x/processor_sdk_rtos_am57xx_09_03_00_00/pdk_am57xx_1_0_21/packages
    /home/josue/data/sdk_s/am57x/processor_sdk_rtos_am57xx_09_03_00_00/pdk_am57xx_1_0_21/packages
    **************************************************************************
    Environment Configuration:
    **************************************************************************
        SDK_INSTALL_PATH        : /home/josue/data/sdk_s/am57x/processor_sdk_rtos_am57xx_09_03_00_00
        PDK_INSTALL_PATH        : /home/josue/data/sdk_s/am57x/processor_sdk_rtos_am57xx_09_03_00_00/pdk_am57xx_1_0_21/packages
        PDK_SOC                 : am57xx
        PDK_VERSION             : 1_0_21
        RULES_MAKE              : /home/josue/data/sdk_s/am57x/processor_sdk_rtos_am57xx_09_03_00_00/pdk_am57xx_1_0_21/packages/ti/build/Rules.make
    **************************************************************************

    I do not see the same behavior..

    -Josue

  • Are you perhaps confusing these two?
    ./pdk_am57xx_1_0_21/packages/pdksetupenv.sh
    ./processor_sdk_rtos_am57xx_09_03_00_00/setupenv.sh

    -Josue

  • Correct, the doc says I need to source the setupenv.sh, not the pdksetupenv.sh. Am I doing something wrong or documentation is not entirely correct? The "documentation" above is a URL to a corresponding chapter.

  • I would say documentation is not entirely correct.

    You only need to source the pdk one and you can just run the sdk setup one.

    Best,

    Josue

  • It seems it did the trick, so what needs to be done then is just:

    ./setupenv.sh

    because this script sources the pdksetupenv.sh.

    Could you please fix the documentation?

  • Actually I was a bit confused with the output of the `setupenv.sh` and had some doubts, so I double checked again and all the variables that are set by `setupenv.sh` are of course not set after the script is just executed (as opposed to sourced). So the question again, what is supposed to be the correct workflow?

  • I did a few more tests and can confirm that when the `setupenv.sh` is not sourced then some generator utilities (like xdctools for example) are not found.

  • Hi,

    Thank you for bringing this documentation issue to our attention. We will log an internal bug, and the correction will be included in a future release. In the meantime, please use the command below to build, and kindly refer to the FAQ[FAQ] AM5728: Build and Test Guide for AM57xx Driver Examples using CCS  for additional guidance. Please let us know if this resolves your issue.

    <SDK Root>/pdk_[soc]_[version]/packages$source pdksetupenv.sh
    
    

    Regards,

    Karthik

  • Thanks for the link, but I would actually like to know how to build the projects without CCS (as in CI/CD setup). Do you have an example for that too? I don't intend to have any GUI support in my build environment.

  • Hi,

    No, PDK alone cannot build the examples, it only provides source and libraries. A build environment like CCS or a compatible build system is required.

    Regards,

    Karthik

  • I'm still not convinced. I'm able to build all the demos and I don't have CCS installed. The demos come with Makefiles (not the best though, because they are not relocatable), which is sufficient to build everything. Is it possible to generate required project files (xdctools, linker settings) with CCS so I don't have to install it for the CI?

  • Hi,

    I will check this internally and get back to you.

    Regards,

    Karthik

  • Hi,

    Do you have an example for that too? I don't intend to have any GUI support in my build environment.

    The diag examples in the TI Processor SDK AM57xx are designed to be built directly from the command line using the PDK toolchain, without needing CCS project support. The build generates a .out and app file, You can copy the generated diag binary(app) along with the MLO (SBL) onto the SD card, and then boot the board to run the example. Please refer to the attached procedure for detailed diag build and SD boot steps.

    MLO Path: pdk_am57xx_1_0_21/packages/ti/boot/sbl/binary/idkAM572x/mmcsd/bin/MLO

    step 1:
    <pdk>/packages/packages
    Run pdksetupenv.bat (windows) OR source pdksetupenv.sh (linux)
    
    step 2:
    <pdk>/packages/ti/board/diag
    Cmd:
    make idkAM572x_sd
    
    app File Path:
    <pdk>/packages/ti/board/bin/idkAM572x/sd
     
    .out File Path: 
    <pdk>/packages/ti/board/bin/idkAM572x/armv7

    Regards,
    Karthik