3. Getting Started

3.1. Building the PDK

The PDK comes with pre-built libraries for running the demos/examples and everything you need to start writing an application (Note: This is part of the binary package and not available with source only package). However, one may want to customize and rebuild the source.

Inside the PDK there is a top-level makefile at PDK_INSTALL_DIR/packages/ti/build that can be used to build some of the sub-components found within the PDK.

Prior to calling this makefile, user needs to get the correct tool chains and setup the environment by updating pdk_tools_path.mk available at PDK_INSTALL_DIR/packages/ti/build.

Note

By default this is updated as per the SDK tool version. This change is only required in case of different tool chains

Note

Also there is an alternate option to build PDK from PDK_INSTALL_DIR/packages which in turn calls the PDK_INSTALL_DIR/packages/ti/build makefile. Both these methods use the same underlying makefiles. Each one serve a slightly different purpose. User are free to use any method that suits them. Run make -s help in each folder to know the list of options supported by both methods. For example

  • makefile at PDK_INSTALL_DIR/packages/ti/build supports granular build targets like specific library and examples.
  • makefile at PDK_INSTALL_DIR/packages supports build of all possible boards and cores based on PDK_SOC variable.

3.2. Supported Boards/SOCs

Below list of supported SOC or BOARD that needs to passed to the BOARD variable for building. The supported cores for each of the SOC is provided under each platform

  • Jacinto Family of Devices
    • BOARD = j721e_evm
      • CORE = < mpu1_0, mcu1_0, mcu1_1, mcu2_0, mcu2_1, mcu3_0, mcu3_1, c66xdsp_1, c66xdsp_2, c7x_1 >

3.3. Build Steps

This section describes the steps to build the PDK package. For Windows machine, the package is built using the gmake from TI XDC package. For Linux machine, make can be used. In all below commands “gmake” can be replaced with “make” for Linux machine build. Also makefile internally uses some binaries like rm, mkdir echo from Cygwin.

3.3.1. For running from PDK_INSTALL_DIR/packages/ti/build

cd PDK_INSTALL_DIR/packages/ti/build
  • Build all PDK libraries for all cores:

    make -s pdk_libs_allcores BOARD=<board>
    
  • Build all PDK applications and libraries for all cores:

    make -s allcores BOARD=<board>
    
  • Build all PDK libraries for a given cores:

    make -s pdk_libs BOARD=<board> CORE=<core>
    
  • Build all PDK applications and libraries for a given cores:

    make -s all BOARD=<board> CORE=<core>
    
  • Build individual targets (use help menu to see all targets):

    make -s <target> BOARD=<board> CORE=<core>
    
  • Clean everything (all cores and all platforms/boards):

    make -s allclean
    
  • Clean all targets for a given board:

    make -s allcores_clean BOARD=<board>
    
  • Clean individual targets:

    make -s <target>_clean BOARD=<board> CORE=<core>
    
  • To know more build options:

    make -s help BOARD=<board>
    

    e.g. make help BOARD = j721e_evm

    The above command could be used to list the application supported for a given platform/SoC

Note

To build FreeRTOS version of an application, <target_name> will be <APP_NAME>_freertos. For example to build udma_memcpy_testapp for FreeRTOS,

make -s udma_memcpy_testapp_freertos BOARD=<board> CORE=<core>

Note

To build different profiles, provide variable BUILD_PROFILE=<release/debug> while invoking above commands

Note

The executable will be generated under PDK_INSTALL_DIR/packages/ti/binary/<example> folder.

Note

The library will be generated under PDK_INSTALL_DIR/packages/ti/<component>/lib/<soc>/<core>/<debug/release>/ folder.

Note

If a library is not applicable for a given core or board, the make system will print message like below

Nothing to be done for <BOARD> <CORE> <target>

Important

If the installation folder depth is high then windows cmd prompt fails with error that it cannot find a file, even if the file is present in mentioned path, this is because Windows has a limitation of 8191 characters for the commands that can execute. In such situation as a work around either restrict the folder depth to d:/ or if it cannot be restricted use git bash to build. Refer https://support.microsoft.com/en-in/kb/830473 for more details. (Always point to xdc path gmake only)

Important

If ‘-j’ option is used in windows build and build fails then clean that particular application target and run the same command again w/o ‘-j’ option.

Important

By default the application dependency to build library is disabled. In case user changes any library the following flag should be set to no while invoking make or set this variable in PDK_INSTALL_DIR/packages/ti/build/Rules.make

make -s <target> DISABLE_RECURSE_DEPS=no

3.3.2. For make from PDK_INSTALL_DIR/packages

cd PDK_INSTALL_DIR/packages
  • Below sets the default environmental variables like PDK path, SDK path and default PDK_SOC - This is optional step

    #source in case of Linux
    source pdksetupenv.sh
    
    #Run in case of Windows
    pdksetupenv.bat
    
  • Build all targets including libraries and examples

    make -s all PDK_SOC=<desired SOC>
    
  • Build all libraries

    make -s all_libs PDK_SOC=<desired SOC>
    
  • Run below to know the list of options supported

    make -s help
    

3.4. Library Path and Naming Convention

This section describes the location and naming convetion of the pre-built libraries inside the PDK packages. The prebuilt library is located at .../<module>/lib/<board/soc>/<core>/<build_type>/<library> as described at the table below:

Item Description
<module>
module name for this library.
Examples: ti/csl, ti/osal, ti/drv/i2c, ti/drv/uart
<board/soc>
board name if BOARD_DEPENDENCY = yes. Example: j721e_evm
SOC name if SOC_DEPENDENCY = yes. Example: j721e
Empty if both BOARD_DEPENDENCY = no and SOC_DEPENDENCY = no
<core>
core name such as c66, r5f or c66xdsp_1, mcu1_0 when CORE_DEPENDENCY = yes
<build_type>
build_type is either release or debug
<library>
library such as ti.csl.ae66, esm.aer5f

The full library name consists of its name and extension shown as <LIBNAME>.<LIBEXT> where LIBEXT is constructed as a<FORMAT_EXT><ISA_EXT><ENDIAN_EXT> as described at the following table

Variable Description
<LIBMAME>
Library name will be the module name or the <mod name>_LIBNAME if it is specified at the makefile.
Examples: csl_LIBNAME = ti.csl ==> ti.csl.ae66, MODULE_NAME = esm ==> esm.aer5f
<FORMAT_EXT>
Format extension.
For example, ELF file is indicated as “e”
<ISA_EXT>
ISA extension.
For example, a8, a9, a15, a53, a72, m4, r5f, 66, 71
<ENDIAN_EXT>
ENDIAN extension which is core-specific.
For example, “e” is usually used to indicate big endianness and “fg” indicates little endianness for MPU A8, A9, A15, A53 and A72

Here are some examples of pre-built library with its relative path to “PDK_INSTALL_DIR/packages”:

  • ti/drv/udma/lib/j721e/mcu1_0/release/udma.aer5f
  • ti/osal/lib/freertos/j721e/r5f/release/ti.osal.aer5f
  • ti/drv/i2c/ib/j721e/a72/debug/ti.drv.i2c.aa53fg
  • ti/board/lib/j721e_evm/c66/release/ti.board.ae66