编译和运行Codec Engine examples介绍【转】

1. [Optional] Copy the entire "examples" tree out of the product

This step is optional, but recommended if you plan to modify the samples in any way. It will ensure you have a backup copy of the original examples, as provided by the Codec Engine product.

Important: throughout the rest of this document, we will use the following notation:(一定要注意这几个环境变量,变量定义在下面提到的.mak中):

  • <CE_EXAMPLES_INSTALL_DIR> - absolute path of the examples directory or the copy you made, e.g. /usr/work/examples
  • <CE_INSTALL_DIR> - root directory of your Codec Engine installation. The original examples are in <CE_INSTALL_DIR>/examples.
  • <BIOS_INSTALL_DIR> - root directory of your DSP/BIOS installation.
  • <XDC_INSTALL_DIR> - root directory of your xdctools installation.
  • directory/file - position of the file relative to the examples directory; for examples, ti/sdo/ce/examples/codecs/makefile refers to <CE_EXAMPLES_INSTALL_DIR>ti/sdo/ce/examples/codecs/makefile.
2. Edit top-level build files to customize the build for your software installation and your hardware

At the root of the Examples directory are two build-related files that all Codec Engine examples include. We edit both of these files to specify where various software components needed by Codec Engine are on our system, and to narrow the list of hardware targets we want to build for (thereby reducing the build time and possibly the scope of external components needed).

2.1 Edit XDC user build configuration file, user.bld

File user.bld at the root of the Examples directory informs the XDC tools (tooling which the Codec Engine uses to build itself, codecs, servers, etc) where to find compilers and other tools on the user's system, and also what platforms to build for. Open this file in a text editor.

Locate in the file a build table that lists whether to build the examples for the ARM, for the DSP, and for native Linux. Each of those three has a list of supported "targets", i.e. runtime environments, for example the TI C64+ compiler for the DSP, the Montavista Arm9 and the ucLinux ARM 9 for the ARM. Those "targets" support several platforms, for example the Montavista ARM 9 target supports "evmDM6446", "evmDM355", and other platforms.

Following the simple instructions in the file's comments, disable builds that you are not interested in, in order to save time. For example, you may not be interested in building anything for the DSP; or, for the ARM, you may be interested in building only for target, "Montavista ARM 9", and for that target, you will likely be interested in only one platform, for example "evmDM6446", or "evmDM355".

For the targets that you do want to build for, you will specify the base directories of their respective tool chains, as explained and exemplified in the comments in the file.

2.2 Edit xdcpaths.mak to define the necessary variables

编译和运行Codec Engine examples介绍【转】 - chenaini119 - 我的博客我的生活
就是根据你的文件目录所在修改这几个环境变量。

The xdcpaths.mak file, also located at the root of the examples/ directory, defines where the Codec Engine is installed, where BIOS is, where the XDC tools are, and where individual Codec Engine packages are. Open this file in a text editor.

Follow the instructions in the file to specify the following:

  • (Optional) List of hardware devices you want to build for (DM6446, DM355, etc.). This list is specified in the DEVICES variable. You will likely be interested in only one or two devices, so reduce this list to your minimum to shorten the build time and to avoid being asked for the location of components you don't need.
  • (Mandatory) Installation directories for the Codec Engine itself, for the XDC tools, and for the DSP/BIOS (if you build for the DSP). Those you specify in CE_INSTALL_DIR, XDC_INSTALL_DIR, and BIOS_INSTALL_DIR variables, as explained in details in the comments in the file you are editing.
  • (Mandatory, depending on your Codec Engine distribution) Installation directories for the "minor" components needed by the Codec Engine, such as XDAIS, Framework Components, DSP/BIOS Link, and CMEM memory manager. If you have a "full" Codec Engine distribution that has a cetools/ directory at its top, all these components will automatically be included. If you don't have this distribution, and instead XDAIS, DSP/BIOS Link and others are installed in other directories, you will have to specify their location.
  • (Mandatory) Location of the compiler tools for architectures you'll be building examples for, specifically Montavista Arm9 and TI C64x

Each directory contains a GNU makefile which enables you to build the sample in the current directory. Top-level directories also contain a makefile which steps into subdirectories and builds all the examples under the parent directory.

FYI, the xdcpaths.mak file is included by the individual makefiles for all the example codecs, servers, and applications.

Please keep in mind that MOST BUILD TROUBLES OCCUR WHEN ONE OF THE VARIOUS *_INSTALL_DIR VARIABLES ARE INCORRECT! Make sure there are no extra spaces, that every individual path (segment separated by the semicolon) is correct, character for character, and the build process is very likely to go smoothly.

3. Build example codecs

Change directory to ti/sdo/ce/examples/codecs and type

    gmake clean
    gmake

Alternatively, you can change into a specific codec's directory (e.g. ti/sdo/ce/examples/codecs/viddec_copy), and type

    gmake clean
    gmake

4. Build example extensions

Change directory to ti/sdo/ce/examples/extensions and type

    gmake clean
    gmake

Alternatively, you can change into a specific example extension directory (e.g. ti/sdo/ce/examples/extensions/scale), and type

    gmake clean
    gmake

5. Build example DSP servers

Note that this is only necessary for dual processor environments, like DM6446.

Change directory to ti/sdo/ce/examples/servers and type

    gmake clean
    gmake

Alternatively, you can change into a specific server's directory (e.g. ti/sdo/ce/examples/servers/video_copy), and type

    gmake clean
    gmake

Note: when developing your own codecs and applications, you will likely take one of the DSP server sample and modify it to suit your needs. These are the source files for this server application that you need to know about:

  • *.cfg: Configuration script that determines what codecs should be included in the server, and how some of the components (e.g. DSKT2 and DMAN3) will be configured. (server配置文件)
  • *.tcf: TConf file for the app. It is set to allow for a generous heap of 122MB and for 4MB of static code and data. Be very careful with changing the memory map. (DSP/BIOS的配置文件)
  • main.c: generic main()
  • link.cmd: application specific linker command file.
6. Build the GPP applications

Change directory to ti/sdo/ce/examples/apps (where the makefile is) and type

    gmake clean
    gmake

7. Copy files to the target and run

For a given application you want to run, you need to copy that application's executable on the target, and if your application requires a DSP server, you need to copy that DSP server on the target as well. (You can see which DSP server -- a DSP binary with .x64P extension -- is required by the application if you look at the application's .cfg file.) In addition, you should copy the input data file "in.dat" to the target, keeping the relative position between the application executable and the in.dat file.

Also, you must make sure that all the required kernel modules (.ko's) for your target are loaded (tyically via the loadmodules.sh shell script.)

Example 1: Running the audio_copy example on evmDM6446:
The ARM-side of the audio_copy example for evmDM6446 is in directory examples/ti/sdo/ce/examples/apps/audio_copy/dualcpu/evmDM6446. Copy the app.out file to the target, along with in.dat -- which is in the same directory, so on the target both files should be in the same directory, as well. 

The ceapp.cfg file in that directory lists "all.x64P" as its DSP server image, so you must copy the all.x64P DSP executable for evmDM6446 from examples/ti/sdo/ce/examples/servers (more precisely from examples/ti/sdo/ce/examples/servers/all_codecs/bin/evmDM6446/) to the target, in the same directory where the ARM-side executable is.

Example 2: Running the video1_copy example on evmDM355:
The evmDM355 only has the ARM, so we don't copy any DSP files on the target. From the build directory ti/sdo/ce/examples/apps/video1_copy/ we copy bin/evmDM355/app_local.xv5T on the target, and the in.dat file as well, making sure in.dat is one level above the ARM executable on the target as it is in the build directory.

4.最后其实还有最重要的Memory map

    由于以上的默认配置都是TI的EVM配置,256MDDR,不一样就需要对内存地址进行下分配,请参照:  

    http://processors.wiki.ti.com/index.phptitle=Changing_the_DVEVM_memory_map

5.从实例中了解下配置文件

编译和运行Codec Engine examples介绍【转】 - chenaini119 - 我的博客我的生活
其中的local.cfg是arm端的配置文件

         remote.cfg是dsp端的配置文件

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值