Please note as of Wednesday, August 15th, 2018 this wiki has been set to read only. If you are a TI Employee and require Edit ability please contact x0211426 from the company directory.

Creating CCS Project for SysLink samples

From Texas Instruments Wiki
Jump to: navigation, search

Introduction

Code Composer Studio (CCS) contains application build support in the form of a "CCS Project". Many TI SW components contain CCS project files that can be opened by a CCS user and used as a starting point for their own application development.

SysLink contains examples for creating applications using SysLink, but these 'samples' do not come in the form of a CCS project. Given the lack of official CCS support, this article attempts to describe the steps needed to create a CCS project for building a SysLink application. It is assumed that the user has some familiarity with the CCS environment.

Description

CCS contains templates that are used to create the initial project contents. We use these templates to create a project that is based on the SYS/BIOS generic "Hello" example, and another that would build a project for cross-compilation. The projects' contents are basically replaced by the SysLink "messageQ" sample. For this project we use the TI814X target. Note that even though we use the messageQ sample for TI814X for illustration purposes, the user can use the same procedure for other samples as well.

The messageQ example runs on a master processor and one or more slave processors. We choose to build this example for the A8 master processor and the C674 DSP present on the TI814X device. We show here the procedure to rebuild the DSP executable, but the executable for the M3 can be similarly rebuilt by entering appropriate values for its compiler.

CCS steps

Before you start, we assume you have successfully rebuilt SysLink and its samples applications using the standard procedure detailed in the Installation Guide. If you haven't, do it first before going through the steps detailed below.

You should first install the dependencies of SysLink (e.g. SYS/BIOS, IPC, XDCtools) so that you can point CCS to them during this procedure. If you need help, you should refer to the installation procedure of the respective products and/or CCS help.

These next steps were done using CCS v5.1. The project creation layout is different in CCS v4, although equivalent entries can be found.

Rebuilding the slave DSP executable

We show here the procedure to rebuild the DSP executable, but the executable for the M3 can be similarly rebuilt by entering appropriate values for the device.

  • Create a new CCS "SYS/BIOS" project
    • File->New->CCS Project
    • Next > (to "CCS Project" page)
      • "Project name:" messageQ_DSP
      • "Output type:" Executable
      • "Family:" C6000
      • "Variant:" Generic devices, and Generic C674x Device in drop box next to it
      • "Project templates and examples:" SYSBIOS/Typical
    • Next > (to "RTSC Configuration Settings" page)
      • "XDCtools version:" Pick the version of XDCtools you intend to use (see the SysLink release notes for version info)
      • "Products and Repositories:" Check SYS/BIOS and the version of BIOS you intend to use. Do the same for Inter-processor Communication (IPC). (see the SysLink release notes for version info)
      • "Target:" ti.targets.C674
      • "Platform:" ti.platforms.evmTI814X (choose this for now. We'll change it later to the correct value.)
      • "Build-profile:" debug
    • Finish
  • Double-click on your project in the C/C++ Projects tab
    • Right click main.c and app.cfg and "Delete" them.
  • Right click your project in the C/C++ Projects tab, select "Add files..."
    • Navigate to <SYSLINK_INSTALL_DIR>/packages/ti/syslink/samples/rtos/messageQ
    • select MessageQApp.c & MessageApp_common_cfg.xs & ti81xx/MessageQ_ti81xx_dsp.cfg (if prompted on File Operation, select 'Copy files')
    • Navigate to <SYSLINK_INSTALL_DIR>/packages/ti/syslink/samples/rtos/common
    • select SysLinkSamples_common.cfg.xs (if prompted on File Operation, select 'Copy files')
  • Right click the file MessageQ_ti81xx_dsp.cfg. Select Open with->Text Editor and change the line
xdc.loadCapsule("../MessageApp_common.cfg.xs");

to

xdc.loadCapsule("MessageApp_common.cfg.xs");
  • Save the file
  • Right click the file MessageApp_common_cfg.xs. Select Open with->Text Editor and change the line
xdc.loadCapsule("../common/SysLinkSamples_common.cfg.xs");

to

xdc.loadCapsule("SysLinkSamples_common.cfg.xs");
  • Save the file
  • Right click your project. Select Properties -> Build -> XDCtools -> Package Repositories and add <SYSLINK_INSTALL_DIR>\packages to xdcpath (replace <SYSLINK_INSTALL_DIR> with the installation location of SysLink)
  • Right-click your project. Select Properties -> General -> Main.
    • Set the compiler version (see release notes if not sure which one to use)
    • "Output format:" eabi (ELF)
    • Hit OK
  • Based on the content in <syslink_install_dir>/packages/ti/syslink/samples/rtos/messageQ/package.bld for the entry in the testArray of the device you are building for (ie. messageq_ti81xx_dsp), you also need to adjust your build options as follows:
    • Right-click your project. Select Properties->Build->C6000 Compiler->Predefined Symbols. Click on add icon to add a Pre-define NAME. Type in SYSLINK_PLATFORM_TI81XX. This is the same as adding the following to the build options: -DSYSLINK_PLATFORM_TI81XX
    • Right-click your project. Select Properties->Build->XDCtools->Advanced Options->Configuration Script Arguments. Type {dmTimerFreq: 32768} into box. The dmTimerFreq value is defined by TI81XXDSP_DMTIMER_FREQ in the products.mak file when rebuilding SysLink.
    • Right click project -> Properties -> General -> RTSC -> Products and Repositories -> Set the platform to ti.syslink.samples.rtos.platforms.ti814x.dsp
      • Note that this is to have the project use the platform/memory map as defined by SysLink for its samples. Should you need to make a change to the platform later you'd have to remember to go back to the SysLink product installation directory, make the changes in the platform package (ie. in ti/syslink/samples/rtos/platforms/ti814x/dsp), and rebuild the samples using the command line to update the platform. Afterwards you can rebuild your CCS project against the modified platform.
  • Select Project->Build Project from the menu bar to rebuild the newly created project.
  • The resulting executable messageQ_DSP.out is in the Debug folder of your project's directory.


Some screenshots of the various steps

Project creation

MessageQ DSP new ccs project.jpg MessageQ DSP RTSC configuration settings.jpg

RTSC repositories setting

MessageQ DSP package repo.jpg



Rebuilding the master A8 executable in Linux

If you'd like to rebuild the A8 executable using CCS, it is recommended to first install CCS under a Linux host, preferably the same that was used to rebuild SysLink initially. This is so that we easily get access to the CodeSourcery toolchain for compiling the code.

Here's the procedure:

  • First, we can obtain the compiler options by rebuilding SysLink after commenting out the following lines in ti/syslink/buildutils/hlos/usr/Makefile.inc:
    ################################################################################
    ## Quiet build
    ################################################################################
    #ifndef V
    #Q           := @
    #endif
  • Rebuild the samples on Linux command line. Observe compiler invocations to find out build flags. You should see printouts such as the following. This basically gives you all the build options that were used to build the C files, which you would need to replicate in the CCS build environment.

Compiling: /db/atree/workdir/syslink_2_10_01_15/packages/ti/syslink/samples/hlos/messageQ/MessageQApp.c /db/toolsrc/library/vendors2005/cs/arm/arm-2009q1-203/bin/arm-none-linux-gnueabi-gcc -Wall -ffloat-store -D_REENTRANT -O3 -DSYSLINK_PLATFORM_TI81XX -DTI81XX_VIDEOM3 -DSYSLINK_BUILDOS_LINUX -DSYSLINK_BUILD_DEBUG -DSYSLINK_TRACE_ENABLE -DSYSLINK_BUILD_HLOS -I/db/atree/workdir/syslink_2_10_01_15/packages -I/db/atree/workdir/syslink_2_10_01_15/packages/ti/syslink/inc -I/db/atree/workdir/syslink_2_10_01_15/packages/ti/syslink/inc/usr -I/db/atree/workdir/syslink_2_10_01_15/packages/ti/syslink/inc/usr/Linux -I/home/xlibrary/trees/ipc/ipc-g26/exports/ipc_1_23_01_26/packages -I/packages -I/db/atree/workdir/syslink_2_10_01_15/packages -ggdb -D DEBUG -c -o /db/atree/workdir/syslink_2_10_01_15/packages/ti/syslink/obj/TI814X/samples/messageqapp/debug/MessageQApp.o /db/atree/workdir/syslink_2_10_01_15/packages/ti/syslink/samples/hlos/messageQ/MessageQApp.c

  • Create a new C Cross-Compile project
    • File->New->Project...
    • Next > (to "New Project" page)
      • C/C++->C Project
    • Next > (to "C Project" page)
      • "Project name:" MessageQ_A8
      • "Project type:" Executable->Cross-Compile Project
    • Next > (to "C Project" Command page)
      • "Tool command prefix:" arm-none-linux-gnueabi-
      • "Tool command path:" fill in the path to the bin directory in your Code Sourcery installation
    • Next > (to "C Project" Select Configuration page)
      • Ensure at least Debug is checked.
    • Hit Finish
  • Right-click on the project. Select add files... to add *.c files from messageQ sample into MessageQ_A8 project's directory
    • ti/syslink/samples/hlos/messageQ/usr/Linux/MessageQAppOS.c
    • ti/syslink/samples/hlos/messageQ/MessageQApp.c
    • If prompted, make sure to select 'Copy File'.
  • In addition, add the following files as well as they are files that are common to all samples:
    • ti/syslink/samples/hlos/slaveLoader/SlaveLoader.c and .h
    • ti/syslink/samples/hlos/common/*
    • ti/syslink/samples/hlos/common/usr/Linux/SysLinkSamplesAppOS.c
  • Right-click on the project. Select properties->C/C++ Build->Settings->Tool settings -> Cross GCC compiler. Add the following to the build options using the various categories on the left hand side. Refer to the 'Compiler options' screenshots in the section below for guidance if necessary.

-Wall -ffloat-store -D_REENTRANT -O3 -DSYSLINK_PLATFORM_TI81XX -DTI81XX_VIDEOM3 -DSYSLINK_BUILDOS_LINUX -DSYSLINK_BUILD_DEBUG -DSYSLINK_TRACE_ENABLE -DSYSLINK_BUILD_HLOS -I/db/atree/workdir/syslink_2_10_01_15/packages -I/db/atree/workdir/syslink_2_10_01_15/packages/ti/syslink/inc -I/db/atree/workdir/syslink_2_10_01_15/packages/ti/syslink/inc/usr -I/db/atree/workdir/syslink_2_10_01_15/packages/ti/syslink/inc/usr/Linux -I/home/xlibrary/trees/ipc/ipc-g26/exports/ipc_1_23_01_26/packages -I/packages -I/db/atree/workdir/syslink_2_10_01_15/packages -ggdb -D DEBUG -c

  • Right-click on the project. Select Properties->C/C++ Build->Settings->Tool settings -> Cross GCC Linker
    • Under Libraries, add 'pthread' and 'c'
    • In the Miscellaneous section->Other objects, add <SYSLINK_INSTALL_DIR>/packages/ti/syslink/lib/syslink.a_debug (replace <SYSLINK_INSTALL_DIR> with your SysLink installation directory)
  • Hit OK button
  • Rebuild the project by selecting Project->Build project from the menu bar.
  • The resulting executable file, MessageQ_A8, should reside in the Debug subdirectory in your project.

Some screenshots of the various steps

Project creation

MessageQ A8 new project.jpg MessageQ A8 C project.jpg MessageQ A8 command.jpg

Compiler options

MessageQ A8 compiler inc.jpg MessageQ A8 compiler sym.jpg MessageQ A8 compiler opt.jpg MessageQ A8 compiler debug.jpg MessageQ A8 compiler warn.jpg MessageQ A8 compiler misc.jpg

Linker options

MessageQ A8 linker lib.jpg MessageQ A8 linker misc.jpg