NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
MCSDK UG Chapter Developing PDK
Developing with MCSDK: Platform Development Kit and Peripherals
Last updated: 02/11/2015
Contents
Acronyms[edit]
The following acronyms are used throughout this chapter.
Acronym | Meaning |
CSL | Texas Instruments Chip Support Library |
DSP | Digital Signal Processor |
EDMA | Enhanced Direct Memory Access |
MCSDK | Texas Instruments Multi-Core Software Development Kit |
PDK | Texas Instruments Programmers Development Kit |
SRIO | Serial Rapid IO |
TI | Texas Instruments |
CSL/LLD User Guide[edit]
Overview[edit]
This document provides guideline for compiling and executing Low Level Device Driver (LLD) with examples included in the release package. As a pre-requisite refer release note for PDK in order to find recommended version of compiler and dependent tools. LLD would need to be installed by running the installer part of PDK. For rest of the document keyword
- <PDK_INSTALL_PATH> refers to the location where PDK is installed.
- <lld> refers to individual LLDs in PDK package
Build guidelines for Full PDK package for C66x Target[edit]
-
Release package comes with a pre-built set of libraries for individual LLD’s and CSL modules. Below are the steps in case if an LLD would need to be rebuilt. Note that makefile support is now added so that LLDs and CSL libraries can be built using makefiles.
-
Setting Environment Variables by editing the <PDK_INSTALL_PATH>\packages>pdksetupenv.bat to reflect your installation (E.g.):
set C6X_GEN_INSTALL_PATH="C:/ti_5_5/ccsv5/tools/compiler/c6000_7.4.7" set EDMA3LLD_BIOS6_INSTALLDIR="C:/ti/edma3_lld_02_11_13_17" set PDK_INSTALL_PATH=C:/ti/pdk_keystone2_3_01_00_03/packages set BIOS_INSTALL_PATH=C:/ti/bios_6_37_03_30 set XDC_INSTALL_PATH=C:/ti/xdctools_3_25_06_96 set CG_XML_BIN_INSTALL_PATH=C:/ti/cg_xml/bin
-
Run pdksetupenv.bat to setup the build enviornment and to check in case if any modifications are required for the target environment.
pdksetupenv.bat
Note: The pdksetupenv.bat requires path2dos.exe utility available from XDC tools. If path2dos.exe is not available in the build environment then short names for paths SHOULD be provided to environment variables e.g. C:\PROGRA~1\TEXASI~1\PDK_TC~4\packages. In Windows environment, "dir /x" and "dir /-n" displays the short names generated for non-8dot3 file and directory names.
-
To build all the PDK components, execute pdkbuilder.bat from the top level PDK packages directory <PDK_INSTALL_PATH>\packages directory
pdkbuilder.bat
-
Setting Environment Variables
- C6X_GEN_INSTALL_PATH
- Install location for Code Gen Tool
- Examples for default location of Code Gen Tool 7.2.2 GA
set C6X_GEN_INSTALL_PATH="C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.2"
- PDK_INSTALL_PATH
- Install location for PDK package
- Change the shell prompt directory to PDK installation directory. Example for a default PDK installation at C:/Program Files/Texas Instruments/pdk_TCI6608_1_0_0_10/packages, the commands would be
$cd "C:/Program Files/Texas Instruments/pdk_TCI6608_1_0_0_10/packages" $export PDK_INSTALL_PATH=$PWD
- Additional environment variables are optional and not required on this environment. Refer pdksetupenv.bat or pdksetupenv.sh for the details.
- C6X_GEN_INSTALL_PATH
-
To build all the PDK components, run pdkbuilder.sh from the top level PDK packages directory <PDK_INSTALL_PATH>/packages directory.
$./pdkbuilder.sh
The shell script cleans and rebuilds all components which are part of the PDK release.
- CPPI
- RM
- QMSS
- PA
- SA
- NWAL
- PKLIB
- Pre-requisites:
- Change directory to <PDK_INSTALL_PATH>/packages
- Modify armv7setupenv.sh script based on host build environment. See below environment variables
- Execute the script in target shell environment by executing
source armv7setupenv.sh - Run make all to build all executables and libraries
- In the case of building subset of targets take a look at the makefile being provided to go through targets supported. Following are the options
- Building only libraries
- Building only tests
- Building only examples
- Pre-requisite:
- Linaro ARM tool chain version as mentioned in MCSDK release notes is available in Linux host.
- IPC libraries are rebuilt with same ARM cross tool version as MCSDK provided one.
- HPLIB and SA library to be built with the same Linaro ARM tool chain as MCSDK provided one
- Change directory to <PDK_INSTALL_PATH>/packages
- Modify armv7setupenv.sh script based on host build environment. See below environment variables
- Execute the script in target shell environment by executing
source armv7setupenv.sh - Run make all to build all executables and libraries
- In the case of building subset of targets take a look at the makefile being provided to go through targets supported. Following are the options
- Building only libraries
- Building only tests
- Building only examples
-
Check Prerequisites
Please ensure that all dependent/pre-requisite packages are installed before proceeding with the examples and/or unit test. -
Configure CCS Environment
The CCS environment configuration step needs to be done only once for a workspace as these settings are saved in the workspace preferences. These settings only need to be modified if:- New workspace is selected
- Newer version of the component is being used. In that case modify the paths of the upgraded component to the newer directory.
- Create a macro file if not available from the PDK release. For the PDK release file: <PDK_INSTALL_PATH>\packages\macros_ini can be used
PDK_INSTALL_PATH = <PDK_INSTALL_PATH>\packages CSL_INSTALL_PATH = <PDK_INSTALL_PATH>\packages CPPI_INSTALL_PATH = <PDK_INSTALL_PATH>\packages QMSS_INSTALL_PATH = <PDK_INSTALL_PATH>\packages SRIO_INSTALL_PATH = <PDK_INSTALL_PATH>\packages TCP3D_INSTALL_PATH = <PDK_INSTALL_PATH>\packages
- Open CCS and select an appropriate workspace
- Load Managed Build Macros by
- Click on File -> Import
- Click on Managed Build Macros
- Select the file macros.ini
- Click on “Overwrite existing values”
- Click Finish
-
Create CCS Project
PDK package includes a batch file pdkProjectCreate.bat under <PDK_INSTALL_PATH>\packages. The batch file allows creation of projects based on the different dependent tool version for all examples and unit tests included in PDK. The batch file also allows additional executable types eg: COFF/ELF and Endianess. Batch file is supported for both CCSv4.2 and CCSv5.x environment. Alternatively, projects can be created using the CCS wizard and importing required files from test and example directories. Additional details on using pdkProjectCreate.bat:- Prerequisite: All dependent components need to be installed. After the components are installed, start CCS once and wait for eclipse plugin to get into effect before running the batch file.
- Modify environment variables in pdkProjectCreate.bat under "<PDK_INSTALL_PATH>\packages" directory to reflect project options. This would also include
- IS_SIMULATOR_SUPPORT_NEEDED: For running projects in simulator environment
- ENDIAN: To select "little" or "big" endian
- Refer additional environment settings in the batch file
- The command line above will create projects for all PDK examples. In order to create projects for a single example, for instance the PA LLD example, the command line should be modified as follows:
-
Import Project
Below are the steps for importing project assumes that CCS project is already available.- Select C/C++ Development perspective
- Click on File -> Import
- On the Import Dialog Box select CCS Existing CCS/CCE Eclipse Project
- Click on Next
- This will pop up a new dialog box; ensure that 'Select Root Directory' option is selected
- Click on Browse and select the top level directory where the project is present. For example
C:\MyPDKWorkspace<PART_NUMBER>
<PART_NUMBER> reflects the device part number for the PDK being installed.
- Under the projects section you should see the project. For example
qmInfraExampleProject
- Click Finish
-
Build Project
To build the project; ensure that the project you want to build, i.e., qmInfraExampleProject is set as the active project. Click on Project -> Build Active Project. -
Run Project
- Launch the Debugger and switch to the Debug Perspective.
- To execute the project ensure the following is done:
- Click on Target -> Reset CPU
- Click on Target -> Load Program
- Select the executable file to be loaded. Example: C:\MyPDKWorkspace<PART_NUMBER>\qmInfraExampleProject\Debug\ qmInfraExampleProject.out
- Click on OK.
- Once the project is loaded; click on Target -> Run to execute it.
- Execution of user mode examples and tests included in MCSDK by default requires root previlige. This is primarily dependency of devmem for mapping the device memory which by default is restricted to super user. The default mechanism is also to reduce exposure of device memory to any user not having admin privilege
- Pre-requite for this step is to have built binaries as mentioned in previous sections.
- Transfer the example/test binaries available under $ARMV7BINDIR directory to the file system using TFTP or NFS
- Change the permission execute by running command chmod
- Execute the binary
Building PDK using gmake in Windows environment[edit]
The batch file cleans and rebuilds all components which are part of the PDK release.
Building PDK using gmake in MSYS environment[edit]
Build guidelines for ARM User Mode LLDs[edit]
-
ARM User Mode support is available for following PDK components:

Building user mode LLD examples and libraries with Linux devkit[edit]
This step is applicable to LLDs supported for ARM target. Check the PDK release notes for the list of supported LLDs.
- Linaro ARM tool chain version as mentioned in MCSDK release notes is available in Linux host.
- Linux Devkit installed from MCSDK releases into a directory with write permission. Please note that the document would refer linux devkit location as <LINUX_DEVKIT_INSTALL_PATH>
# Update the below environment variable to the Linux Devkit Path export LINUX_DEVKIT_INSTALL_PATH=$HOME/linux-devkit/sysroots/cortexa15hf-vfp-neon-3.8-oe-linux-gnueabi # Export CORE type export CORE=armv7 # Export Device export DEVICE=k2h # ARM cross tool executable path to MCSDK published tool chain (Below is an example). export CROSS_TOOL_INSTALL_PATH=/opt/linaro/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/bin echo "CROSS_TOOL_INSTALL_PATH set to $CROSS_TOOL_INSTALL_PATH" # ARM cross tool prefix export CROSS_TOOL_PRFX=arm-none-linux-gnueabihf- # Default Output directory for generated binaries and objects export ARMV7LIBDIR=$PWD/../lib/armv7 #Modify to Linux Dev Kit Lib Path as below if [ ! -z "$LINUX_DEVKIT_INSTALL_PATH" ]; then #Modify the location here if the intent is not to get the libraries under linux devkit, otherwise no modications needed export ARMV7LIBDIR=$LINUX_DEVKIT_INSTALL_PATH/usr/lib fi
make lib
Output libraries will be available at $ARMV7LIBDIR location
make tests
Output test binaries will be available at $ARMV7BINDIR location
make examples
Output example binaries will be available at $ARMV7BINDIR location and
Temporary object files will be available at $ARMV7OBJDIR location
Note: Please note that the user would need write permissions to the locations as specified by $ARMV7LIBDIR.
Building user mode LLD examples and libraries with NO Linux devkit (Not a standard practice and not supported starting with MCSDK 3.0.4) [edit]
This step is applicable to LLDs supported for ARM target. Check the PDK release notes for the list of supported LLDs.
Note: Please refer to <ipc_install>/docs/IPC_Install_Guide for details on rebuilding the IPC libraries.
# Make sure below environment is unset for building without LINUX DEVKIT export LINUX_DEVKIT_INSTALL_PATH= # Provide the HPLIB INSTALL PATH export HPLIB_INSTALL_PATH=$HOME/ti/transport_net_lib_1_0_0_6/packages # Provide the SA LLD install PATH export SA_INSTALL_PATH=$HOME/ti/mcsdk_3_00_00_11/salld_keystone2_02_00_00_06/packages #SA LLD Library path # Modify to match the actual armv7 sa lld library build path export ARMV7SALIBDIR=$SA_INSTALL_PATH/ti/drv/sa/lib/armv7 # HPLIB library path # Modify to match the actual armv7 sa lld library build path export ARMV7HPLIBDIR=$HPLIB_INSTALL_PATH/ti/runtime/hplib/lib/armv7 # Update the IPC library paths - please note that this is the path after IPC libraries and include files are installed in one common folder export IPC_DEVKIT_INSTALL_PATH=$HOME/ipc_install_path # Default Output directory for generated binaries and objects, modify for any other locations export ARMV7LIBDIR=$PWD/../lib/armv7 #Modify to Linux Dev Kit Lib Path if [ ! -z "$LINUX_DEVKIT_INSTALL_PATH" ]; then export ARMV7LIBDIR=$LINUX_DEVKIT_INSTALL_PATH/usr/lib fi
make lib
Output libraries will be available at $ARMV7LIBDIR location
make tests
Output test binaries will be available at $ARMV7BINDIR location
make examples
Output example binaries will be available at $ARMV7BINDIR location and
Temporary object files will be available at $ARMV7OBJDIR location
Note: Please note that the user would need write permissions to the locations as specified by $ARMV7LIBDIR.
Steps to run example and/or unit test projects on C66x Target[edit]
-
The example directory in individual LLD contains several examples which demonstrate usage of API’s. The “test” directory in some LLD contains unit test module.
Steps to run ARM user mode LLD example and/or unit test on Target[edit]
How To's[edit]