Bug Fix: PRSDK-8528: Patch 4
authorSivaraj R <sivaraj@ti.com>
Thu, 28 May 2020 04:29:17 +0000 (09:59 +0530)
committerSujith Shivalingappa <a0393175@ti.com>
Thu, 28 May 2020 07:21:11 +0000 (02:21 -0500)
- Top level scripts files were missing
- There are part of https://bitbucket.itg.ti.com/projects/PROCESSOR-SDK/repos/processor-pdk-packages/browse/release/full
repo.
- These were packaged as part of Yocto and was missed
- These are now maintained here and will be removed from Yocto flow
and from above repo as well

Signed-off-by: Sivaraj R <sivaraj@ti.com>
packages/macros.ini [new file with mode: 0644]
packages/pdkAppImageCreate.bat [new file with mode: 0755]
packages/pdkAppImageCreate.sh [new file with mode: 0755]
packages/pdkProjectCreate.bat [new file with mode: 0644]
packages/pdkProjectCreate.sh [new file with mode: 0644]

diff --git a/packages/macros.ini b/packages/macros.ini
new file mode 100644 (file)
index 0000000..e00cf81
--- /dev/null
@@ -0,0 +1,32 @@
+PDK_INSTALL_PATH       = ../../\r
+CSL_INSTALL_PATH       = ../../\r
+BOARD_INSTALL_PATH     = ../../\r
+SBL_BOOT_INSTALL_PATH  = ../../\r
+FATFS_INSTALL_PATH     = ../../\r
+OSAL_INSTALL_PATH      = ../../\r
+NIMU_INSTAL_PATH       = ../../\r
+NIMU_ICSS_INSTALL_PATH = ../../\r
+GPIO_INSTALL_PATH      = ../../\r
+I2C_INSTALL_PATH       = ../../\r
+ICSS_EMAC_INSTALL_PATH = ../../\r
+MMCSD_INSTALL_PATH     = ../../\r
+PCIE_INSTALL_PATH      = ../../\r
+PRUSS_INSTALL_PATH     = ../../\r
+SPI_INSTALL_PATH       = ../../\r
+UART_INSTALL_PATH      = ../../\r
+USB_INSTALL_PATH       = ../../\r
+SRIO_INSTALL_PATH      = ../../\r
+CPPI_INSTALL_PATH      = ../../\r
+QMSS_INSTALL_PATH      = ../../\r
+FFTC_INSTALL_PATH      = ../../\r
+TCP3D_INSTALL_PATH     = ../../\r
+PASS_INSTALL_PATH      = ../../\r
+BCP_INSTALL_PATH       = ../../\r
+AIF2_INSTALL_PATH      = ../../\r
+PKTLIB_INSTALL_PATH    = ../../\r
+NWAL_INSTALL_PATH      = ../../\r
+SA_INSTALL_PATH        = ../../\r
+DFE_INSTALL_PATH       = ../../\r
+IQN_INSTALL_PATH       = ../../\r
+IQN2_INSTALL_PATH      = ../../\r
+PKTLIB_INSTALL_PATH    = ../../\r
diff --git a/packages/pdkAppImageCreate.bat b/packages/pdkAppImageCreate.bat
new file mode 100755 (executable)
index 0000000..cb44821
--- /dev/null
@@ -0,0 +1,127 @@
+@REM ******************************************************************************\r
+@REM * FILE PURPOSE: PDK Unit Test and Example Project Creator\r
+@REM ******************************************************************************\r
+@REM * FILE NAME: pdkAppImageCreate.bat\r
+@REM *\r
+@REM * DESCRIPTION: \r
+@REM *  The script file is used to create bootable application binaries from the\r
+@REM *  executable generated by the CCS Projects.\r
+@REM *\r
+@REM * Syntax:\r
+@REM *  pdkAppImageCreate.bat [PDK_PATH] [CG_TOOL_PATH] [APP_PATH] [APP_NAME] [SOC] [PROCESSOR]\r
+@REM *\r
+@REM *\r
+@REM * Copyright (C) 2016-2018, Texas Instruments, Inc.\r
+@REM *****************************************************************************\r
+@echo off\r
+\r
+set PDK_PATH=%1\r
+set CG_TOOL_PATH=%2\r
+set APP_PATH=%3\r
+set APP_NAME=%4\r
+set SOC=%5\r
+set PROCESSOR=%6\r
+\r
+@if %SOC% == AM437x (\r
+    goto SOC_AM3_AM4\r
+)\r
+@if %SOC% == AM335x (\r
+    goto SOC_AM3_AM4\r
+)\r
+@if %SOC% == AM572x (\r
+    goto SOC_AM57XX\r
+)\r
+@if %SOC% == AM574x (\r
+    goto SOC_AM57XX\r
+)\r
+@if %SOC% == AM571x (\r
+    goto SOC_AM57XX\r
+) \r
+@if %SOC% == am65xx (\r
+    goto SOC_K3\r
+) \r
+@if %SOC% == j721e (\r
+    goto SOC_K3\r
+) \r
+@if %SOC% == K2G (\r
+    goto SOC_K2G\r
+)\r
+@if %SOC% == OMAPL137 (\r
+    goto SOC_OMAPL13X\r
+)\r
+@if %SOC% == OMAPL138 (\r
+    goto SOC_OMAPL13X\r
+)\r
+\r
+@goto ENDSCRIPT\r
+\r
+:SOC_AM57XX\r
+    if %PROCESSOR% == arm (\r
+        set BIN_PATH=%APP_PATH%\r
+        set APP_MPU_CPU0=%APP_PATH%/%APP_NAME%.out\r
+        set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
+        call %PDK_PATH%/ti/boot/sbl/tools/scripts/AM57xImageGen.bat\r
+    )\r
+    if %PROCESSOR% == dsp (\r
+        set BIN_PATH=%APP_PATH%\r
+        set APP_DSP1=%APP_PATH%/%APP_NAME%.out\r
+        set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
+        call %PDK_PATH%/ti/boot/sbl/tools/scripts/AM57xImageGen.bat\r
+    )\r
+    if %PROCESSOR% == m4 (\r
+        set BIN_PATH=%APP_PATH%\r
+        set APP_IPU1_CPU0=%APP_PATH%/%APP_NAME%.out\r
+        set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
+        call %PDK_PATH%/ti/boot/sbl/tools/scripts/AM57xImageGen.bat\r
+    )\r
+    goto ENDSCRIPT\r
+\r
+:SOC_K3\r
+    @REM Refer to SBL document for core ID value (0, or 4 bellow).\r
+    if %PROCESSOR% == mpu (\r
+        set BIN_PATH=%APP_PATH%\r
+        set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
+        call %PDK_PATH%/ti/boot/sbl/tools/scripts/K3ImageGen.bat 0 %APP_PATH%/%APP_NAME%.out\r
+    )\r
+    if %PROCESSOR% == mcu (\r
+        set BIN_PATH=%APP_PATH%\r
+        set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
+        call %PDK_PATH%/ti/boot/sbl/tools/scripts/K3ImageGen.bat 4 %APP_PATH%/%APP_NAME%.out\r
+    )\r
+    goto ENDSCRIPT\r
+:SOC_K2G\r
+    if %PROCESSOR% == arm (\r
+        set BIN_PATH=%APP_PATH%\r
+        set APP_MPU_CPU0=%APP_PATH%/%APP_NAME%.out\r
+        set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
+        call %PDK_PATH%/ti/boot/sbl/tools/scripts/K2GImageGen.bat\r
+    )\r
+    if %PROCESSOR% == dsp (\r
+        set BIN_PATH=%APP_PATH%\r
+        set APP_DSP0=%APP_PATH%/%APP_NAME%.out\r
+        set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
+        call %PDK_PATH%/ti/boot/sbl/tools/scripts/K2GImageGen.bat\r
+    )\r
+    goto ENDSCRIPT\r
+\r
+:SOC_AM3_AM4\r
+    %CG_TOOL_PATH%/bin/arm-none-eabi-objcopy -O binary %APP_NAME%.out %APP_NAME%.bin\r
+    %PDK_PATH%/ti/starterware/tools/ti_image/tiimage.exe 0x80000000 NONE %APP_NAME%.bin app )\r
+    goto ENDSCRIPT\r
+\r
+:SOC_OMAPL13X\r
+    if %PROCESSOR% == arm (\r
+        set BIN_PATH=%APP_PATH%\r
+        set APP_MPU_CPU0=%APP_PATH%/%APP_NAME%.out\r
+        set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
+        call %PDK_PATH%/ti/boot/sbl/tools/scripts/OMAPL13xImageGen.bat\r
+    )\r
+    if %PROCESSOR% == dsp (\r
+        set BIN_PATH=%APP_PATH%\r
+        set APP_DSP0=%APP_PATH%/%APP_NAME%.out\r
+        set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
+        call %PDK_PATH%/ti/boot/sbl/tools/scripts/OMAPL13xImageGen.bat\r
+    )\r
+    goto ENDSCRIPT\r
+\r
+:ENDSCRIPT\r
diff --git a/packages/pdkAppImageCreate.sh b/packages/pdkAppImageCreate.sh
new file mode 100755 (executable)
index 0000000..84b322d
--- /dev/null
@@ -0,0 +1,115 @@
+#!/bin/bash
+# ******************************************************************************
+# * FILE PURPOSE: Creates the bootable application binary
+# ******************************************************************************
+# * FILE NAME: pdkAppImageCreate.sh
+# *
+# * DESCRIPTION: 
+# *  Creates bootable application binary from the .out file generated by the
+# *  CCS projects.
+# *
+# * USAGE:
+# *  pdkAppImageCreate.sh [PDK_PATH] [CG_TOOL_PATH] [APP_PATH] [APP_NAME] [SOC] [PROCESSOR] [SECUREMODE=yes/no]
+# *
+# *  SECUREMODE parameter is optional. Will fall back to GP build if not specified
+# *
+# * Copyright (C) 2016 - 2018, Texas Instruments, Inc.
+# *****************************************************************************
+
+export PDK_PATH=$1
+export CG_TOOL_PATH=$2
+export APP_PATH=$3
+export APP_NAME=$4
+export SOC=$5
+export PROCESSOR=$6
+export SECUREMODE=$7
+
+if [ $SOC == AM437x ] || [ $SOC == AM335x ]; then
+        $CG_TOOL_PATH/bin/arm-none-eabi-objcopy -O binary $APP_NAME.out $APP_NAME.bin
+        $PDK_PATH/ti/starterware/tools/ti_image/tiimage_bin/tiimage 0x80000000 NONE $APP_NAME.bin app
+
+        if [ "$SECUREMODE" == "SECUREMODE=yes" ]; then
+
+            # setting the TI_SECURE_SEC_DEV_PKG variable
+            source $PDK_PATH/pdksetupenv.sh
+
+            if [ ! -z $TI_SECURE_DEV_PKG ]; then
+                echo TI_SECURE_DEV_PKG set. Secure the app ...
+                $TI_SECURE_DEV_PKG/scripts/secure-binary-image.sh $APP_NAME.bin "$APP_NAME"_signed.bin
+                $PDK_PATH/ti/starterware/tools/ti_image/tiimage_bin/tiimage 0x80000000 NONE "$APP_NAME"_signed.bin "$APP_NAME"_signed_ti.bin
+                echo "$APP_NAME"_signed.bin can be loaded by SBL UART boot
+                echo "$APP_NAME"_signed_ti.bin can be loaded by SBL MMCSD boot
+            else
+                echo "SECURE mode requested but TI_SECURE_DEV_PKG is not defined..."
+            fi
+        fi
+fi
+
+if [ $SOC == AM572x ] || [ $SOC == AM571x ] || [ $SOC == AM574x ]; then
+    if [ "$PROCESSOR" == "arm" ]; then
+        export BIN_PATH=$APP_PATH
+        export APP_MPU_CPU0=$APP_PATH/$APP_NAME.out
+        export TOOLS_PATH=$PDK_PATH/ti/boot/sbl/tools
+        . $PDK_PATH/ti/boot/sbl/tools/scripts/AM57xImageGen.sh
+    elif [ "$PROCESSOR" == "dsp" ]; then
+        export BIN_PATH=$APP_PATH
+        export APP_DSP1=$APP_PATH/$APP_NAME.out
+        export TOOLS_PATH=$PDK_PATH/ti/boot/sbl/tools
+        . $PDK_PATH/ti/boot/sbl/tools/scripts/AM57xImageGen.sh
+    elif [ "$PROCESSOR" == "m4" ]; then
+        export BIN_PATH=$APP_PATH
+        export APP_IPU1_CPU0=$APP_PATH/$APP_NAME.out
+        export TOOLS_PATH=$PDK_PATH/ti/boot/sbl/tools
+        . $PDK_PATH/ti/boot/sbl/tools/scripts/AM57xImageGen.sh
+    else
+        echo Invalid Processor core
+    fi
+fi
+
+if [ $SOC == K2G ]; then
+    if [ "$PROCESSOR" == "arm" ]; then
+        export BIN_PATH=$APP_PATH
+        export APP_MPU_CPU0=$APP_PATH/$APP_NAME.out
+        export TOOLS_PATH=$PDK_PATH/ti/boot/sbl/tools
+        . $PDK_PATH/ti/boot/sbl/tools/scripts/K2GImageGen.sh
+    elif [ "$PROCESSOR" == "dsp" ]; then
+        export BIN_PATH=$APP_PATH
+        export APP_DSP0=$APP_PATH/$APP_NAME.out
+        export TOOLS_PATH=$PDK_PATH/ti/boot/sbl/tools
+        . $PDK_PATH/ti/boot/sbl/tools/scripts/K2GImageGen.sh
+    else
+        echo Invalid Processor core
+    fi
+fi
+
+if [ $SOC == OMAPL137 ] || [ $SOC == OMAPL138 ]; then
+    if [ "$PROCESSOR" == "arm" ]; then
+        export BIN_PATH=$APP_PATH
+        export APP_MPU_CPU0=$APP_PATH/$APP_NAME.out
+        export TOOLS_PATH=$PDK_PATH/ti/boot/sbl/tools
+        . $PDK_PATH/ti/boot/sbl/tools/scripts/OMAPL13xImageGen.sh
+    elif [ "$PROCESSOR" == "dsp" ]; then
+        export BIN_PATH=$APP_PATH
+        export APP_DSP0=$APP_PATH/$APP_NAME.out
+        export TOOLS_PATH=$PDK_PATH/ti/boot/sbl/tools
+        . $PDK_PATH/ti/boot/sbl/tools/scripts/OMAPL13xImageGen.sh
+    else
+        echo Invalid Processor core
+    fi
+fi
+
+
+if [ $SOC == am65xx ] || [ $SOC == j721e ]; then
+    #Refer to SBL document for core ID value (0, or 4 bellow).
+    if [ "$PROCESSOR" == "mpu" ]; then
+        export BIN_PATH=$APP_PATH
+        export TOOLS_PATH=$PDK_PATH/ti/boot/sbl/tools
+        . $PDK_PATH/ti/boot/sbl/tools/scripts/K3ImageGen.sh 0 $APP_PATH/$APP_NAME.out
+    elif [ "$PROCESSOR" == "mcu" ]; then
+        export BIN_PATH=$APP_PATH
+        export TOOLS_PATH=$PDK_PATH/ti/boot/sbl/tools
+        . $PDK_PATH/ti/boot/sbl/tools/scripts/K3ImageGen.sh 4 $APP_PATH/$APP_NAME.out
+    else
+        echo Invalid Processor core
+    fi
+fi
diff --git a/packages/pdkProjectCreate.bat b/packages/pdkProjectCreate.bat
new file mode 100644 (file)
index 0000000..0bca647
--- /dev/null
@@ -0,0 +1,870 @@
+@REM ******************************************************************************\r
+@REM * FILE PURPOSE: PDK Unit Test and Example Project Creator\r
+@REM ******************************************************************************\r
+@REM * FILE NAME: pdkProjectCreate.bat\r
+@REM *\r
+@REM * DESCRIPTION: \r
+@REM *  The script file is used to create the test and example projects of all\r
+@REM *  components under PDK. These projects are available in the specified\r
+@REM *  workspace.\r
+@REM *\r
+@REM * Syntax:\r
+@REM *  pdkProjectCreate.bat [soc] [board] [endian] [module] [project type] [processor] [pdkDir]\r
+@REM *\r
+@REM * Description:       (first option is default)\r
+@REM *  soc           -   AM335x / AM437x / AM571x / AM572x / AM574x / K2E / K2G / K2K / K2H / K2L /\r
+@REM *                    C6678 / C6657 / DRA72x / DRA75x / DRA78x / OMAPL137 / OMAPL138 / C6748 / am65xx\r
+@REM *  board         -   all (use "all" for K2X and C66X SOCs)\r
+@REM *                    -or-\r
+@REM *                    Refer to pdk_<soc>_<version>\packages\ti\board\lib\r
+@REM *                    for valid board inputs for the soc\r
+@REM *  endian        -   little / big\r
+@REM *  module        -   all\r
+@REM *                    -or-\r
+@REM *                    aif2 / bcp / cppi / csl / dfe / emac / fatfs / fm / fftc / \r
+@REM *                    gpio / hyplnk / i2c / icss_emac / iqn2 / mcasp / mcbsp / mmap / mmcsd /\r
+@REM *                    nimu / nimu_icss / nwal / osal / pa / pcie / pktlib / pruss / qm / rm /\r
+@REM *                    sa /serdes-diag / spi / srio / tcp3d / tfw / transportqmss /\r
+@REM *                    transportsrio / tsip / uart / usb / wdtimer / vps / dcan / dss / lcdc\r
+@REM *  project type  -   all / example / test \r
+@REM *  processor     -   arm / dsp / m4 / mpu / mcu\r
+@REM *  pdkDir        -   THIS FILE LOCATION / "C:\ti\pdk_<soc>_<version>\packages"\r
+@REM *\r
+@REM * Example:\r
+@REM *  a) pdkProjectCreate.bat\r
+@REM *              - Creates all module projects for the AM335x soc for arm little endian\r
+@REM *  b) pdkProjectCreate.bat AM437x\r
+@REM *              - Creates all module projects for the AM437x soc for arm little endian\r
+@REM *  c) pdkProjectCreate.bat AM437x idkAM437x\r
+@REM *              - Creates all module projects for idkAM437x device for arm little endian\r
+@REM *  d) pdkProjectCreate.bat AM571x evmAM571x little\r
+@REM *              - Creates all module projects for evmAM571x device for arm little endian\r
+@REM *  e) pdkProjectCreate.bat AM571x evmAM571x little i2c all dsp\r
+@REM *              - Creates all i2c module projects for evmAM571x device for dsp little endian\r
+@REM *  f) pdkProjectCreate.bat K2H all little i2c example arm\r
+@REM *              - Creates i2c module example projects for K2H device for arm little endian\r
+@REM *  g) pdkProjectCreate.bat C6678 all little hyplnk test dsp\r
+@REM *              - Creates hyplnk module test projects for C6678 device for dsp little endian\r
+@REM *\r
+@REM * Copyright (C) 2012-2019, Texas Instruments, Inc.\r
+@REM *****************************************************************************\r
+@echo OFF\r
+setlocal enabledelayedexpansion\r
+\r
+REM Lists of valid input parameters - MUST be updated as new input parameters are added\r
+REM *****************************************************************************\r
+set soc_list=AM335x AM437x AM571x AM572x AM574x K2E K2K K2H K2L K2G C6678 C6657 DRA72x DRA75x DRA78x OMAPL137 OMAPL138 C6748 am65xx\r
+set endian_list=little big\r
+set module_list=all aif2 bcp cppi csl dfe emac fatfs fm fftc gpio gpmc hyplnk i2c icss_emac iqn2 mcasp mcbsp mmap mmcsd nimu nimu_icss nwal osal pa pcie pktlib pruss qm rm sa serdes_diag spi srio tcp3d tfw transportqmss transportsrio tsip uart usb wdtimer vps dcan dss lcdc timeSync\r
+set projectType_list=all example test\r
+set proc_list=arm dsp m4 mpu mcu\r
+\r
+REM Parameter Validation: Check if the argument was passed to the batch file.\r
+REM *****************************************************************************\r
+REM Argument [soc] is used to set SOC variable.\r
+set tempVar1=%1\r
+if not defined tempVar1 goto nosoc\r
+set SOC=%tempVar1%\r
+goto socdone\r
+:nosoc\r
+set SOC=AM335x\r
+:socdone\r
+\r
+REM Argument [board] is used to set BOARD variable.\r
+REM This is the board type of the soc for which project are to be created.\r
+set tempVar2=%2\r
+if not defined tempVar2 goto noboard\r
+set BOARD=%tempVar2%\r
+goto boarddone\r
+:noboard\r
+set BOARD=all\r
+:boarddone\r
+\r
+REM Argument [endian] is used to set ENDIAN variable.\r
+REM This is Endianess of the projects being created.\r
+REM Valid Values are 'little' and 'big'. Defaults to 'little'.\r
+set tempVar3=%3\r
+if not defined tempVar3 goto littleendian\r
+set ENDIAN=%tempVar3%\r
+goto endiandone\r
+:littleendian\r
+set ENDIAN=little\r
+:endiandone\r
+\r
+REM Argument [module] is used to set MODULE variable.\r
+REM This is specific module for which projects are created.\r
+REM Valid Values are LLD name. Defaults to all LLD's.\r
+set tempVar4=%4\r
+if not defined tempVar4 goto nomodule\r
+set MODULE=%tempVar4%\r
+goto moduledone\r
+:nomodule\r
+set MODULE=all\r
+:moduledone\r
+\r
+REM Argument [project type] is used to set PROJECT_TYPE variable.\r
+REM This is the type of projects that are created\r
+REM Valid Values are all, example, or test. Defaults to all. \r
+set tempVar5=%5\r
+if not defined tempVar5 goto noProjectType\r
+set PROJECT_TYPE=%tempVar5%\r
+goto projectTypeDone\r
+:noProjectType\r
+set PROJECT_TYPE=all\r
+:projectTypeDone\r
+\r
+REM Argument [processor] is used to set PROCESSOR variable.\r
+REM This is specific processor type for which projects are created.\r
+REM Valid Values are arm, dsp, or m4 . Defaults to arm.\r
+set tempVar6=%6\r
+if not defined tempVar6 goto noprocessor\r
+set PROCESSOR=%tempVar6%\r
+goto processordone\r
+:noprocessor\r
+set PROCESSOR=arm\r
+:processordone\r
+\r
+REM Argument [pdkDir] is used to set PDK_SHORT_NAME. This is PDK directory\r
+REM where project description files are located. If there is no value passed,\r
+REM it defaults to the file location directory. Then convert the variable to \r
+REM short name to avoid issues using batch file commands.\r
+set tempVar7=%7\r
+if not defined tempVar7 goto noparameter\r
+set PDK_SHORT_NAME=%tempVar7%\r
+goto done\r
+:noparameter\r
+set PDK_SHORT_NAME=%~sdp0\r
+:done\r
+\r
+if not defined SDK_INSTALL_PATH (\r
+    set SDK_INSTALL_PATH=__SDK__INSTALL_DIR__\r
+)\r
+\r
+REM *****************************************************************************\r
+\r
+echo =========================================================================\r
+echo Configuration:\r
+echo.   SOC             :   %SOC%\r
+echo    BOARD           :   %BOARD%\r
+echo.   ENDIAN          :   %ENDIAN%\r
+echo.   MODULE          :   %MODULE%\r
+echo.   PROJECT_TYPE    :   %PROJECT_TYPE%\r
+echo.   PROCESSOR       :   %PROCESSOR%\r
+echo.   PDK_SHORT_NAME  :   %PDK_SHORT_NAME%\r
+echo =========================================================================\r
+echo Checking Configuration...\r
+\r
+for %%a in (%soc_list%) do (\r
+    if %SOC% == %%a (\r
+        goto end_soc_check\r
+    )\r
+)\r
+echo ERROR: SOC (%SOC%) is invalid\r
+goto CONFIG_ERR\r
+:end_soc_check\r
+\r
+if %BOARD% == all (\r
+    goto end_board_check\r
+)\r
+if %BOARD% == iceAMIC110 (\r
+    if %SOC% == AM335x (\r
+        goto end_board_check\r
+    )\r
+    goto board_check_error\r
+)\r
+set board_type=!BOARD:%SOC%=!\r
+if not %board_type% == %BOARD% (\r
+    goto end_board_check\r
+)\r
+:board_check_error\r
+echo ERROR: Board (%BOARD%) is invalid for the specified SOC (%SOC%)\r
+goto CONFIG_ERR\r
+:end_board_check\r
+\r
+for %%a in (%endian_list%) do (\r
+    if %ENDIAN% == %%a (\r
+        goto end_endian_check\r
+    )\r
+)\r
+echo ERROR: Endian (%ENDIAN%) is invalid\r
+goto CONFIG_ERR\r
+:end_endian_check\r
+\r
+for %%a in (%module_list%) do (\r
+    if %MODULE% == %%a (\r
+        goto end_module_check\r
+    )\r
+)\r
+echo ERROR: Module (%MODULE%) is invalid\r
+goto CONFIG_ERR\r
+:end_module_check\r
+\r
+for %%a in (%projectType_list%) do (\r
+    if %PROJECT_TYPE% == %%a (\r
+        goto end_projectType_check\r
+    )\r
+)\r
+echo ERROR: Project type (%PROJECT_TYPE%) is invalid\r
+goto CONFIG_ERR\r
+:end_projectType_check\r
+\r
+for %%a in (%proc_list%) do (\r
+    if %PROCESSOR% == %%a (\r
+        goto end_proc_check\r
+    )\r
+)\r
+echo ERROR: Processor (%PROCESSOR%) is invalid\r
+goto CONFIG_ERR\r
+:end_proc_check\r
+\r
+if %SOC% == AM335x (\r
+    if %PROCESSOR% == dsp (\r
+        echo ERROR: The AM335x soc does not contain a DSP processor\r
+        goto CONFIG_ERR\r
+    ) else if %PROCESSOR% == m4 (\r
+        echo ERROR: The AM335x soc does not contain a M4 processor\r
+        goto CONFIG_ERR\r
+    )\r
+\r
+    if %ENDIAN% == big (\r
+        echo ERROR: The AM335x soc's arm does not support big endian\r
+        goto CONFIG_ERR\r
+    )\r
+) else if %SOC% == AM437x (\r
+    if %PROCESSOR% == dsp (\r
+        echo ERROR: The AM437x soc does not contain a DSP processor\r
+        goto CONFIG_ERR\r
+    ) else if %PROCESSOR% == m4 (\r
+        echo ERROR: The AM437x soc does not contain a M4 processor\r
+        goto CONFIG_ERR\r
+    )\r
+\r
+    if %ENDIAN% == big (\r
+        echo ERROR: The AM437x soc's arm does not support big endian\r
+        goto CONFIG_ERR\r
+    )\r
+) else if %SOC% == AM571x (\r
+    if %ENDIAN% == big (\r
+        echo ERROR: The AM571x soc's processor's do not support big endian\r
+        goto CONFIG_ERR\r
+    )\r
+) else if %SOC% == AM572x (\r
+    if %ENDIAN% == big (\r
+        echo ERROR: The AM572x soc's processor's do not support big endian\r
+        goto CONFIG_ERR\r
+    )\r
+) else if %SOC% == AM574x (\r
+    if %ENDIAN% == big (\r
+        echo ERROR: The AM574x soc's processor's do not support big endian\r
+        goto CONFIG_ERR\r
+    )\r
+)  else if %SOC% == K2K (\r
+    if %PROCESSOR% == m4 (\r
+        echo ERROR: The K2K soc does not contain a M4 processor\r
+        goto CONFIG_ERR\r
+    )\r
+    \r
+    if %PROCESSOR% == arm (\r
+        if %ENDIAN% == big (\r
+            echo ERROR: The K2K soc's arm does not support big endian\r
+            goto CONFIG_ERR\r
+        )\r
+    )\r
+) else if %SOC% == K2H (\r
+    if %PROCESSOR% == m4 (\r
+        echo ERROR: The K2H soc does not contain a M4 processor\r
+        goto CONFIG_ERR\r
+    )\r
+    \r
+    if %PROCESSOR% == arm (\r
+        if %ENDIAN% == big (\r
+            echo ERROR: The K2H soc's arm does not support big endian\r
+            goto CONFIG_ERR\r
+        )\r
+    )\r
+) else if %SOC% == K2E (\r
+    if %PROCESSOR% == m4 (\r
+        echo ERROR: The K2E soc does not contain a M4 processor\r
+        goto CONFIG_ERR\r
+    )\r
+    \r
+    if %PROCESSOR% == arm (\r
+        if %ENDIAN% == big (\r
+            echo ERROR: The K2E soc's arm does not support big endian\r
+            goto CONFIG_ERR\r
+        )\r
+    )\r
+) else if %SOC% == K2L (\r
+    if %PROCESSOR% == m4 (\r
+        echo ERROR: The K2L soc does not contain a M4 processor\r
+        goto CONFIG_ERR\r
+    )\r
+    \r
+    if %PROCESSOR% == arm (\r
+        if %ENDIAN% == big (\r
+            echo ERROR: The K2L soc's arm does not support big endian\r
+            goto CONFIG_ERR\r
+        )\r
+    )\r
+) else if %SOC% == K2G (\r
+    if %PROCESSOR% == m4 (\r
+        echo ERROR: The K2G soc does not contain a M4 processor\r
+        goto CONFIG_ERR\r
+    )\r
+    \r
+    if %PROCESSOR% == arm (\r
+        if %ENDIAN% == big (\r
+            echo ERROR: The K2G soc's arm does not support big endian\r
+            goto CONFIG_ERR\r
+        )\r
+    )\r
+) else if %SOC% == OMAPL137 (\r
+    if %PROCESSOR% == m4 (\r
+        echo ERROR: The OMAPL137 soc does not contain a M4 processor\r
+        goto CONFIG_ERR\r
+    )\r
+    \r
+    if %PROCESSOR% == arm (\r
+        if %ENDIAN% == big (\r
+            echo ERROR: The OMAPL137 soc's arm does not support big endian\r
+            goto CONFIG_ERR\r
+        )\r
+    )\r
+       if %PROCESSOR% == dsp (\r
+        if %ENDIAN% == big (\r
+            echo ERROR: The OMAPL137 soc's dsp does not support big endian\r
+            goto CONFIG_ERR\r
+        )\r
+    )\r
+)  else if %SOC% == OMAPL138 (\r
+    if %PROCESSOR% == m4 (\r
+        echo ERROR: The OMAPL138 soc does not contain a M4 processor\r
+        goto CONFIG_ERR\r
+    )\r
+    \r
+    if %PROCESSOR% == arm (\r
+        if %ENDIAN% == big (\r
+            echo ERROR: The OMAPL138 soc's arm does not support big endian\r
+            goto CONFIG_ERR\r
+        )\r
+    )\r
+       if %PROCESSOR% == dsp (\r
+        if %ENDIAN% == big (\r
+            echo ERROR: The OMAPL138 soc's dsp does not support big endian\r
+            goto CONFIG_ERR\r
+        )\r
+    )\r
+) else if %SOC% == C6748 (\r
+    if %PROCESSOR% == m4 (\r
+        echo ERROR: The C6748 soc does not contain a M4 processor\r
+        goto CONFIG_ERR\r
+    )\r
+       if %PROCESSOR% == arm (\r
+        echo ERROR: The C6748 soc does not contain an arm processor\r
+        goto CONFIG_ERR\r
+    )\r
+       if %PROCESSOR% == dsp (\r
+        if %ENDIAN% == big (\r
+            echo ERROR: The C6748 soc's dsp does not support big endian\r
+            goto CONFIG_ERR\r
+        )\r
+    )\r
+) else if %SOC% == C6678 (\r
+    if %PROCESSOR% == m4 (\r
+        echo ERROR: The C6678 soc does not contain a M4 processor\r
+        goto CONFIG_ERR\r
+    )\r
+\r
+    if %PROCESSOR% == arm (\r
+        echo ERROR: The C6678 soc does not contain an arm processor\r
+        goto CONFIG_ERR\r
+    )\r
+) else if %SOC% == C6657 (\r
+    if %PROCESSOR% == m4 (\r
+        echo ERROR: The C6657 soc does not contain a M4 processor\r
+        goto CONFIG_ERR\r
+    )\r
+\r
+    if %PROCESSOR% == arm (\r
+        echo ERROR: The C6657 soc does not contain an arm processor\r
+        goto CONFIG_ERR\r
+    )\r
+) else if %SOC% == DRA72x (\r
+    if %ENDIAN% == big (\r
+        echo ERROR: The DRA72x soc's processor's do not support big endian\r
+        goto CONFIG_ERR\r
+    )\r
+) else if %SOC% == DRA75x (\r
+    if %ENDIAN% == big (\r
+        echo ERROR: The DRA75x soc's processor's do not support big endian\r
+        goto CONFIG_ERR\r
+    )\r
+) else if %SOC% == DRA78x (\r
+    if %ENDIAN% == big (\r
+        echo ERROR: the DRA78x soc's processor's do not support big endian\r
+        goto CONFIG_ERR\r
+    )\r
+) else if %SOC% == am65xx (\r
+    if %PROCESSOR% == dsp (\r
+        echo ERROR: The AM65xx soc does not contain a DSP processor\r
+        goto CONFIG_ERR\r
+    )\r
+    if %PROCESSOR% == m4 (\r
+        echo ERROR: The AM65xx soc does not contain a M4 processor\r
+        goto CONFIG_ERR\r
+    )\r
+    if %ENDIAN% == big (\r
+        echo ERROR: The AM65xx soc's processor's do not support big endian\r
+        goto CONFIG_ERR\r
+    )\r
+) else (\r
+    echo ERROR: Invalid soc\r
+    goto CONFIG_ERR\r
+)\r
+\r
+goto CONFIG_COMPLETE\r
+\r
+:CONFIG_ERR\r
+echo Exiting...\r
+echo =========================================================================\r
+goto ENDSCRIPT\r
+\r
+:CONFIG_COMPLETE\r
+echo Complete\r
+echo =========================================================================\r
+\r
+REM *****************************************************************************\r
+REM * Version Information of the various tools etc required to build the test\r
+REM * projects. Customers are free to modify these to meet their requirements.\r
+REM *****************************************************************************\r
+\r
+REM This is to control the CCS version specific project create command\r
+REM Set to 'no' when using CCSv8 or set to 'yes' when using CCSv4\r
+set IS_CCS_VERSION_4=no\r
+\r
+REM Set to 'no' when using QT, EVM, VDB, or other hardware. Set to 'yes' only when using the simulator.\r
+set IS_SIMULATOR_SUPPORT_NEEDED=no\r
+\r
+if not defined CCS_INSTALL_PATH (\r
+    set CCS_INSTALL_PATH=C:/ti/ccs930/ccs\r
+)\r
+\r
+REM Workspace where the PDK projects will be created.\r
+set MY_WORKSPACE=%PDK_SHORT_NAME%\MyExampleProjects\r
+\r
+REM macros.ini location\r
+set MACROS_FILE=%PDK_SHORT_NAME%\macros.ini\r
+\r
+REM This is the format of the executable being created\r
+REM Valid Values are 'ELF' and 'COFF'\r
+set OUTPUT_FORMAT=ELF\r
+\r
+REM Version of CG-Tools\r
+set CGT_VERSION=8.3.2\r
+\r
+REM Version of CG-ARM-Tools for M4\r
+set CGT_M4_VERSION=18.12.5.LTS\r
+\r
+REM Version of XDC\r
+set XDC_VERSION=3.55.02.22\r
+\r
+REM Version of BIOS\r
+set BIOS_VERSION=6.76.03.01\r
+\r
+REM Version of CG-Tools for ARM\r
+set CGT_VERSION_ARM=GNU_7.2.1:Linaro\r
+\r
+REM Version of CG-Tools for ARM\r
+set CGT_VERSION_ARM_A53=GNU_7.2.1:Linaro aarch64\r
+\r
+REM Version of CG-Tools for ARM\r
+set CGT_VERSION_ARM9=18.12.5.LTS\r
+\r
+REM Version of the IPC\r
+set IPC_VERSION=__IPC_VER__\r
+\r
+REM EDMA3 Version\r
+set EDMA_VERSION=2.12.05.30E\r
+\r
+REM Version of the PDK\r
+set PDK_VERSION=__PDK_VER__\r
+\r
+REM Version of the NDK\r
+set NDK_VERSION=3.61.01.01\r
+\r
+REM Version of UIA\r
+set UIA_VERSION=2.30.01.02\r
+\r
+REM PDK Part Number & Platform name\r
+if %SOC% == K2K (\r
+    set PDK_PARTNO=TCI6638\r
+    set PDK_ECLIPSE_ID=com.ti.pdk.k2hk\r
+    set RTSC_PLATFORM_NAME=ti.platforms.evmTCI6638K2K\r
+    if %PROCESSOR% == arm (\r
+        set RTSC_TARGET=gnu.targets.arm.A15F\r
+        set CCS_DEVICE="Cortex A.TCI6638K2K"\r
+    )\r
+) else if  %SOC% == K2H (\r
+    set PDK_PARTNO=TCI6636\r
+    set PDK_ECLIPSE_ID=com.ti.pdk.k2hk\r
+    set RTSC_PLATFORM_NAME=ti.platforms.evmTCI6636K2H\r
+    if %PROCESSOR% == arm (\r
+        set RTSC_TARGET=gnu.targets.arm.A15F\r
+        set CCS_DEVICE="Cortex A.66AK2H12"\r
+    )\r
+) else if  %SOC% == K2L (\r
+    set PDK_PARTNO=TCI6630\r
+    set PDK_ECLIPSE_ID=com.ti.pdk.k2l\r
+    set RTSC_PLATFORM_NAME=ti.platforms.evmTCI6630K2L\r
+    if %PROCESSOR% == arm (\r
+        set RTSC_TARGET=gnu.targets.arm.A15F\r
+        set CCS_DEVICE="Cortex A.TCI6630K2L"\r
+    )\r
+) else if  %SOC% == K2E (\r
+    set PDK_PARTNO=66AK2E05\r
+    set PDK_ECLIPSE_ID=com.ti.pdk.k2e\r
+    set RTSC_PLATFORM_NAME=ti.platforms.evmC66AK2E\r
+    if %PROCESSOR% == arm (\r
+        set RTSC_TARGET=gnu.targets.arm.A15F\r
+        set CCS_DEVICE="Cortex A.66AK2E05"\r
+    )\r
+) else if  %SOC% == K2G (\r
+    set PDK_PARTNO=66AK2G02\r
+    set PDK_ECLIPSE_ID=com.ti.pdk.k2g\r
+    set RTSC_PLATFORM_NAME=ti.platforms.evmTCI66AK2G02\r
+    if %PROCESSOR% == arm (\r
+        set RTSC_TARGET=gnu.targets.arm.A15F\r
+        set CCS_DEVICE="Cortex A.66AK2G02"\r
+    )\r
+) else if  %SOC% == AM571x (\r
+    set PDK_PARTNO=AM571X\r
+    set PDK_ECLIPSE_ID=com.ti.pdk.am57xx\r
+    set RTSC_PLATFORM_NAME=ti.platforms.idkAM571X\r
+    if %PROCESSOR% == arm (\r
+        set RTSC_TARGET=gnu.targets.arm.A15F\r
+        set CCS_DEVICE="Cortex A.AM5728_RevA"\r
+    ) else if %PROCESSOR% == m4 (\r
+        set RTSC_TARGET=ti.targets.arm.elf.M4\r
+        set CCS_DEVICE="Cortex M.AM5728_RevA"\r
+    )\r
+) else if  %SOC% == AM572x (\r
+    set PDK_PARTNO=AM572X\r
+    set PDK_ECLIPSE_ID=com.ti.pdk.am57xx\r
+    if %BOARD% == idkAM572x (\r
+        set RTSC_PLATFORM_NAME=ti.platforms.idkAM572X\r
+    ) else (\r
+        set RTSC_PLATFORM_NAME=ti.platforms.evmAM572X\r
+    )\r
+    if %PROCESSOR% == arm (\r
+        set RTSC_TARGET=gnu.targets.arm.A15F\r
+        set CCS_DEVICE="Cortex A.AM5728_RevA"\r
+    ) else if %PROCESSOR% == m4 (\r
+        set RTSC_TARGET=ti.targets.arm.elf.M4\r
+        set CCS_DEVICE="Cortex M.AM5728_RevA"\r
+    )\r
+) else if  %SOC% == AM574x (\r
+    set PDK_PARTNO=AM574X\r
+    set PDK_ECLIPSE_ID=com.ti.pdk.am57xx\r
+    set RTSC_PLATFORM_NAME=ti.platforms.idkAM572X\r
+    if %PROCESSOR% == arm (\r
+        set RTSC_TARGET=gnu.targets.arm.A15F\r
+        set CCS_DEVICE="Cortex A.AM5728_RevA"\r
+    ) else if %PROCESSOR% == m4 (\r
+        set RTSC_TARGET=ti.targets.arm.elf.M4\r
+        set CCS_DEVICE="Cortex M.AM5728_RevA"\r
+    )\r
+) else if  %SOC% == AM335x (\r
+    set PDK_PARTNO=AM335\r
+    set PDK_ECLIPSE_ID=com.ti.pdk.am335x\r
+    set RTSC_PLATFORM_NAME=ti.platforms.evmAM3359\r
+    set RTSC_TARGET=gnu.targets.arm.A8F\r
+    set CCS_DEVICE="Cortex A.AM3359.ICE_AM3359"\r
+) else if  %SOC% == AM437x (\r
+    set PDK_PARTNO=AM437\r
+    set PDK_ECLIPSE_ID=com.ti.pdk.am437x\r
+    set RTSC_PLATFORM_NAME=ti.platforms.evmAM437X\r
+    set RTSC_TARGET=gnu.targets.arm.A9F\r
+    set CCS_DEVICE="Cortex A.AM4379.IDK_AM437X"\r
+) else if  %SOC% == OMAPL137 (\r
+    set PDK_PARTNO=OMAPL137\r
+    set PDK_ECLIPSE_ID=com.ti.pdk.omapl137\r
+    set RTSC_PLATFORM_NAME=ti.platforms.evmOMAPL137\r
+    if %PROCESSOR% == arm (\r
+        set RTSC_TARGET=ti.targets.arm.elf.Arm9\r
+        set CCS_DEVICE="ARM9.OMAPL137"\r
+    )\r
+) else if  %SOC% == OMAPL138 (\r
+    set PDK_PARTNO=OMAPL138\r
+    set PDK_ECLIPSE_ID=com.ti.pdk.omapl138\r
+    set RTSC_PLATFORM_NAME=ti.platforms.evmOMAPL138\r
+    if %PROCESSOR% == arm (\r
+        set RTSC_TARGET=ti.targets.arm.elf.Arm9\r
+        set CCS_DEVICE="ARM9.OMAPL138"\r
+    )\r
+)else if  %SOC% == C6748 (\r
+    REM C6748 is the alias for OMAPL138 where the OMAPL138 settings will\r
+       REM be used to create projects for C6748 SOC.\r
+    set SOC=OMAPL138\r
+       set BOARD=lcdkOMAPL138\r
+       set PDK_PARTNO=OMAPL138\r
+    set PDK_ECLIPSE_ID=com.ti.pdk.omapl138\r
+    set RTSC_PLATFORM_NAME=ti.platforms.evmOMAPL138\r
+) else if  %SOC% == C6678 (\r
+    set PDK_PARTNO=C6678L\r
+    set PDK_ECLIPSE_ID=com.ti.pdk.c667x\r
+    set RTSC_PLATFORM_NAME=ti.platforms.evm6678\r
+) else if  %SOC% == C6657 (\r
+    set PDK_PARTNO=C6657\r
+    set PDK_ECLIPSE_ID=com.ti.pdk.c665x\r
+    set RTSC_PLATFORM_NAME=ti.platforms.evm6657\r
+) else if %SOC% == DRA72x (\r
+    set PDK_PARTNO=DRA72x\r
+    set PDK_ECLIPSE_ID=com.ti.pdk.dra7xx\r
+    set RTSC_PLATFORM_NAME=ti.platforms.evmDRA7XX\r
+    if %PROCESSOR% == arm (\r
+        set RTSC_TARGET=gnu.targets.arm.A15F\r
+        set CCS_DEVICE="Cortex A.DRA72x"\r
+    ) else if %PROCESSOR% == m4 (\r
+        set RTSC_TARGET=ti.targets.arm.elf.M4\r
+        set CCS_DEVICE="Cortex M.DRA72x"\r
+    )\r
+) else if %SOC% == DRA75x (\r
+    set PDK_PARTNO=DRA75x\r
+    set PDK_ECLIPSE_ID=com.ti.pdk.dra7xx\r
+    set RTSC_PLATFORM_NAME=ti.platforms.evmDRA7XX\r
+    if %PROCESSOR% == arm (\r
+        set RTSC_TARGET=gnu.targets.arm.A15F\r
+        set CCS_DEVICE="Cortex A.DRA75x_DRA74x"\r
+    ) else if %PROCESSOR% == m4 (\r
+        set RTSC_TARGET=ti.targets.arm.elf.M4\r
+        set CCS_DEVICE="Cortex M.DRA75x_DRA74x"\r
+    )\r
+) else if %SOC% == DRA78x (\r
+    set PDK_PARTNO=DRA78x\r
+    set PDK_ECLIPSE_ID=com.ti.pdk.dra7xx\r
+    set RTSC_PLATFORM_NAME=ti.platforms.evmTDA3XX\r
+    if %PROCESSOR% == m4 (\r
+        set RTSC_TARGET=ti.targets.arm.elf.M4\r
+        set CCS_DEVICE="Cortex M.TDA3x"\r
+    )\r
+) else if  %SOC% == am65xx (\r
+    set PDK_PARTNO=AM65XX\r
+    set PDK_ECLIPSE_ID=com.ti.pdk.am65xx\r
+    if %PROCESSOR% == mpu (\r
+        set RTSC_PLATFORM_NAME=ti.platforms.cortexA:AM65X\r
+        set RTSC_TARGET=gnu.targets.arm.A53F\r
+        set CCS_DEVICE="Cortex A.AM6548"\r
+    ) else if %PROCESSOR% == mcu (\r
+        set RTSC_PLATFORM_NAME=ti.platforms.cortexR:AM65X\r
+        set RTSC_TARGET=ti.targets.arm.elf.R5F\r
+        set CCS_DEVICE="Cortex R.AM6548"\r
+    )\r
+) else (\r
+    REM Need to exit the batch script cleanly \r
+    set PDK_PARTNO=TCI6634\r
+    set PDK_ECLIPSE_ID=ti.pdk\r
+    set RTSC_PLATFORM_NAME=ti.platforms.simKepler\r
+)\r
+\r
+REM RTSC Target \r
+REM - Please ensure that you select this taking into account the\r
+REM   OUTPUT_FORMAT and the RTSC_PLATFORM_NAME \r
+if %PROCESSOR% == dsp (\r
+    if %ENDIAN% == big (\r
+        set RTSC_TARGET=ti.targets.elf.C66_big_endian\r
+        set CCS_DEVICE="com.ti.ccstudio.deviceModel.C6000.GenericC64xPlusDevice"\r
+        set DSP_TYPE=c66\r
+    ) else (\r
+        if %SOC% == OMAPL137 (\r
+            set RTSC_TARGET=ti.targets.elf.C674\r
+            set CCS_DEVICE="com.ti.ccstudio.deviceModel.C6000.GenericC674xDevice"\r
+            set DSP_TYPE=c674x\r
+        ) else if %SOC% == OMAPL138 (\r
+            set RTSC_TARGET=ti.targets.elf.C674\r
+            set CCS_DEVICE="com.ti.ccstudio.deviceModel.C6000.GenericC674xDevice"\r
+            set DSP_TYPE=c674x\r
+        ) else (\r
+            set RTSC_TARGET=ti.targets.elf.C66\r
+            set CCS_DEVICE="com.ti.ccstudio.deviceModel.C6000.GenericC64xPlusDevice"\r
+            set DSP_TYPE=c66\r
+        )\r
+    )\r
+)\r
+\r
+echo    PDK_PARTNO         : %PDK_PARTNO%\r
+echo    PDK_ECLIPSE_ID     : %PDK_ECLIPSE_ID%\r
+echo    RTSC_PLATFORM_NAME : %RTSC_PLATFORM_NAME%\r
+echo.   RTSC_TARGET        : %RTSC_TARGET%\r
+echo.   CCS_DEVICE         : %CCS_DEVICE%\r
+REM *****************************************************************************\r
+REM *****************************************************************************\r
+REM                 Please do NOT change anything below this\r
+REM *****************************************************************************\r
+REM *****************************************************************************\r
+\r
+REM Set auto create command by default for use with CCSv8\r
+set AUTO_CREATE_COMMAND=eclipse\eclipsec -noSplash\r
+\r
+REM If is CCS version 4 then set auto create command for use with CCSv4\r
+if .%IS_CCS_VERSION_4% == .yes set AUTO_CREATE_COMMAND=eclipse\jre\bin\java -jar %CCS_INSTALL_PATH%\eclipse\startup.jar\r
+\r
+REM Set project for Silicon or QT by default\r
+set SIMULATOR_SUPPORT_DEFINE=\r
+\r
+REM If simulator support is needed then set the define\r
+if .%IS_SIMULATOR_SUPPORT_NEEDED% == .yes set SIMULATOR_SUPPORT_DEFINE=-ccs.setCompilerOptions "--define SIMULATOR_SUPPORT"\r
+\r
+REM Goto the PDK Installation Path.\r
+\r
+pushd %PDK_SHORT_NAME%\r
+\r
+echo *****************************************************************************\r
+echo Detecting all projects in PDK and importing them in the workspace %MY_WORKSPACE%\r
+\r
+set RTSC_PRODUCTS=com.ti.rtsc.SYSBIOS:%BIOS_VERSION%;%PDK_ECLIPSE_ID%:%PDK_VERSION%\r
+\r
+REM check version of the NDK  IPC EDMA and UIA\r
+if exist "%SDK_INSTALL_PATH%/edma3_lld_%EDMA_VERSION:.=_%" (\r
+       set RTSC_EDMA=;com.ti.sdo.edma3:%EDMA_VERSION%\r
+)\r
+\r
+if %SOC% == AM335x goto skip_ipc\r
+if %SOC% == AM437x goto skip_ipc\r
+\r
+if exist "%SDK_INSTALL_PATH%/ipc_%IPC_VERSION:.=_%" (\r
+       set RTSC_IPC=;com.ti.rtsc.IPC:%IPC_VERSION%\r
+)\r
+:skip_ipc\r
+if exist "%SDK_INSTALL_PATH%/ndk_%NDK_VERSION:.=_%" (\r
+       set RTSC_NDK=;com.ti.rtsc.NDK:%NDK_VERSION%\r
+)\r
+if exist "%SDK_INSTALL_PATH%/uia_%UIA_VERSION:.=_%" (\r
+       set RTSC_UIA=;com.ti.uia:%UIA_VERSION%\r
+)\r
+\r
+set RTSC_PRODUCTS="%RTSC_PRODUCTS%%RTSC_EDMA%%RTSC_IPC%%RTSC_NDK%%RTSC_UIA%"\r
+\r
+REM Set MODULE to null string so it picks up all projects of PROCESSOR\r
+if %MODULE% == all set MODULE=""\r
+\r
+REM Set BOARD to equal the SOC if BOARD is set to "all".  All projects for the\r
+REM SOC will be picked up\r
+REM Additionally for AM335x, check for AMIC110 board\r
+set AMIC110BOARD=\r
+if %BOARD% == all set BOARD=%SOC%\r
+if %BOARD% == AM335x set AMIC110BOARD="*%MODULE%*AMIC110*arm*roject.txt"\r
+REM Set MODULE to null string so it picks up all projects of PROCESSOR\r
+if %MODULE% == all set MODULE=""\r
+REM Set PROJECT_TYPE to null string so it picks up all project types\r
+if %PROJECT_TYPE% == all set PROJECT_TYPE=""\r
+\r
+if %PROCESSOR% == dsp (\r
+    REM Search for all the dsp test Project Files in the PDK.\r
+    for /F %%I IN ('dir /b /s *%MODULE%*%BOARD%*%DSP_TYPE%*%PROJECT_TYPE%*roject.txt') do (\r
+        set project_detected=1\r
+\r
+        echo Detected Test Project: %%~nI\r
+\r
+        REM Goto each directory where the test project file is located and create the projects.\r
+        pushd %%~dI%%~pI\r
+\r
+        REM Execute the command to create the project using the parameters specified above.\r
+        %CCS_INSTALL_PATH%\%AUTO_CREATE_COMMAND% -data %MY_WORKSPACE% -application com.ti.ccstudio.apps.projectCreate -ccs.name %%~nI -ccs.outputFormat %OUTPUT_FORMAT% -ccs.setCompilerOptions "-DUSE_BIOS" -ccs.device %CCS_DEVICE% -ccs.endianness %ENDIAN% -ccs.kind executable -ccs.cgtVersion %CGT_VERSION% -rtsc.xdcVersion %XDC_VERSION% -rtsc.enableDspBios -rtsc.biosVersion %BIOS_VERSION% -rtsc.buildProfile "debug" -rtsc.products "%RTSC_PRODUCTS%" -rtsc.platform "%RTSC_PLATFORM_NAME%" -rtsc.target %RTSC_TARGET% -ccs.rts libc.a -ccs.args %%~nI%%~xI %SIMULATOR_SUPPORT_DEFINE% -ccs.overwrite full -ccs.setPostBuildStep "${TI_PDK_INSTALL_DIR}/packages/pdkAppImageCreate.bat ${TI_PDK_INSTALL_DIR}/packages ${CG_TOOL_ROOT} ${PROJECT_LOC}/${ConfigName} ${ProjName} %SOC% %PROCESSOR%"\r
+\r
+        echo Copying macros.ini\r
+        copy %MACROS_FILE% %MY_WORKSPACE%\%%~nI\macros.ini\r
+\r
+        popd\r
+    )\r
+\r
+)\r
+\r
+REM Setting linker option for arm projects\r
+if %SOC% == OMAPL137 (\r
+    set LINKER_OPT=""\r
+    set COMPILER_OPT=""\r
+    set COMPILER=%CGT_VERSION_ARM9%\r
+) else if %SOC% == OMAPL138 (\r
+    set LINKER_OPT=""\r
+    set COMPILER_OPT=""\r
+    set COMPILER=%CGT_VERSION_ARM9%\r
+) else if  %SOC% == am65xx (\r
+    set LINKER_OPT=""\r
+    set COMPILER_OPT=""\r
+    set COMPILER=%CGT_VERSION_ARM_A53%\r
+) else (\r
+    set LINKER_OPT="-L${BIOS_CG_ROOT}/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/hard --specs=nano.specs"\r
+    set COMPILER_OPT="-I${CG_TOOL_ROOT}/arm-none-eabi/include/newlib-nano "\r
+    set COMPILER=%CGT_VERSION_ARM%\r
+)\r
+\r
+set arm_or_mpu="F"\r
+if %PROCESSOR% == arm set arm_or_mpu="T"\r
+if %PROCESSOR% == mpu set arm_or_mpu="T"\r
+\r
+if %arm_or_mpu% == "T" (\r
+    REM Search for all the arm test Project Files in the PDK.\r
+    for /F %%I IN ('dir /b /s *%MODULE%*%BOARD%*%PROCESSOR%*%PROJECT_TYPE%*roject.txt %AMIC110BOARD%') do (\r
+        set project_detected=1\r
+        \r
+        echo Detected Test Project: %%~nI\r
+\r
+        REM Goto each directory where the test project file is located and create the projects.\r
+        pushd %%~dI%%~pI\r
+\r
+        REM Expands the projectname variable which is used for identifying the baremetal and SYSBIOS project.\r
+        set projectName=%%~nI\r
+        REM Run CCS create command specific to baremetal and OS projects\r
+        if "x!projectName:nonOS=!" == "x!projectName!" (\r
+            REM Execute the command to create the OS project using the parameters specified above.\r
+            %CCS_INSTALL_PATH%\%AUTO_CREATE_COMMAND% -data %MY_WORKSPACE% -application com.ti.ccstudio.apps.projectCreate -ccs.cmd "" -ccs.name %%~nI -ccs.outputFormat %OUTPUT_FORMAT% -ccs.setCompilerOptions %COMPILER_OPT% -ccs.setCompilerOptions "-DUSE_BIOS" -ccs.setLinkerOptions %LINKER_OPT% -ccs.device %CCS_DEVICE% -ccs.endianness %ENDIAN% -ccs.kind executable -ccs.cgtVersion "%COMPILER%" -rtsc.xdcVersion %XDC_VERSION% -rtsc.enableDspBios -rtsc.biosVersion %BIOS_VERSION% -rtsc.buildProfile "debug" -rtsc.products  "%RTSC_PRODUCTS%" -rtsc.platform "%RTSC_PLATFORM_NAME%" -rtsc.target %RTSC_TARGET% -ccs.rts libc.a libgcc.a libuart.a libm.a libnosys.a -ccs.args %%~nI%%~xI %SIMULATOR_SUPPORT_DEFINE% -ccs.overwrite full  -ccs.setPostBuildStep "${TI_PDK_INSTALL_DIR}/packages/pdkAppImageCreate.bat ${TI_PDK_INSTALL_DIR}/packages ${CG_TOOL_ROOT} ${PROJECT_LOC}/${ConfigName} ${ProjName} %SOC% %PROCESSOR%"\r
+        ) else (\r
+            REM Execute the command to create the baremetal project using the parameters specified above.\r
+            %CCS_INSTALL_PATH%\%AUTO_CREATE_COMMAND% -data %MY_WORKSPACE% -application com.ti.ccstudio.apps.projectCreate -ccs.cmd "" -ccs.name %%~nI -ccs.outputFormat %OUTPUT_FORMAT% -ccs.device %CCS_DEVICE% -ccs.endianness %ENDIAN% -ccs.outputType executable -ccs.cgtVersion "%CGT_VERSION_ARM%"  -ccs.args %%~nI%%~xI -ccs.overwrite full  -ccs.setPostBuildStep "$(CG_TOOL_ROOT)/bin/arm-none-eabi-objcopy -O binary "%%~nI.out" "%%~nI.bin"\r
+\r
+            REM Deletes the startup file generated defaultly by CCS tool\r
+            del /q %MY_WORKSPACE%\%%~nI\*.S\r
+               )\r
+\r
+        echo Copying macro.ini\r
+        copy %MACROS_FILE% %MY_WORKSPACE%\%%~nI\macros.ini\r
+\r
+        popd\r
+    )\r
+)\r
+\r
+set m4_or_mcu="F"\r
+if %PROCESSOR% == m4 set m4_or_mcu="T"\r
+if %PROCESSOR% == mcu set m4_or_mcu="T"\r
+\r
+if %m4_or_mcu% == "T"  (\r
+    REM Search for all the m4 test Project Files in the PDK.\r
+    for /F %%I IN ('dir /b /s *%MODULE%*%BOARD%*%PROCESSOR%*%PROJECT_TYPE%*roject.txt') do (\r
+        set project_detected=1\r
+        \r
+        echo Detected Test Project: %%~nI\r
+\r
+        REM Goto each directory where the test project file is located and create the projects.\r
+        pushd %%~dI%%~pI\r
+\r
+        REM Execute the command to create the project using the parameters specified above.\r
+        %CCS_INSTALL_PATH%\%AUTO_CREATE_COMMAND% -data %MY_WORKSPACE% -application com.ti.ccstudio.apps.projectCreate -ccs.cmd "" -ccs.name %%~nI -ccs.outputFormat %OUTPUT_FORMAT% -ccs.setCompilerOptions "-DUSE_BIOS" -ccs.device %CCS_DEVICE% -ccs.endianness %ENDIAN% -ccs.kind executable -ccs.cgtVersion "%CGT_M4_VERSION%" -rtsc.xdcVersion %XDC_VERSION% -rtsc.enableDspBios -rtsc.biosVersion %BIOS_VERSION% -rtsc.buildProfile "debug" -rtsc.products "%RTSC_PRODUCTS%" -rtsc.platform "%RTSC_PLATFORM_NAME%" -rtsc.target %RTSC_TARGET% -ccs.rts libc.a libgcc.a libuart.a libm.a libnosys.a -ccs.args %%~nI%%~xI %SIMULATOR_SUPPORT_DEFINE% -ccs.overwrite full -ccs.setPostBuildStep "${TI_PDK_INSTALL_DIR}/packages/pdkAppImageCreate.bat ${TI_PDK_INSTALL_DIR}/packages ${CG_TOOL_ROOT} ${PROJECT_LOC}/${ConfigName} ${ProjName} %SOC% %PROCESSOR%"\r
+\r
+        echo Copying macro.ini\r
+        copy %MACROS_FILE% %MY_WORKSPACE%\%%~nI\macros.ini\r
+\r
+        popd\r
+    )\r
+)\r
+\r
+popd\r
+\r
+if not defined project_detected (\r
+    echo No projects detected\r
+)\r
+\r
+echo Project generation complete\r
+echo *****************************************************************************\r
+\r
+:ENDSCRIPT\r
+endlocal\r
diff --git a/packages/pdkProjectCreate.sh b/packages/pdkProjectCreate.sh
new file mode 100644 (file)
index 0000000..c137a9f
--- /dev/null
@@ -0,0 +1,858 @@
+# ******************************************************************************
+# * FILE PURPOSE: PDK Unit Test and Example Project Creator
+# ******************************************************************************
+# * FILE NAME: pdkProjectCreate.sh
+# *
+# * DESCRIPTION: 
+# *  The script file is used to create the test and example projects of all
+# *  components under PDK. These projects are available in the specified 
+# *  workspace.
+# *
+# * USAGE:
+# *  pdkProjectCreate.sh [soc] [board] [endian] [module] [project type] [processor] [SECUREMODE=<yes/no>]
+# * 
+# *  Description:      (first option is default)
+# *  soc           -   AM335x / AM437x / AM571x / AM572x / AM574x / K2E / K2G / K2K / K2H / K2L /
+# *                    C6678 / C6657 / DRA72x / DRA75x / DRA78x / OMAPL137 / OMAPL138 / C6748 / am65xx
+# *  board         -   all (use "all" for K2X and C66X SOCs)
+# *                    -or-
+# *                    Refer to pdk_<soc>_<version>\packages\ti\board\lib
+# *                    for valid board inputs for the soc
+# *  endian        -   little / big
+# *  module        -   all
+# *                    -or-
+# *                    aif2 / bcp / cppi / csl / dfe / emac / fatfs / fm / fftc /
+# *                    gpio / hyplnk / i2c / icss_emac / iqn2 / mcasp / mcbsp / mmap / mmcsd /
+# *                    nimu / nimu_icss / nwal / osal / pa / pcie / pktlib / pruss / qm / rm /
+# *                    sa / serdes-diag / spi / srio / tcp3d / tfw / transportqmss /
+# *                    transportsrio / tsip / uart / usb / wdtimer / vps / dcan / dss / lcdc
+# *  project type  -   all / example / test  
+# *  processor     -   arm / dsp / m4 / mcu / mpu
+# *  SECUREMODE    -   yes/no (optional argument). If unspecificed non-secure mode is assumed.
+# * 
+# *  Example:
+# *   a) pdkProjectCreate.sh
+# *               - Creates all module projects for the AM335x soc for arm little endian
+# *   b) pdkProjectCreate.sh AM437x
+# *               - Creates all module projects for the AM437x soc for arm little endian
+# *   c) pdkProjectCreate.sh AM437x idkAM437x
+# *               - Creates all module projects for idkAM437x device for arm little endian
+# *   d) pdkProjectCreate.sh AM571x evmAM571x little
+# *               - Creates all module projects for evmAM571x device for arm little endian
+# *   e) pdkProjectCreate.sh AM571x evmAM571x little i2c all dsp
+# *               - Creates all i2c module projects for evmAM571x device for dsp little endian
+# *   f) pdkProjectCreate.sh K2H all little i2c example arm
+# *               - Creates i2c module example projects for K2H device for arm little endian
+# *   g) pdkProjectCreate.sh C6678 all little hyplnk test dsp
+# *               - Creates hyplnk module test projects for C6678 device for dsp little endian
+# *   h) pdkProjectCreate.sh K2G evmK2G little mcasp all dsp SECUREMODE=yes
+# *               - Creates mcasp module test projects for dsp little endian to be run on evmK2G
+# *                 which is in secure mode
+# * 
+# * Copyright (C) 2012-2019, Texas Instruments, Inc.
+# *****************************************************************************
+
+# Lists of valid input parameters - MUST be updated as new input parameters are added
+# *****************************************************************************
+soc_list=("AM335x" "AM437x" "AM571x" "AM572x" "AM574x" "K2E" "K2K" "K2H" "K2L" "K2G" "C6678" "C6657" "DRA72x" "DRA75x" "DRA78x" "OMAPL137" "OMAPL138" "C6748" "am65xx")
+endian_list=("little" "big")
+module_list=("all" "aif2" "bcp" "cppi" "csl" "dfe" "emac" "fatfs" "fm" "fftc" "gpio" "gpmc" "hyplnk" "i2c" "icss_emac" "iqn2" "mcasp" "mcbsp" "mmap" "mmcsd" "nimu" "nimu_icss" "nwal" "osal" "pa" "pcie" "pktlib" "pruss" "qm" "rm" "sa" "serdes_diag" "spi" "srio" "tcp3d" "tfw" "transportqmss" "transportsrio" "tsip" "uart" "usb" "wdtimer" "vps" "dcan" "dss" "lcdc" "timeSync")
+projectType_list=("all" "example" "test")
+proc_list=("arm" "dsp" "m4" "mpu" "mcu")
+
+# Parameter Validation: Check if the argument was passed to the batch file.
+# *****************************************************************************
+# Argument [soc] is used to set SOC variable.
+if [ -n "$1" ]; then
+    export SOC="$1"
+else
+    export SOC="AM335x"
+fi
+
+# Argument [board] is used to set BOARD variable.
+# This is the board type of the soc for which project are to be created.
+if [ -n "$2" ]; then
+    export BOARD="$2"
+else
+    export BOARD="all"
+fi
+
+# Argument [endian] is used to set ENDIAN variable.
+# This is Endianess of the projects being created.
+# Valid Values are 'little' and 'big'. Defaults to 'little'.
+if [ -n "$3" ]; then
+    export ENDIAN="$3"
+else
+    export ENDIAN="little"
+fi
+
+# Argument [module] is used to set MODULE variable.
+# This is specific module for which projects are created.
+# Valid Values are LLD name. Defaults to all LLD's.
+if [ -n "$4" ]; then
+    export MODULE="$4"
+else
+    export MODULE="all"
+fi
+
+# Argument [proj type] is used to set PROJECT_TYPE variable.
+# This is the type of projects that are created
+# Valid Values are all, example, or test . Defaults to all.
+if [ -n "$5" ]; then
+    export PROJECT_TYPE="$5"
+else
+    export PROJECT_TYPE="all"
+fi
+
+# Argument [processor] is used to set PROCESSOR variable.
+# This is specific processor type for which projects are created.
+# Valid Values are arm, dsp, or m4 . Defaults to arm.
+if [ -n "$6" ]; then
+    export PROCESSOR="$6"
+else
+    export PROCESSOR="arm"
+fi
+
+# Argument [SECUREMODE] is used to set SECUREMODE variable.
+# Default to non secure mode if this argument is not specified
+if [ -n "$7" ]; then
+  if [ "$7" == "SECUREMODE=yes" ]; then
+    echo "The board is in secure mode"
+    export SECUREMODE="yes"
+  else
+    echo "The board is non in secure mode"
+    export SECUREMODE="no"
+  fi 
+else
+    export SECUREMODE="no"
+fi
+
+# If the below entries need to be added for ARM sysbios config files 
+export RTSCCFG_ENTRY_SECUREMODE_ARM="
+/* Start of lines added for secure device */
+var gicHwi = xdc.useModule('ti.sysbios.family.arm.gic.Hwi'); 
+gicHwi.enableSecureMode = false; 
+gicHwi.BPR = 3; 
+gicHwi.NUM_PRIORITY_BITS = 4;
+/* End of Lines added for secure device */
+"
+# If the below entries need to be added for DSP sysbios config files 
+export RTSCCFG_ENTRY_SECUREMODE_DSP="
+/* Start of lines added for secure device */
+var BIOS = xdc.useModule('ti.sysbios.BIOS');
+BIOS.useSK = true;
+BIOS.setupSecureContext = true;
+BIOS.libType = BIOS.LibType_Custom;
+/* End of Lines added for secure device */
+"
+export PDK_SHORT_NAME=$PWD
+
+# This define is used to patch the GP EVM CFG file if the SECUREMODE is enabled.
+# Some EVMs like K2G would need the patch, where as AM437x does not in SECURE MODE
+# This define will help with the selective patching
+export SEC_CFG_FILE_UPDATE_NEEDED="no"
+# TI SDK root directory
+if [ -z $SDK_INSTALL_PATH ]; then
+    export SDK_INSTALL_PATH=__SDK__INSTALL_DIR__
+fi
+
+# *****************************************************************************
+
+echo "========================================================================="
+echo "Configuration:"
+echo "  SOC             :   $SOC"
+echo "  BOARD           :   $BOARD"
+echo "  ENDIAN          :   $ENDIAN"
+echo "  MODULE          :   $MODULE"
+echo "  PROJECT_TYPE    :   $PROJECT_TYPE"
+echo "  PROCESSOR       :   $PROCESSOR"
+echo "  PDK_SHORT_NAME  :   $PDK_SHORT_NAME"
+echo "========================================================================="
+echo "Checking Configuration..."
+
+error_exit () {
+    echo "Exiting..."
+    echo "========================================================================="
+    exit 1
+}
+
+contains () {
+    local name=$1[@]
+    local list=("${!name}")
+    local in_list=0
+
+    for item in "${list[@]}"
+    do
+        if [ "$2" = "$item" ]; then
+            in_list=1
+            break
+        fi
+    done
+
+    if [ $in_list -eq 0 ]; then
+        echo "ERROR: $3 ($2) is invalid"
+        error_exit
+    fi
+}
+
+contains soc_list          "$SOC"           "SOC"
+contains endian_list       "$ENDIAN"        "Endian"
+contains module_list       "$MODULE"        "Module"
+contains projectType_list  "$PROJECT_TYPE"  "Project Type"  
+contains proc_list         "$PROCESSOR"     "Processor"
+
+if [ $BOARD != "all" ]; then
+    if [ $BOARD = "iceAMIC110" ]; then
+        if [ $SOC != "AM335x" ]; then
+            echo "ERROR: Board ($BOARD) is invalid for the specified SOC ($SOC)"
+            error_exit
+        fi
+    elif [ "${BOARD/$SOC}" = "$BOARD" ]; then
+        echo "ERROR: Board ($BOARD) is invalid for the specified SOC ($SOC)"
+        error_exit
+    fi
+fi
+
+if [ $SOC = "AM335x" ]; then
+    if [ $PROCESSOR = "dsp" ]; then
+        echo "ERROR: The AM335x soc does not contain a DSP processor"
+        error_exit
+    elif [ $PROCESSOR = "m4" ]; then
+        echo "ERROR: The AM335x soc does not contain a M4 processor"
+        error_exit
+    fi
+
+    if [ $ENDIAN = "big" ]; then
+        echo "ERROR: The AM335x soc's arm does not support big endian"
+        error_exit
+    fi
+elif [ $SOC = "AM437x" ]; then
+    if [ $PROCESSOR = "dsp" ]; then
+        echo "ERROR: The AM437x soc does not contain a DSP processor"
+        error_exit
+    elif [ $PROCESSOR = "m4" ]; then
+        echo "ERROR: The AM437x soc does not contain a M4 processor"
+        error_exit
+    fi
+
+    if [ $ENDIAN = "big" ]; then
+        echo "ERROR: The AM437x soc's arm does not support big endian"
+        error_exit
+    fi
+elif [ $SOC = "AM571x" ]; then
+    if [ $ENDIAN = "big" ]; then
+        echo "ERROR: The AM571x soc's processor's do not support big endian"
+        error_exit
+    fi
+elif [ $SOC = "AM572x" ]; then
+    if [ $ENDIAN = "big" ]; then
+        echo "ERROR: The AM572x soc's processor's do not support big endian"
+        error_exit
+    fi
+elif [ $SOC = "AM574x" ]; then
+    if [ $ENDIAN = "big" ]; then
+        echo "ERROR: The AM574x soc's processor's do not support big endian"
+        error_exit
+    fi
+elif [ $SOC = "K2K" ]; then
+    if [ $PROCESSOR = "m4" ]; then
+        echo "ERROR: The K2K soc does not contain a M4 processor"
+        error_exit
+    fi
+    if [ $PROCESSOR = "arm" ]; then
+        if [ $ENDIAN = "big" ]; then
+            echo "ERROR: The K2K soc's processor's do not support big endian"
+            error_exit
+        fi
+    fi
+elif [ $SOC = "K2H" ]; then
+    if [ $PROCESSOR = "m4" ]; then
+        echo "ERROR: The K2H soc does not contain a M4 processor"
+        error_exit
+    fi
+    if [ $PROCESSOR = "arm" ]; then
+        if [ $ENDIAN = "big" ]; then
+            echo "ERROR: The K2H soc's processor's do not support big endian"
+            error_exit
+        fi
+    fi
+elif [ $SOC = "K2E" ]; then
+    if [ $PROCESSOR = "m4" ]; then
+        echo "ERROR: The K2E soc does not contain a M4 processor"
+        error_exit
+    fi
+    if [ $PROCESSOR = "arm" ]; then
+        if [ $ENDIAN = "big" ]; then
+            echo "ERROR: The K2E soc's processor's do not support big endian"
+            error_exit
+        fi
+    fi
+elif [ $SOC = "K2L" ]; then
+    if [ $PROCESSOR = "m4" ]; then
+        echo "ERROR: The K2L soc does not contain a M4 processor"
+        error_exit
+    fi
+    if [ $PROCESSOR = "arm" ]; then
+        if [ $ENDIAN = "big" ]; then
+            echo "ERROR: The K2L soc's processor's do not support big endian"
+            error_exit
+        fi
+    fi
+elif [ $SOC = "K2G" ]; then
+    if [ $PROCESSOR = "m4" ]; then
+        echo "ERROR: The K2G soc does not contain a M4 processor"
+        error_exit
+    fi
+    if [ $PROCESSOR = "arm" ]; then
+        if [ $ENDIAN = "big" ]; then
+            echo "ERROR: The K2G soc's processor's do not support big endian"
+            error_exit
+        fi
+    fi
+elif [ $SOC = "OMAPL137" ]; then
+    if [ $PROCESSOR = "m4" ]; then
+        echo "ERROR: The OMAPL137 soc does not contain a M4 processor"
+        error_exit
+    fi
+    if [ $PROCESSOR = "arm" ]; then
+        if [ $ENDIAN = "big" ]; then
+            echo "ERROR: The OMAPL137 soc's processor's do not support big endian"
+            error_exit
+        fi
+    fi
+elif [ $SOC = "OMAPL138" ]; then
+    if [ $PROCESSOR = "m4" ]; then
+        echo "ERROR: The OMAPL138 soc does not contain a M4 processor"
+        error_exit
+    fi
+    if [ $PROCESSOR = "arm" ]; then
+        if [ $ENDIAN = "big" ]; then
+            echo "ERROR: The OMAPL138 soc's processor's do not support big endian"
+            error_exit
+        fi
+    fi
+elif [ $SOC = "C6748" ]; then
+    if [ $PROCESSOR = "m4" ]; then
+        echo "ERROR: The C6748 soc does not contain a M4 processor"
+        error_exit
+    fi
+    if [ $PROCESSOR = "arm" ]; then
+       echo "ERROR: The C6748 soc does not contain an arm processor"
+       error_exit
+    fi
+    if [ $PROCESSOR = "dsp" ]; then
+        if [ $ENDIAN = "big" ]; then
+            echo "ERROR: The C6748 soc's processor's do not support big endian"
+            error_exit
+        fi
+    fi
+elif [ $SOC = "C6678" ]; then
+    if [ $PROCESSOR = "m4" ]; then
+        echo "ERROR: The C6678 soc does not contain a M4 processor"
+        error_exit
+    fi
+    if [ $PROCESSOR = "arm" ]; then
+        echo "ERROR: The C6678 soc does not contain an arm processor"
+        error_exit
+    fi
+elif [ $SOC = "C6657" ]; then
+    if [ $PROCESSOR = "m4" ]; then
+        echo "ERROR: The C6657 soc does not contain a M4 processor"
+        error_exit
+    fi
+    if [ $PROCESSOR = "arm" ]; then
+        echo "ERROR: The C6657 soc does not contain an arm processor"
+        error_exit
+    fi
+elif [ $SOC = "DRA72x" ]; then
+    if [ $ENDIAN = "big" ]; then
+        echo "ERROR: The DRA72x soc's processor's do not support big endian"
+        error_exit
+    fi
+elif [ $SOC = "DRA75x" ]; then
+    if [ $ENDIAN = "big" ]; then
+        echo "ERROR: The DRA75x soc's processor's do not support big endian"
+        error_exit
+    fi
+elif [ $SOC = "DRA78x" ]; then
+    if [ $ENDIAN = "big" ]; then
+        echo "ERROR: The DRA78x soc's processor's do not support big endian"
+        error_exit
+    fi
+elif [ $SOC = "am65xx" ]; then
+    if [ $PROCESSOR = "m4" ]; then
+        echo "ERROR: The am65xx soc does not contain a M4 processor"
+        error_exit
+    fi
+    if [ $PROCESSOR = "dsp" ]; then
+        echo "ERROR: The am65xx soc does not contain a DSP processor"
+        error_exit
+    fi
+    if [ $ENDIAN = "big" ]; then
+        echo "ERROR: The am65xx soc's processor's do not support big endian"
+        error_exit
+    fi
+else
+    echo "ERROR: Invalid soc"
+    error_exit
+fi
+
+# *****************************************************************************
+# * Version Information of the various tools etc required to build the test
+# * projects. Customers are free to modify these to meet their requi#ents.
+# *****************************************************************************
+
+# export to 'no' when using QT, EVM, VDB, or other hardware. export to 'yes'
+# only when using the simulator.
+export IS_SIMULATOR_SUPPORT_NEEDED=no
+
+# Tools root directory
+if [ -z $CCS_INSTALL_PATH ]; then
+    export CCS_INSTALL_PATH=~/ti/ccs930/ccs
+fi
+
+# Workspace where the PDK projects will be created.
+export MY_WORKSPACE=$PDK_SHORT_NAME/MyExampleProjects
+
+# macros.ini location
+export MACROS_FILE=$PDK_SHORT_NAME/macros.ini
+
+# This is the format of the executable being created
+# Valid Values are 'ELF' and 'COFF'
+export OUTPUT_FORMAT=ELF
+
+# Version of CG-Tools
+export CGT_VERSION=8.3.2
+
+# Version of CG-ARM-Tools for M4
+export CGT_M4_VERSION=18.12.5.LTS
+
+# Version of XDC
+export XDC_VERSION=3.55.02.22
+
+# Version of BIOS
+export BIOS_VERSION=6.76.03.01
+
+# Version of CG-Tools for ARM
+export CGT_VERSION_ARM=GNU_7.2.1:Linaro
+
+# Version of CG-Tools for A53
+export CGT_VERSION_ARM_A53="GNU_7.2.1:Linaro aarch64"
+
+# Version of the IPC
+export IPC_VERSION=__IPC_VER__
+
+# EDMA3 Version 
+export EDMA_VERSION=2.12.05.30E
+
+# Version of the PDK
+export PDK_VERSION=__PDK_VER__
+
+# Version of the NDK 
+export NDK_VERSION=3.61.01.01
+
+# Version of UIA
+export UIA_VERSION=2.30.01.02
+
+# Version of CG-Tools for ARM
+export CGT_VERSION_ARM9=18.1.5.LTS
+
+# PDK Part Number & Platform name
+if [ "$SOC" = "K2K" ]; then
+    export PDK_PARTNO=TCI6638
+    export PDK_ECLIPSE_ID=com.ti.pdk.k2hk
+    export RTSC_PLATFORM_NAME=ti.platforms.evmTCI6638K2K
+    if [ "$PROCESSOR" == "arm" ]; then
+        export RTSC_TARGET=gnu.targets.arm.A15F
+        export CCS_DEVICE="Cortex A.TCI6638K2K"
+    fi
+elif [ "$SOC" = "K2H" ]; then
+    export PDK_PARTNO=TCI6636
+    export PDK_ECLIPSE_ID=com.ti.pdk.k2hk
+    export RTSC_PLATFORM_NAME=ti.platforms.evmTCI6636K2H
+    if [ "$PROCESSOR" == "arm" ]; then
+        export RTSC_TARGET=gnu.targets.arm.A15F
+        export CCS_DEVICE="Cortex A.66AK2H12"
+    fi
+elif [ "$SOC" = "K2L" ]; then
+    export PDK_PARTNO=TCI6630
+    export PDK_ECLIPSE_ID=com.ti.pdk.k2l
+    export RTSC_PLATFORM_NAME=ti.platforms.evmTCI6630K2L
+    if [ "$PROCESSOR" == "arm" ]; then
+        export RTSC_TARGET=gnu.targets.arm.A15F
+        export CCS_DEVICE="Cortex A.TCI6630K2L"
+    fi
+elif [ "$SOC" = "K2E" ]; then
+    export PDK_PARTNO=66AK2E05
+    export PDK_ECLIPSE_ID=com.ti.pdk.k2e
+    export RTSC_PLATFORM_NAME=ti.platforms.evmC66AK2E
+    if [ "$PROCESSOR" == "arm" ]; then
+        export RTSC_TARGET=gnu.targets.arm.A15F
+        export CCS_DEVICE="Cortex A.66AK2E05"
+    fi
+elif [ "$SOC" = "OMAPL137" ]; then
+    export PDK_PARTNO=OMAPL137
+    export PDK_ECLIPSE_ID=com.ti.pdk.omapl137
+    export RTSC_PLATFORM_NAME=ti.platforms.evmOMAPL137
+    if [ "$PROCESSOR" == "arm" ]; then
+        export RTSC_TARGET=ti.targets.arm.elf.Arm9
+        export CCS_DEVICE="ARM9.OMAPL137"
+    fi
+elif [ "$SOC" = "OMAPL138" ]; then
+    export PDK_PARTNO=OMAPL138
+    export PDK_ECLIPSE_ID=com.ti.pdk.omapl138
+    export RTSC_PLATFORM_NAME=ti.platforms.evmOMAPL138
+    if [ "$PROCESSOR" == "arm" ]; then
+        export RTSC_TARGET=ti.targets.arm.elf.Arm9
+        export CCS_DEVICE="ARM9.OMAPL138"
+    fi
+elif [ "$SOC" = "C6748" ]; then
+# C6748 is the alias for OMAPL138 where the OMAPL138 settings will
+# be used to create projects for C6748 SOC.
+    export SOC=OMAPL138
+    export BOARD=lcdkOMAPL138
+    export PDK_PARTNO=OMAPL138
+    export PDK_ECLIPSE_ID=com.ti.pdk.omapl138
+    export RTSC_PLATFORM_NAME=ti.platforms.evmOMAPL138
+    if [ "$PROCESSOR" == "arm" ]; then
+        export RTSC_TARGET=ti.targets.arm.elf.Arm9
+        export CCS_DEVICE="ARM9.OMAPL138"
+    fi
+elif [ "$SOC" = "K2G" ]; then
+    export PDK_PARTNO=66AK2G02
+     if [ "$SECUREMODE" == "yes" ]; then
+      # Set the board to evmK2G as BOARD is being used to find example project files by name
+        export PDK_ECLIPSE_ID=com.ti.pdk.k2g-hs
+        export SEC_CFG_FILE_UPDATE_NEEDED="yes"
+     else
+        export PDK_ECLIPSE_ID=com.ti.pdk.k2g
+     fi 
+    export RTSC_PLATFORM_NAME=ti.platforms.evmTCI66AK2G02
+    if [ "$PROCESSOR" == "arm" ]; then
+        export RTSC_TARGET=gnu.targets.arm.A15F
+        export CCS_DEVICE="Cortex A.66AK2G02"
+    fi
+elif [ "$SOC" = "AM571x" ]; then
+    export PDK_PARTNO=AM571X
+    export PDK_ECLIPSE_ID=com.ti.pdk.am57xx
+    export RTSC_PLATFORM_NAME=ti.platforms.idkAM571X
+    if [ "$PROCESSOR" = "arm" ]; then
+        export RTSC_TARGET=gnu.targets.arm.A15F
+        export CCS_DEVICE="Cortex A.AM5728_RevA"
+    elif [ "$PROCESSOR" == "m4" ]; then
+        export RTSC_TARGET=ti.targets.arm.elf.M4
+        export CCS_DEVICE="Cortex M.AM5728_RevA"
+    fi
+elif [ "$SOC" == "AM572x" ]; then
+    export PDK_PARTNO=AM572X
+    export PDK_ECLIPSE_ID=com.ti.pdk.am57xx
+    if [ "$BOARD" == "idkAM572x" ]; then
+        export RTSC_PLATFORM_NAME=ti.platforms.idkAM572X
+    else
+        export RTSC_PLATFORM_NAME=ti.platforms.evmAM572X
+    fi
+    if [ "$PROCESSOR" == "arm" ]; then
+        export RTSC_TARGET=gnu.targets.arm.A15F
+        export CCS_DEVICE="Cortex A.AM5728_RevA"
+    elif [ "$PROCESSOR" == "m4" ]; then
+        export RTSC_TARGET=ti.targets.arm.elf.M4
+        export CCS_DEVICE="Cortex M.AM5728_RevA"
+    fi
+elif [ "$SOC" = "AM574x" ]; then
+    export PDK_PARTNO=AM574X
+    export PDK_ECLIPSE_ID=com.ti.pdk.am57xx
+    export RTSC_PLATFORM_NAME=ti.platforms.idkAM572X
+    if [ "$PROCESSOR" = "arm" ]; then
+        export RTSC_TARGET=gnu.targets.arm.A15F
+        export CCS_DEVICE="Cortex A.AM5728_RevA"
+    elif [ "$PROCESSOR" == "m4" ]; then
+        export RTSC_TARGET=ti.targets.arm.elf.M4
+        export CCS_DEVICE="Cortex M.AM5728_RevA"
+    fi
+elif [ "$SOC" == "DRA72x" ]; then
+    export PDK_PARTNO=DRA72x
+    export PDK_ECLIPSE_ID=com.ti.pdk.dra7xx
+    export RTSC_PLATFORM_NAME=ti.platforms.evmDRA7XX
+    if [ "$PROCESSOR" == "arm" ]; then
+        export RTSC_TARGET=gnu.targets.arm.A15F
+        export CCS_DEVICE="Cortex A.DRA72x"
+    elif [ "$PROCESSOR" == "m4" ]; then
+        export RTSC_TARGET=ti.targets.arm.elf.M4
+        export CCS_DEVICE="Cortex M.DRA72x"
+    fi
+elif [ "$SOC" == "DRA75x" ]; then
+    export PDK_PARTNO=DRA75x
+    export PDK_ECLIPSE_ID=com.ti.pdk.dra7xx
+    export RTSC_PLATFORM_NAME=ti.platforms.evmDRA7XX
+    if [ "$PROCESSOR" == "arm" ]; then
+        export RTSC_TARGET=gnu.targets.arm.A15F
+        export CCS_DEVICE="Cortex A.DRA75x_DRA74x"
+    elif [ "$PROCESSOR" == "m4" ]; then
+        export RTSC_TARGET=ti.targets.arm.elf.M4
+        export CCS_DEVICE="Cortex M.DRA75x_DRA74x"
+    fi
+elif [ "$SOC" == "DRA78x" ]; then
+    export PDK_PARTNO=DRA78x
+    export PDK_ECLIPSE_ID=com.ti.pdk.dra7xx
+    export RTSC_PLATFORM_NAME=ti.platforms.evmTDA3XX
+    if [ "$PROCESSOR" == "m4" ]; then
+        export RTSC_TARGET=ti.targets.arm.elf.M4
+        export CCS_DEVICE="Cortex M.TDA3x"
+    fi
+elif [ "$SOC" == AM335x ]; then
+    export PDK_PARTNO=AM335
+    export PDK_ECLIPSE_ID=com.ti.pdk.am335x
+    export RTSC_PLATFORM_NAME=ti.platforms.evmAM3359
+    export RTSC_TARGET=gnu.targets.arm.A8F
+    export CCS_DEVICE="Cortex A.AM3359.ICE_AM3359"
+elif [ "$SOC" = "AM437x" ]; then
+    export PDK_PARTNO=AM437
+     if [ "$SECUREMODE" == "yes" ]; then
+      # Set the board to am437x-hs as BOARD is being used to find example project files by name
+        export PDK_ECLIPSE_ID=com.ti.pdk.am437x-hs
+      # No cfg file updates are required for AM437x-hs
+        export SEC_CFG_FILE_UPDATE_NEEDED="no"
+     else
+        export PDK_ECLIPSE_ID=com.ti.pdk.am437x
+     fi 
+    export RTSC_PLATFORM_NAME=ti.platforms.evmAM437X
+    export RTSC_TARGET=gnu.targets.arm.A9F
+    export CCS_DEVICE="Cortex A.AM4379.IDK_AM437X"
+elif [ "$SOC" = "C6678" ]; then
+    export PDK_PARTNO=C6678L
+    export PDK_ECLIPSE_ID=com.ti.pdk.c667x
+    export RTSC_PLATFORM_NAME=ti.platforms.evm6678
+elif [ "$SOC" = "C6657" ]; then
+    export PDK_PARTNO=C6657
+    export PDK_ECLIPSE_ID=com.ti.pdk.c665x
+    export RTSC_PLATFORM_NAME=ti.platforms.evm6657
+elif [ "$SOC" = "am65xx" ]; then
+    export PDK_PARTNO=AM65XX
+    export PDK_ECLIPSE_ID=com.ti.pdk.am65xx
+    if [ "$PROCESSOR" = "mpu" ]; then
+        export RTSC_PLATFORM_NAME=ti.platforms.cortexA:AM65X
+        export RTSC_TARGET=gnu.targets.arm.A53F
+        export CCS_DEVICE="Cortex A.AM6548"
+    elif [ "$PROCESSOR" == "mcu" ]; then
+        export RTSC_PLATFORM_NAME=ti.platforms.cortexR:AM65X
+        export RTSC_TARGET=ti.targets.arm.elf.R5F
+        export CCS_DEVICE="Cortex R.AM6548"
+    fi
+else
+    # Need to exit the batch script cleanly 
+    export PDK_PARTNO=TCI6634
+    export PDK_ECLIPSE_ID=ti.pdk
+    export RTSC_PLATFORM_NAME=ti.platforms.simKepler
+fi
+
+# RTSC Target
+# - Please ensure that you select this taking into account the
+#   OUTPUT_FORMAT and the RTSC_PLATFORM_NAME 
+if [ "$PROCESSOR" = "dsp" ]; then
+    if [ "$ENDIAN" = "big" ]; then
+        export RTSC_TARGET=ti.targets.elf.C66_big_endian
+        export CCS_DEVICE="com.ti.ccstudio.deviceModel.C6000.GenericC64xPlusDevice"
+               export DSP_TYPE=c66
+    else
+        if [ "$SOC" = "OMAPL137" ]; then
+            export RTSC_TARGET=ti.targets.elf.C674
+            export CCS_DEVICE="com.ti.ccstudio.deviceModel.C6000.GenericC674xDevice"
+            export DSP_TYPE=c674x
+               elif [ "$SOC" = "OMAPL138" ]; then
+            export RTSC_TARGET=ti.targets.elf.C674
+            export CCS_DEVICE="com.ti.ccstudio.deviceModel.C6000.GenericC674xDevice"
+            export DSP_TYPE=c674x
+               else
+            export RTSC_TARGET=ti.targets.elf.C66
+            export CCS_DEVICE="com.ti.ccstudio.deviceModel.C6000.GenericC64xPlusDevice"
+            export DSP_TYPE=c66
+        fi
+    fi
+fi
+
+echo "  PDK_PARTNO         : $PDK_PARTNO"
+echo "  PDK_ECLIPSE_ID     : $PDK_ECLIPSE_ID"
+echo "  RTSC_PLATFORM_NAME : $RTSC_PLATFORM_NAME"
+echo "  RTSC_TARGET        : $RTSC_TARGET"
+echo "  CCS_DEVICE         : $CCS_DEVICE"
+# *****************************************************************************
+# *****************************************************************************
+#                 Please do NOT change anything below this
+# *****************************************************************************
+# *****************************************************************************
+
+# export auto create command by default for use with CCSv8
+export AUTO_CREATE_COMMAND=eclipse/ccstudio
+
+# export project for Silicon or QT by default
+export SIMULATOR_SUPPORT_DEFINE=
+
+echo "*****************************************************************************"
+echo "Detecting all projects in PDK and importing them in the workspace $MY_WORKSPACE"
+
+
+export RTSC_PRODUCTS="com.ti.rtsc.SYSBIOS:$BIOS_VERSION;$PDK_ECLIPSE_ID:$PDK_VERSION"
+
+if [ -d ${SDK_INSTALL_PATH}/edma3_lld_${EDMA_VERSION//./_} ]; then
+       export RTSC_EDMA=";com.ti.sdo.edma3:$EDMA_VERSION"
+fi
+
+if [[ "$SOC" != "AM335x" && "$SOC" != "AM437x" ]]; then
+if [ -d ${SDK_INSTALL_PATH}/ipc_${IPC_VERSION//./_} ]; then
+       export RTSC_IPC=";com.ti.rtsc.IPC:$IPC_VERSION"
+fi
+fi
+
+if [ -d ${SDK_INSTALL_PATH}/ndk_${NDK_VERSION//./_} ]; then
+       export RTSC_NDK=";com.ti.rtsc.NDK:${NDK_VERSION}-eng"
+fi
+if [ -d ${SDK_INSTALL_PATH}/uia_${UIA_VERSION//./_} ]; then
+       export RTSC_UIA=";com.ti.uia:$UIA_VERSION"
+fi
+
+export RTSC_PRODUCTS="${RTSC_PRODUCTS}${RTSC_EDMA}${RTSC_IPC}${RTSC_NDK}${RTSC_UIA}"
+
+# Set MODULE to null string so it picks up all projects of PROCESSOR
+if [ "$MODULE" = "all" ]; then
+    MODULE=""
+fi
+
+# Set BOARD to equal the SOC if BOARD is set to "all".  All projects for the
+# SOC will be picked up
+# Additionally for AM335x, check for AMIC110 board
+export AMIC110BOARD=
+if [ "$BOARD" = "all" ]; then
+    BOARD="$SOC"
+    if [ "$SOC" = "AM335x" ]; then
+        AMIC110BOARD="-o -iname *$MODULE*AMIC110*arm*roject.txt"
+    fi
+fi
+
+# Set PROJECT_TYPE to null string so it picks up all project types 
+if [ "$PROJECT_TYPE" = "all" ]; then
+    PROJECT_TYPE=""
+fi
+
+if [ "$SOC" = "OMAPL137" ]; then
+       export LINKER_OPT=""
+       export COMPILER_OPT=""
+       export COMPILER=$CGT_VERSION_ARM9
+elif [ "$SOC" = "OMAPL138" ]; then
+       export LINKER_OPT=""
+       export COMPILER_OPT=""
+       export COMPILER=$CGT_VERSION_ARM9
+elif [ "$SOC" = "am65xx" ]; then
+       export LINKER_OPT=""
+       export COMPILER_OPT=""
+       export COMPILER="$CGT_VERSION_ARM_A53"
+else
+       export LINKER_OPT=\"-L\${BIOS_CG_ROOT}/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/hard\ --specs=nano.specs\"
+       export COMPILER_OPT=\"-I\${CG_TOOL_ROOT}/arm-none-eabi/include/newlib-nano\"
+       export COMPILER=$CGT_VERSION_ARM
+fi
+
+ccs_create_dsp()
+{
+    echo Detected Project $1
+    textfile=${1#*/}
+
+    ccs_proj_name=${textfile%.*}
+    # If the board is in secure mode , a few lines need to be added to sysbios config file for the application
+    if [ "$SEC_CFG_FILE_UPDATE_NEEDED" == "yes" ]; then
+       # For SECUREMODE=yes, the cc projects are appended with _HS so that they can coexist with non-HS projects
+       ccs_proj_name=$ccs_proj_name"_HS"
+       # Check if the secure device configuration exists on the application sysbios config file.
+       # if not add it to the config file.
+       cfgfile=$(grep "\.cfg" $textfile| sed -e  's/.*\/ti/\/ti/'|sed -e  's/"//g'| sed -e "s|\.*\/ti|${PDK_INSTALL_PATH}\/ti|g")
+       securecfg_occurance=$(grep -c "Start of lines added for secure device" $cfgfile)
+       if [ $securecfg_occurance -eq 0 ]; then
+          echo "Adding secure device configuration file for sysbios configuration file $cfgfile .."
+          echo "${RTSCCFG_ENTRY_SECUREMODE_DSP}" >> $cfgfile
+       fi
+    fi
+
+$CCS_INSTALL_PATH/$AUTO_CREATE_COMMAND -nosplash -data $MY_WORKSPACE -application com.ti.ccstudio.apps.projectCreate -ccs.name ${ccs_proj_name} -ccs.outputFormat $OUTPUT_FORMAT -ccs.setCompilerOptions "-DUSE_BIOS" -ccs.device "$CCS_DEVICE" -ccs.endianness $ENDIAN -ccs.kind executable -ccs.cgtVersion $CGT_VERSION -rtsc.xdcVersion $XDC_VERSION -rtsc.enableDspBios -rtsc.biosVersion $BIOS_VERSION -rtsc.buildProfile "debug" -rtsc.products "$RTSC_PRODUCTS" -rtsc.platform "$RTSC_PLATFORM_NAME" -rtsc.target $RTSC_TARGET -ccs.rts libc.a -ccs.args $textfile -ccs.overwrite full -ccs.setPostBuildStep "\${TI_PDK_INSTALL_DIR}/packages/pdkAppImageCreate.sh \${TI_PDK_INSTALL_DIR}/packages \${CG_TOOL_ROOT} \${PROJECT_LOC}/\${ConfigName} \${ProjName} $SOC $PROCESSOR" \;
+
+    echo "Copying macros.ini"
+    cp $PDK_SHORT_NAME/macros.ini $MY_WORKSPACE/${ccs_proj_name}
+}
+
+ccs_create_arm()
+{
+    echo Detected Project $1
+    textfile=${1#*/}
+    ccs_proj_name=${textfile%.*}
+    # If the board is in secure mode , a few lines need to be added to sysbios config file for the application
+    if [ "$SEC_CFG_FILE_UPDATE_NEEDED" == "yes" ]; then
+       # For SECUREMODE=yes, the cc projects are appended with _HS so that they can coexist with non-HS projects
+       ccs_proj_name=$ccs_proj_name"_HS"
+       # Check if the secure device configuration exists on the application sysbios config file.
+       # if not add it to the config file.
+       cfgfile=$(grep "\.cfg" $textfile| sed -e  's/.*\/ti/\/ti/'|sed -e  's/"//g'| sed -e "s|\.*\/ti|${PDK_INSTALL_PATH}\/ti|g")
+       securecfg_occurance=$(grep -c "Start of lines added for secure device" $cfgfile)
+       if [ $securecfg_occurance -eq 0 ]; then
+          echo "Adding secure device configuration file for sysbios configuration file $cfgfile .."
+          echo "${RTSCCFG_ENTRY_SECUREMODE_ARM}" >> $cfgfile
+       fi
+    fi
+    #Run CCS create command specific to baremetal and OS projects
+    if [[ "$textfile" =~ "nonOS" ]]; then
+       $CCS_INSTALL_PATH/$AUTO_CREATE_COMMAND -nosplash -data $MY_WORKSPACE -application com.ti.ccstudio.apps.projectCreate -ccs.cmd "" -ccs.name ${ccs_proj_name} -ccs.outputFormat $OUTPUT_FORMAT -ccs.device "$CCS_DEVICE" -ccs.endianness $ENDIAN -ccs.kind executable -ccs.cgtVersion "$COMPILER"  -ccs.args $textfile -ccs.overwrite full  -ccs.setPostBuildStep $(CG_TOOL_ROOT)/bin/arm-none-eabi-objcopy -O binary ${ccs_proj_name}.out ${ccs_proj_name}.bin
+
+        #REM Deletes the startup file generated defaultly by CCS tool
+        rm $MY_WORKSPACE/${ccs_proj_name}/*.S
+    else
+        $CCS_INSTALL_PATH/$AUTO_CREATE_COMMAND -nosplash -data $MY_WORKSPACE -application com.ti.ccstudio.apps.projectCreate -ccs.cmd "" -ccs.name ${ccs_proj_name} -ccs.outputFormat $OUTPUT_FORMAT -ccs.setLinkerOptions "$LINKER_OPT" -ccs.setCompilerOptions "$COMPILER_OPT" -ccs.setCompilerOptions "-DUSE_BIOS" -ccs.device "$CCS_DEVICE" -ccs.endianness $ENDIAN -ccs.kind executable -ccs.cgtVersion "$COMPILER" -rtsc.xdcVersion $XDC_VERSION -rtsc.enableDspBios -rtsc.biosVersion $BIOS_VERSION -rtsc.buildProfile "debug" -rtsc.products "$RTSC_PRODUCTS" -rtsc.platform "$RTSC_PLATFORM_NAME" -rtsc.target $RTSC_TARGET -ccs.rts libc.a libgcc.a libuart.a libm.a libnosys.a -ccs.args $textfile -ccs.overwrite full -ccs.setPostBuildStep "\${TI_PDK_INSTALL_DIR}/packages/pdkAppImageCreate.sh \${TI_PDK_INSTALL_DIR}/packages \${CG_TOOL_ROOT} \${PROJECT_LOC}/\${ConfigName} \${ProjName} $SOC $PROCESSOR" \;
+    fi
+
+    echo "Copying macros.ini"
+    cp $PDK_SHORT_NAME/macros.ini $MY_WORKSPACE/${ccs_proj_name}
+}
+
+ccs_create_m4()
+{
+    echo Detected Project $1
+    textfile=${1#*/}
+
+    $CCS_INSTALL_PATH/$AUTO_CREATE_COMMAND -nosplash -data $MY_WORKSPACE -application com.ti.ccstudio.apps.projectCreate -ccs.cmd "" -ccs.name ${textfile%.*} -ccs.outputFormat $OUTPUT_FORMAT -ccs.setCompilerOptions "-DUSE_BIOS" -ccs.device "$CCS_DEVICE" -ccs.endianness $ENDIAN -ccs.kind executable -ccs.cgtVersion $CGT_M4_VERSION -rtsc.xdcVersion $XDC_VERSION -rtsc.enableDspBios -rtsc.biosVersion $BIOS_VERSION -rtsc.buildProfile "debug" -rtsc.products "$RTSC_PRODUCTS" -rtsc.platform "$RTSC_PLATFORM_NAME" -rtsc.target $RTSC_TARGET -ccs.rts libc.a libgcc.a libuart.a libm.a libnosys.a -ccs.args $textfile -ccs.overwrite full -ccs.setPostBuildStep "\${TI_PDK_INSTALL_DIR}/packages/pdkAppImageCreate.sh \${TI_PDK_INSTALL_DIR}/packages \${CG_TOOL_ROOT} \${PROJECT_LOC}/\${ConfigName} \${ProjName} $SOC $PROCESSOR" \;
+
+    echo "Copying macros.ini"
+    cp $PDK_SHORT_NAME/macros.ini $MY_WORKSPACE/${textfile%.*}
+}
+ccs_create_r5()
+{
+    echo Detected Project $1
+    textfile=${1#*/}
+
+    $CCS_INSTALL_PATH/$AUTO_CREATE_COMMAND -nosplash -data $MY_WORKSPACE -application com.ti.ccstudio.apps.projectCreate -ccs.cmd "" -ccs.name ${textfile%.*} -ccs.outputFormat $OUTPUT_FORMAT -ccs.setCompilerOptions "-DUSE_BIOS" -ccs.device "$CCS_DEVICE" -ccs.endianness $ENDIAN -ccs.kind executable -ccs.cgtVersion $CGT_M4_VERSION -rtsc.xdcVersion $XDC_VERSION -rtsc.enableDspBios -rtsc.biosVersion $BIOS_VERSION -rtsc.buildProfile "debug" -rtsc.products "$RTSC_PRODUCTS" -rtsc.platform "$RTSC_PLATFORM_NAME" -rtsc.target $RTSC_TARGET -ccs.rts libc.a libgcc.a libuart.a libm.a libnosys.a -ccs.args $textfile -ccs.overwrite full -ccs.setPostBuildStep "\${TI_PDK_INSTALL_DIR}/packages/pdkAppImageCreate.sh \${TI_PDK_INSTALL_DIR}/packages \${CG_TOOL_ROOT} \${PROJECT_LOC}/\${ConfigName} \${ProjName} $SOC $PROCESSOR" \;
+
+    echo "Copying macros.ini"
+    cp $PDK_SHORT_NAME/macros.ini $MY_WORKSPACE/${textfile%.*}
+}
+
+export -f ccs_create_dsp
+export -f ccs_create_arm
+export -f ccs_create_m4
+
+if [ "$PROCESSOR" = "dsp" ]; then
+       find -iname "*$MODULE*$BOARD*$DSP_TYPE*$PROJECT_TYPE*roject.txt" -execdir bash -c 'ccs_create_dsp {}' \;
+    if [ $(find -iname "*$MODULE*$BOARD*$DSP_TYPE*$PROJECT_TYPE*roject.txt" | wc -l) -eq 0 ]; then
+       echo "No projects detected"
+    fi
+elif [ "$PROCESSOR" = "arm" ] || [ "$PROCESSOR" = "mpu" ]; then
+    find \( -iname "*$MODULE*$BOARD*$PROCESSOR*$PROJECT_TYPE*roject.txt" $AMIC110BOARD \) -execdir bash -c 'ccs_create_arm {}' \;
+    if [ $(find \( -iname "*$MODULE*$BOARD*$PROCESSOR*$PROJECT_TYPE*roject.txt" $AMIC110BOARD \) | wc -l) -eq 0 ]; then
+       echo "No projects detected"
+    fi
+elif [ "$PROCESSOR" = "m4" ]|| [ "$PROCESSOR" = "mcu" ]; then
+    find -iname "*$MODULE*$BOARD*$PROCESSOR*$PROJECT_TYPE*roject.txt" -execdir bash -c 'ccs_create_m4 {}' \;
+    if [ $(find -iname "*$MODULE*$BOARD*$PROCESSOR*$PROJECT_TYPE*roject.txt" | wc -l) -eq 0 ]; then
+       echo "No projects detected"
+    fi
+else
+    echo "$PROCESSOR is an invalid processor"
+fi
+
+echo "Project generation complete"
+echo "*****************************************************************************"