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.

How to add libs to test.bld

Other Parts Discussed in Thread: SYSBIOS

Hello,

Lee Holeva explained me in this thread how I can use "bios_6_x_x_x_x/packages/ti/sysbios/build/test.bld" to build my own syslink programs on the linux commandline. It worked very good: I got some work done which I didn't manage with CCS. Thank you, Lee!

But now I'm a bit stuck again: I need to use edma3 and don't know how to add the edma3 libraries to the build. I added /opt/ti/edma3_lld_02_11_02_04/packages to the XDCPATH and tried to use "lopts" in package.bld:

/*
 *  ======== testArray ========
 *  See ti/bios/build/test.bld. Only the test name is required.
 */
var testArray = [

    /* For syslink messageq */

   {name: 'App',
        sources: ["App", "crc", "messaging", "fpga_com"], config: "./App_ti81xx_dsp",
        copts: " -DSYSLINK_PLATFORM_TI81XX ",
        lopts: " /opt/ti/edma3_lld_02_11_02_04/packages/ti/sdo/edma3/drv/lib/674/debug/edma3_lld_drv.ae674",
        buildTargets: ["C674"],
        buildPlatforms: ["platforms.ti816x.dsp"],
    },
];

 

> xdc XDCARGS="profile-debug" XDCOPTIONS="-v"

#
# lnke674 platforms_ti816x_dsp/debug/DamianApp.xe674 ...
rm -f package/cfg//platforms_ti816x_dsp/debug/DamianApp.xe674.map
/opt/ti/CCSv5/ccsv5/tools/compiler/c6000//bin/lnk6x -w -q -u _c_int00 -fs package/cfg/platforms_ti816x_dsp/debug/  /opt/ti/edma3_lld_02_11_02_04/packages/ti/sdo/edma3/drv/lib/674/debug/edma3_lld_drv.ae674 -q -o platforms_ti816x_dsp/debug/DamianApp.xe674 package/cfg/platforms_ti816x_dsp/debug/DamianApp/crc.oe674 package/cfg/platforms_ti816x_dsp/debug/DamianApp_xe674.oe674 package/cfg/platforms_ti816x_dsp/debug/DamianApp/DamianApp.oe674 package/cfg/platforms_ti816x_dsp/debug/DamianApp/messaging.oe674 package/cfg/platforms_ti816x_dsp/debug/DamianApp/fpga_com.oe674  package/cfg/platforms_ti816x_dsp/debug/DamianApp_xe674.xdl --abi=elfabi -c -m package/cfg//platforms_ti816x_dsp/debug/DamianApp.xe674.map -l /opt/ti/CCSv5/ccsv5/tools/compiler/c6000//lib/rts6740_elf.lib
warning: creating output section ".plt" without a SECTIONS specification

 undefined                first referenced                                              
  symbol                      in file                                                   
 ---------                ----------------                                              
 EDMA3_DRV_clearErrorBits package/cfg/platforms_ti816x_dsp/debug/DamianApp/fpga_com.oe674
 EDMA3_DRV_enableTransfer package/cfg/platforms_ti816x_dsp/debug/DamianApp/fpga_com.oe674
 EDMA3_DRV_requestChannel package/cfg/platforms_ti816x_dsp/debug/DamianApp/fpga_com.oe674
 EDMA3_DRV_setPaRAM       package/cfg/platforms_ti816x_dsp/debug/DamianApp/fpga_com.oe674
 edma3init                package/cfg/platforms_ti816x_dsp/debug/DamianApp/fpga_com.oe674

error: unresolved symbols remain

So the lib is there, but seems not to be used. I added the edma3_lld_drc.ae674 manually to the end of the linker call: now I got different errors.

Please tell me the correct way to add libs to this build - thank you!

  • While you could add libraries using lopts:  [" -l<library path>"],, to get code to build with edma3 I edited the package.xs files at:

    packages/ti/sdo/edma3/drv/package.xs

    packages/ti/sdo/edma3/drv/sample/package.xs

     

    I'm away from my office at the moment, but tomorrow I'll post the edited files.

    Lee Holeva

     

  • Hello,

    Another try with "-l lib" didn't work:

    #
    # lnke674 platforms_ti816x_dsp/debug/App.xe674 ...
    rm -f package/cfg//platforms_ti816x_dsp/debug/App.xe674.map
    /opt/ti/CCSv5/ccsv5/tools/compiler/c6000//bin/lnk6x -w -q -u _c_int00 -fs package/cfg/platforms_ti816x_dsp/debug/ -l/opt/ti/edma3_lld_02_11_02_04/packages/ti/sdo/edma3/drv/lib/674/debug/edma3_lld_drv.ae674 -l/opt/ti/edma3_lld_02_11_02_04/packages/ti/sdo/edma3/rm/lib/ti816x-evm/674/debug/edma3_lld_rm.ae674 -q -o platforms_ti816x_dsp/debug/App.xe674 package/cfg/platforms_ti816x_dsp/debug/App/crc.oe674 package/cfg/platforms_ti816x_dsp/debug/App_xe674.oe674 package/cfg/platforms_ti816x_dsp/debug/App/App.oe674 package/cfg/platforms_ti816x_dsp/debug/App/messaging.oe674 package/cfg/platforms_ti816x_dsp/debug/App/fpga_com.oe674  package/cfg/platforms_ti816x_dsp/debug/App_xe674.xdl --abi=elfabi -c -m package/cfg//platforms_ti816x_dsp/debug/App.xe674.map -l /opt/ti/CCSv5/ccsv5/tools/compiler/c6000//lib/rts6740_elf.lib
    warning: creating output section ".plt" without a SECTIONS specification

     undefined                first referenced
      symbol                      in file
     ---------                ----------------
     EDMA3_DRV_clearErrorBits package/cfg/platforms_ti816x_dsp/debug/App/fpga_com.oe674
     EDMA3_DRV_enableTransfer package/cfg/platforms_ti816x_dsp/debug/App/fpga_com.oe674
     EDMA3_DRV_requestChannel package/cfg/platforms_ti816x_dsp/debug/App/fpga_com.oe674
     EDMA3_DRV_setPaRAM       package/cfg/platforms_ti816x_dsp/debug/App/fpga_com.oe674
     edma3init                package/cfg/platforms_ti816x_dsp/debug/App/fpga_com.oe674

    error: unresolved symbols remain

     

    Adding the -l ...  manually  at the end of the linker call caused other undefined symbols:

    lnk6x -w -q -u _c_int00 -fs package/cfg/platforms_ti816x_dsp/debug/ -q -o platforms_ti816x_dsp/debug/App.xe674 package/cfg/platforms_ti816x_dsp/debug/App/crc.oe674 package/cfg/platforms_ti816x_dsp/debug/App_xe674.oe674 package/cfg/platforms_ti816x_dsp/debug/App/App.oe674 package/cfg/platforms_ti816x_dsp/debug/App/messaging.oe674 package/cfg/platforms_ti816x_dsp/debug/App/fpga_com.oe674  package/cfg/platforms_ti816x_dsp/debug/App_xe674.xdl --abi=elfabi -c -m package/cfg//platforms_ti816x_dsp/debug/App.xe674.map -l /opt/ti/CCSv5/ccsv5/tools/compiler/c6000//lib/rts6740_elf.lib  -l/opt/ti/edma3_lld_02_11_02_04/packages/ti/sdo/edma3/drv/lib/674/debug/edma3_lld_drv.ae674 -l/opt/ti/edma3_lld_02_11_02_04/packages/ti/sdo/edma3/rm/lib/ti816x-evm/674/debug/edma3_lld_rm.ae674 -q -o platforms_ti816x_dsp/debug/App.xe674
    warning: creating output section ".plt" without a SECTIONS specification

     undefined           first referenced
      symbol                 in file
     ---------           ----------------
     __c6xabi_abort_msg  /opt/ti/edma3_lld_02_11_02_04/packages/ti/sdo/edma3/drv/lib/674/debug/edma3_lld_drv.ae674<edma3_drv_basic.oe674>
     edma3OsProtectEntry /opt/ti/edma3_lld_02_11_02_04/packages/ti/sdo/edma3/drv/lib/674/debug/edma3_lld_drv.ae674<edma3_drv_basic.oe674>
     edma3OsProtectExit  /opt/ti/edma3_lld_02_11_02_04/packages/ti/sdo/edma3/drv/lib/674/debug/edma3_lld_drv.ae674<edma3_drv_basic.oe674>
     edma3OsSemGive      /opt/ti/edma3_lld_02_11_02_04/packages/ti/sdo/edma3/drv/lib/674/debug/edma3_lld_drv.ae674<edma3_drv_adv.oe674>
     edma3OsSemTake      /opt/ti/edma3_lld_02_11_02_04/packages/ti/sdo/edma3/drv/lib/674/debug/edma3_lld_drv.ae674<edma3_drv_adv.oe674>
     edma3init           package/cfg/platforms_ti816x_dsp/debug/App/fpga_com.oe674

    error: unresolved symbols remain

    I think I get something quite wrong and look forward to your help...

    cu

    Markus

  • Markus Grunwald said:

    I think I get something quite wrong and look forward to your help...

    This is what I did to get EDMA3 code to build.

    1.  Add entires to your .cfg file to load the packages:

    var EDMA3LLDDRV = xdc.loadPackage('ti.sdo.edma3.drv');
    var EDMA3LLDSAMPLE = xdc.loadPackage('ti.sdo.edma3.drv.sample');

    //var EDMA3LLDRM = xdc.loadPackage('ti.sdo.edma3.rm');  <-- notice that this is commented-out, apparently it isn't needed

    2.  Modify packages/ti/sdo/edma3/drv/package.xs to fix the target selection:

    function getLibs(prog)
    {
        var bool = 0;

        print ("Inside EDMA3 Drv getLibs");

        /* Prepare variables to form the library path within this package */
        var name = "edma3_lld_drv";
        var lib = "lib/";
        var target = "674/";
        var extension;

        /* Boards supported */
        var boards = [
                            'evmDA830',
                            'simTCI6608',
                            'simTCI6616',
                            'evm6670',
                            'evm6678',
                            'evm6748',
                            'evmOMAPL138',
                            'simDM8168',
                            'evmDM8168',
                            'evm6472',
                            'evmTCI6486',
                            'evmDM8148',
                            'evmTI814X',
                            'evmTI816X',
                        ];

         extension = ".a" + Program.build.target.suffix;
         lib = lib + target;
         bool = 1;

        if (bool == 0)
            throw new Error('Unexpected value in "platform" parameter')

        switch (this.profile) {
        case 'debug':
            /* enable debug build for debug profile only */
            lib = lib + "debug/" + name + extension;
            break;

        default:
            /* release profile for everything else */
            lib = lib + "release/" + name + extension;
        }

        print("    will link with " + this.$name + ":" + lib);

        /* return the library name */
        return (lib);
    }

    3.  Likewise modify packages/ti/sdo/edma3/drv/sample/package.xs:

    function getLibs(prog)
    {
        var bool = 0;

        print ("Inside EDMA3 Drv Sample getLibs");

        /* Prepare variables to form the library path within this package */
        var name = "edma3_lld_drv_sample";
        var lib = "lib/";
        var target = "674/";
        var extension;

        /* Boards supported */
        var boards = [
                            'evmDA830',
                            'simTCI6608',
                            'simTCI6616',
                            'evm6670',
                            'evm6678',
                            'evm6748',
                            'evmOMAPL138',
                            'simDM8168',
                            'evmDM8168',
                            'evm6472',
                            'evmTCI6486',
                            'evmDM8148',
                            'evmTI814X',
                            'evmTI816X',
                        ];

        /* Directories for each platform */
        var dir = [
                    'da830-evm/',
                    'tci6608-sim/',
                    'tci6616-sim/',
                    'c6670-evm/',
                    'c6678-evm/',
                    'c6748-evm/',
                    'omapl138-evm/',
                    'ti816x-sim/',
                    'ti816x-evm/',
                    'c6472-evm/',
                    'tci6486-evm/',
                    'ti814x-evm/',
                    'ti814x-evm/',
                    'ti816x-evm/',
                  ];


                    /* Choose the selected platform */
                    lib = lib + 'ti816x-evm/';
                    extension = ".a" + Program.build.target.suffix;
                    lib = lib + target;
                    bool = 1;
     

        if (bool == 0)
            throw new Error('Unexpected value in "platform" parameter')

        switch (this.profile) {
        case 'debug':
            /* enable debug build for debug profile only */
            lib = lib + "debug/" + name + extension;
            break;

        default:
            /* release profile for everything else */
            lib = lib + "release/" + name + extension;
        }

        print("    will link with " + this.$name + ":" + lib);

        /* return the library name */
        return (lib);
    }

    Lee Holeva

     

  • Lee,

    which .cfg file are you referring to ?

    is it the dat_demo.cfg file in demo/evmDA830/rts_config ?

     

    Krishna