DSP

达芬奇davinci DM6467 codec engine 例程编译 video_copy

2019-07-13 18:37发布

编译例程主要有4个步骤,1、编译codec;2、编译extensions目录;3、编译server;4、编译apps 首先进入codec_engine范例目录 cd /root/dvsdk_2_00_00_22/codec_engine_2_23_01/examples 1、编辑user.bld 使能“DSP”,其他的都是false,并指定编译器目录,将除DM6467以外的平台都注释掉 var buildTable = {
    "Arm":    [{doBuild:
false, // standard build for Linux
                target:  "gnu.targets.arm.GCArmv5T",


                // Arm tools. NOTE: make sure the directory you specify has a "bin" subdirectory
                cgtoolsRootDir: "/opt/mv_pro_5.0.0/montavista/pro/devkit/arm/v5t_le",


                platforms: [ // NOTE: comment out platforms (boards) below for which you don't want to build
//                    { description: "DaVinci evmDM357 board, ARM only", platform: "evmDM357",     dualCpu: false,  outDir: "bin/evmDM357" },
//                    { description: "DaVinci evmDM6446 board, ARM-side", platform: "evmDM6446",   dualCpu: true,  outDir: "bin/evmDM6446" },
                    { description: "DaVinci evmDM6467 board, ARM-side", platform: "evmDM6467",   dualCpu: true,  outDir: "bin/evmDM6467" },
//                    { description: "DaVinci evmDM355 board, ARM only",  platform: "evmDM355" ,   dualCpu: false, outDir: "bin/evmDM355"  },
//                    { description: "DaVinci evmDM365 board, ARM only",  platform: "evmDM365" ,   dualCpu: false, outDir: "bin/evmDM365"  },
//                    { description: "3430 SDP board, ARM-side only",     platform: "sdp3430",     dualCpu: true,  outDir: "bin/sdp3430"   },
//                    { description: "3530 EVM board, ARM-side only",     platform: "evm3530",     dualCpu: true,  outDir: "bin/evm3530"   },
//                    { description: "2530 EVM board, ARM-side only",     platform: "evm2530",     dualCpu: true,  outDir: "bin/evm2530"   },
//                    { description: "OMAP-L137 EVM, ARM-side only",      platform: "evmOMAPL137", dualCpu: true,  outDir: "bin/evmOMAPL137" },
                ],
              },


              { doBuild: false, // build for uC Linux
                target:  "gnu.targets.UCArm9",


                // UCLibc tools. NOTE: make sure the directory you specify has a "bin" subdirectory
                cgtoolsRootDir: "/db/toolsrc/library/tools/vendors/opensource/buildroot/10122007/build_arm/staging_dir/usr",


                platforms: [
                    { description: "DaVinci evmDM357 board, ARM only",  platform: "evmDM357",    dualCpu: false, outDir: "bin/evmDM357" },
                    { description: "DaVinci evmDM6446 board, ARM-side", platform: "evmDM6446",   dualCpu: true,  outDir: "bin/evmDM6446" },
                    { description: "DaVinci evmDM6467 board, ARM-side", platform: "evmDM6467",   dualCpu: true,  outDir: "bin/evmDM6467" },
                    { description: "DaVinci evmDM355 board, ARM only",  platform: "evmDM355" ,   dualCpu: false, outDir: "bin/evmDM355"  },
                    { description: "DaVinci evmDM365 board, ARM only",  platform: "evmDM365" ,   dualCpu: false, outDir: "bin/evmDM365"  },
//                    { description: "3430 SDP board, ARM-side only",     platform: "sdp3430",    dualCpu: true,  outDir: "bin/sdp3430"   },
                    { description: "3530 EVM board, ARM-side only",     platform: "evm3530",     dualCpu: true,  outDir: "bin/evm3530"   },
                    { description: "2530 EVM board, ARM-side only",     platform: "evm2530",     dualCpu: true,  outDir: "bin/evm2530"   },
                    { description: "OMAP-L137 EVM, ARM-side only",      platform: "evmOMAPL137", dualCpu: true,  outDir: "bin/evmOMAPL137" },
                ],
              }],


    "DSP":    [{doBuild:
true, // DSP builds (DSP servers for dual-CPU platforms or full apps for DSP-only platforms)
                target:  "ti.targets.C64P",


                // specify the "root directory" for the compiler tools. NOTE: make sure the directory you specify has a "bin" subdirectory
                cgtoolsRootDir: "/root/dvsdk_2_00_00_22/cg6x_6_0_23",


                platforms: [ // NOTE: comment out platforms (boards) below for which you don't want to build
//                    { description: "DaVinci evmDM6446 board, DSP-side Server", platform: "evmDM6446", outDir: "bin/evmDM6446" },
                    { description: "DaVinci evmDM6467 board, DSP-side Server", platform: "evmDM6467", outDir: "bin/evmDM6467" },
//                    { description: "DaVinci evmDM6437 board, DSP only",        platform: "evmDM6437", outDir: "bin/evmDM6437" },
//                    { description: "DaVinci evmDM648 board, DSP only",         platform: "evmDM648",  outDir: "bin/evmMD648"  },
//                    { description: "3430 SDP board, DSP-side server",          platform: "sdp3430",   outDir: "bin/sdp3430"   },
//                    { description: "3530 EVM board, DSP-side server",          platform: "evm3530",   outDir: "bin/evm3530"   },
//                    { description: "2530 EVM board, DSP-side server",          platform: "evm2530",   outDir: "bin/evm2530"   },
                ],
              },


              {doBuild: false, // DSP builds (DSP servers for dual-CPU platforms or full apps for DSP-only platforms)
                target:  "ti.targets.C674",


                // specify the "root directory" for the compiler tools. NOTE: make sure the directory you specify has a "bin" subdirectory
                cgtoolsRootDir: "/db/toolsrc/library/tools/vendors/ti/c6x/6.1.5/Linux",


                platforms: [ // NOTE: comment out platforms (boards) below for which you don't want to build
                    { description: "OMAP-L137 EVM, DSP-side Server", platform: "evmOMAPL137", outDir: "bin/evmOMAPL137" },
                ],
              }],


    "PC":     [{doBuild: false,  // build for PC Linux
                target:  "gnu.targets.Linux86",
                cgtoolsRootDir: "/db/toolsrc/library/tools/vendors/opensource/gcc/4.1.0/Linux/gcc-4.1.0-glibc-2.3.6/i686-unknown-linux-gnu",
                platforms: [ { platform: null, outDir: "bin/PC" } ],
              }],
};




// -----------------------------------------------------------------------------


var targets = [];
var userbldBuildPlatforms = {};


for each (var cpu in buildTable) {
    for (var t = 0; t < cpu.length; t++) {
        if (cpu[t].doBuild) {
            var targ = xdc.useModule(cpu[t].target);
            targets.push(targ);
            targ.rootDir = cpu[t].cgtoolsRootDir;
            userbldBuildPlatforms[targ.name] = cpu[t].platforms;
        }
    }
}


Build.targets = targets;




// Expert users: you can specify any compiler toolchain-specific options
// here. For example, when using the CodeSourcery toolchain, you need to
// remove C++ references and add the pthread library.


// specify custom toolchain options
for (var i = 0; i < Build.targets.length; i++) {
    var t = targets[i];


    if (t.name == "GCArmv5T") {
t.LONGNAME = "bin/arm_v5t_le-gcc";
    }
}

2、编辑xdcpath.mak文件 DEVICES  := DM6467
PROGRAMS := DSP_SERVER //表示现在要编译DSP server

接下来指定各工具的安装目录 CE_INSTALL_DIR      := /root/dvsdk_2_00_00_22/codec_engine_2_23_01
XDC_INSTALL_DIR       := /root/dvsdk_2_00_00_22/xdctools_3_10_05_61
BIOS_INSTALL_DIR      := /root/dvsdk_2_00_00_22/bios_5_33_03


# no need to specify the installation directories below if your CE installation
# has cetools/ directory on top
USE_CETOOLS_IF_EXISTS := 1
XDAIS_INSTALL_DIR     := /root/dvsdk_2_00_00_22/xdais_6_23
DSPLINK_INSTALL_DIR   := /root/dvsdk_2_00_00_22/dsplink-1_61_03-prebuilt
CMEM_INSTALL_DIR      := /root/dvsdk_2_00_00_22/linuxutils_2_23_01
FC_INSTALL_DIR        := /root/dvsdk_2_00_00_22/framework_components_2_23_01
BIOSUTILS_INSTALL_DIR := /root/dvsdk_2_00_00_22/biosutils_1_01_00
EDMA3_LLD_INSTALL_DIR := /root/dvsdk_2_00_00_22/edma3_lld_1_05_00
LPM_INSTALL_DIR       := _your_LPM_installation_directory/local_power_manager_1_23_01




# (Mandatory) specify correct compiler paths and names for the architectures
# you'll be building for:


# compiler path and name for Montavista Arm 9 toolchain. NOTE: make sure the
# directory you specify has a "bin" subdirectory
CGTOOLS_V5T = /opt/mv_pro_5.0.0/montavista/pro/devkit/arm/v5t_le
CC_V5T = bin/arm_v5t_le-gcc
CGTARGET = gnu.targets.arm.GCArmv5T


# compiler path and name for TI C64x toolchain. NOTE: make sure the
# directory you specify has a "bin" subdirectory
CGTOOLS_C64P = /root/dvsdk_2_00_00_22/cg6x_6_0_23
CC_C64P      = bin/cl6x


# compiler path and name for TI C674 toolchain. NOTE: make sure the
# directory you specify has a "bin" subdirectory
CGTOOLS_C674 = /root/dvsdk_2_00_00_22/cg6x_6_0_23
CC_C674      = bin/cl6x
3、进入/root/dvsdk_2_00_00_22/codec_engine_2_23_01/examples/ti/sdo/ce/examples/codecs 执行 gmake clean 执行gmake 4、进入/root/dvsdk_2_00_00_22/codec_engine_2_23_01/examples/ti/sdo/ce/examples/extensions 执行 gmake clean 执行gmake 5、进入/root/dvsdk_2_00_00_22/codec_engine_2_23_01/examples/ti/sdo/ce/examples/servers 执行 gmake clean 执行gmake 6、经过以上步骤 生成 video_copy.x64P 接下来改变一下配置文件编译Arm端应用程序 7、编辑user.bld 将arm设置为true,其他的地方设置为false,并设置编译器     "Arm":    [{doBuild: true, // standard build for Linux
                target:  "gnu.targets.arm.GCArmv5T",


                // Arm tools. NOTE: make sure the directory you specify has a "bin" subdirectory
                cgtoolsRootDir: "/opt/mv_pro_5.0.0/montavista/pro/devkit/arm/v5t_le",


// specify custom toolchain options
for (var i = 0; i < Build.targets.length; i++) {
    var t = targets[i];


    if (t.name == "GCArmv5T") {
t.LONGNAME = "bin/arm_v5t_le-gcc";
    }
}

8、 编辑xdcpath.mak文件 PROGRAMS := APP_CLIENT //表示现在要编译arm端程序
9、进入/root/dvsdk_2_00_00_22/codec_engine_2_23_01/examples/ti/sdo/ce/examples/apps/video_copy/dualcpu 执行 gmake clean和 gmake 生成app.out可执行文件。