I'm unable to combine two projects (Telnet and OMP) that I have working independently. The Telnet is heavily based on the "client" example from the NDK examples in the MCSDK package. My other project is a custom project based on the OMP HelloWorld project. The OMP project runs on 8 cores and the Telnet project runs on 1 core.
I tried adding the source files from the OMP project to the Telnet project, adding all the package dependencies, include paths, linker paths, etc. I get the project to build to an extent, but it doesn't recognize the #pragma for OMP. I believe this is because the CFG file doesn't have the content from the OMP project. If I try adding some of the OMP CFG file's content to the Telnet CFG, I get a slew of errors.
I'm not sure the CFG file is the culprit or not, but I'll share both CFG files and hopefully someone can understand why these errors occur, or suggest how to combine the CFG files.
Below are the build results when making a call to the OpenMP function processFrame() in dsp.c:
**** Build of configuration Debug for project avm_telnetd_rfr ****
C:\ti\ccsv5\utils\bin\gmake -k all
'Building file: ../client.cfg'
'Invoking: XDCtools'
"C:/ti/xdctools_3_24_06_63/xs" --xdcpath="C:/ti/pdk_C6678_1_1_2_6/packages;C:/ti/ndk_2_22_03_20/packages;C:/ti/bios_6_33_06_50/packages;C:/ti/dsplib_c66x_3_1_0_0/packages;C:/ti/ipc_1_24_03_32/packages;C:/ti/mathlib_c66x_3_0_1_1/packages;C:/ti/mcsdk_2_01_02_06/demos;C:/ti/omp_1_02_00_05/packages;C:/Users/rradjabi/Downloads/8838.evm6678;" xdc.tools.configuro -o configPkg -t ti.targets.elf.C66 -p test_6678 -r release -c "C:/ti/ccsv5/tools/compiler/c6000_7.4.2" "../client.cfg"
making package.mak (because of package.bld) ...
generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
configuring client.xe66 from package/cfg/client_pe66.cfg ...
cle66 package/cfg/client_pe66.c ...
'Finished building: ../client.cfg'
' '
'Building file: ../avmConsole.c'
'Invoking: C6000 Compiler'
"C:/ti/ccsv5/tools/compiler/c6000_7.4.2/bin/cl6x" -mv6600 --abi=eabi -g --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --include_path="C:/ti/xdctools_3_24_06_63/packages" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/qmss" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/cppi" --include_path="C:/ti/stk-med-03.00.00/miAlgos" --include_path="C:/ti/bios_6_33_06_50/packages" --display_error_number --diag_warning=225 --preproc_with_compile --preproc_dependency="avmConsole.pp" --cmd_file="./configPkg/compiler.opt" "../avmConsole.c"
'Finished building: ../avmConsole.c'
' '
'Building file: ../avm_command.c'
'Invoking: C6000 Compiler'
"C:/ti/ccsv5/tools/compiler/c6000_7.4.2/bin/cl6x" -mv6600 --abi=eabi -g --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --include_path="C:/ti/xdctools_3_24_06_63/packages" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/qmss" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/cppi" --include_path="C:/ti/stk-med-03.00.00/miAlgos" --include_path="C:/ti/bios_6_33_06_50/packages" --display_error_number --diag_warning=225 --preproc_with_compile --preproc_dependency="avm_command.pp" --cmd_file="./configPkg/compiler.opt" "../avm_command.c"
'Finished building: ../avm_command.c'
' '
'Building file: ../client.c'
'Invoking: C6000 Compiler'
"C:/ti/ccsv5/tools/compiler/c6000_7.4.2/bin/cl6x" -mv6600 --abi=eabi -g --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --include_path="C:/ti/xdctools_3_24_06_63/packages" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/qmss" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/cppi" --include_path="C:/ti/stk-med-03.00.00/miAlgos" --include_path="C:/ti/bios_6_33_06_50/packages" --display_error_number --diag_warning=225 --preproc_with_compile --preproc_dependency="client.pp" --cmd_file="./configPkg/compiler.opt" "../client.c"
'Finished building: ../client.c'
' '
'Building file: ../dsp.c'
'Invoking: C6000 Compiler'
"C:/ti/ccsv5/tools/compiler/c6000_7.4.2/bin/cl6x" -mv6600 --abi=eabi -g --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --include_path="C:/ti/xdctools_3_24_06_63/packages" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/qmss" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/cppi" --include_path="C:/ti/stk-med-03.00.00/miAlgos" --include_path="C:/ti/bios_6_33_06_50/packages" --display_error_number --diag_warning=225 --preproc_with_compile --preproc_dependency="dsp.pp" --cmd_file="./configPkg/compiler.opt" "../dsp.c"
"../dsp.c", line 82: warning #225-D: function declared implicitly
"../dsp.c", line 110: warning #163-D: unrecognized #pragma
"../dsp.c", line 132: warning #225-D: function declared implicitly
"../dsp.c", line 228: warning #179-D: variable "j" was declared but never referenced
'Finished building: ../dsp.c'
' '
'Building file: ../gen_twiddle_fft16x32.c'
'Invoking: C6000 Compiler'
"C:/ti/ccsv5/tools/compiler/c6000_7.4.2/bin/cl6x" -mv6600 --abi=eabi -g --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --include_path="C:/ti/xdctools_3_24_06_63/packages" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/qmss" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/cppi" --include_path="C:/ti/stk-med-03.00.00/miAlgos" --include_path="C:/ti/bios_6_33_06_50/packages" --display_error_number --diag_warning=225 --preproc_with_compile --preproc_dependency="gen_twiddle_fft16x32.pp" --cmd_file="./configPkg/compiler.opt" "../gen_twiddle_fft16x32.c"
'Finished building: ../gen_twiddle_fft16x32.c'
' '
'Building file: ../main.c'
'Invoking: C6000 Compiler'
"C:/ti/ccsv5/tools/compiler/c6000_7.4.2/bin/cl6x" -mv6600 --abi=eabi -g --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --include_path="C:/ti/xdctools_3_24_06_63/packages" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/qmss" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/cppi" --include_path="C:/ti/stk-med-03.00.00/miAlgos" --include_path="C:/ti/bios_6_33_06_50/packages" --display_error_number --diag_warning=225 --preproc_with_compile --preproc_dependency="main.pp" --cmd_file="./configPkg/compiler.opt" "../main.c"
'Finished building: ../main.c'
' '
'Building file: ../platform_osal.c'
'Invoking: C6000 Compiler'
"C:/ti/ccsv5/tools/compiler/c6000_7.4.2/bin/cl6x" -mv6600 --abi=eabi -g --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --include_path="C:/ti/xdctools_3_24_06_63/packages" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/qmss" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/cppi" --include_path="C:/ti/stk-med-03.00.00/miAlgos" --include_path="C:/ti/bios_6_33_06_50/packages" --display_error_number --diag_warning=225 --preproc_with_compile --preproc_dependency="platform_osal.pp" --cmd_file="./configPkg/compiler.opt" "../platform_osal.c"
'Finished building: ../platform_osal.c'
' '
'Building file: ../resourcemgr.c'
'Invoking: C6000 Compiler'
"C:/ti/ccsv5/tools/compiler/c6000_7.4.2/bin/cl6x" -mv6600 --abi=eabi -g --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --include_path="C:/ti/xdctools_3_24_06_63/packages" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/qmss" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/cppi" --include_path="C:/ti/stk-med-03.00.00/miAlgos" --include_path="C:/ti/bios_6_33_06_50/packages" --display_error_number --diag_warning=225 --preproc_with_compile --preproc_dependency="resourcemgr.pp" --cmd_file="./configPkg/compiler.opt" "../resourcemgr.c"
'Finished building: ../resourcemgr.c'
' '
'Building file: ../tsc_h.asm'
'Invoking: C6000 Compiler'
"C:/ti/ccsv5/tools/compiler/c6000_7.4.2/bin/cl6x" -mv6600 --abi=eabi -g --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --include_path="C:/ti/xdctools_3_24_06_63/packages" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/qmss" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/cppi" --include_path="C:/ti/stk-med-03.00.00/miAlgos" --include_path="C:/ti/bios_6_33_06_50/packages" --display_error_number --diag_warning=225 --preproc_with_compile --preproc_dependency="tsc_h.pp" --cmd_file="./configPkg/compiler.opt" "../tsc_h.asm"
'Finished building: ../tsc_h.asm'
' '
'Building file: ../webpage.c'
'Invoking: C6000 Compiler'
"C:/ti/ccsv5/tools/compiler/c6000_7.4.2/bin/cl6x" -mv6600 --abi=eabi -g --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --include_path="C:/ti/xdctools_3_24_06_63/packages" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/qmss" --include_path="C:/ti/pdk_C6678_1_1_2_6/packages/ti/drv/cppi" --include_path="C:/ti/stk-med-03.00.00/miAlgos" --include_path="C:/ti/bios_6_33_06_50/packages" --display_error_number --diag_warning=225 --preproc_with_compile --preproc_dependency="webpage.pp" --cmd_file="./configPkg/compiler.opt" "../webpage.c"
'Finished building: ../webpage.c'
' '
'Building target: avm_telnetd_rfr.out'
'Invoking: C6000 Linker'
"C:/ti/ccsv5/tools/compiler/c6000_7.4.2/bin/cl6x" -mv6600 --abi=eabi -g --display_error_number --diag_warning=225 -z -m"avm_telnetd_rfr.map" -i"C:/ti/ccsv5/tools/compiler/c6000_7.4.2/lib" -i"C:/ti/dsplib_c66x_3_1_0_0/lib" -i"C:/ti/mathlib_c66x_3_0_1_1/lib" -i"C:/ti/stk-med-03.00.00/miAlgos/fft/make_c66_lib/fftlib/Release" -i"C:/ti/stk-med-03.00.00/miAlgos/util/make_c66_lib/utillib/Release" -i"C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --reread_libs --warn_sections --display_error_number --rom_model -o "avm_telnetd_rfr.out" -l"./configPkg/linker.cmd" "./webpage.obj" "./tsc_h.obj" "./resourcemgr.obj" "./platform_osal.obj" "./main.obj" "./gen_twiddle_fft16x32.obj" "./dsp.obj" "./client.obj" "./avm_command.obj" "./avmConsole.obj" -l"libc.a" -ldsplib.ae66 -lmathlib.ae66 -lfft.lib -lutil.lib
<Linking>
warning #10247-D: creating output section ".ddr" without a SECTIONS
specification
undefined first referenced
symbol in file
--------- ----------------
omp_get_thread_num ./dsp.obj
omp_set_num_threads ./dsp.obj
error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "avm_telnetd_rfr.out" not
built
>> Compilation failure
gmake: *** [avm_telnetd_rfr.out] Error 1
gmake: Target `all' not remade because of errors.
**** Build Finished ****
OMP .CFG file:
/*
* Copyright (c) 2012, Texas Instruments Incorporated
* http://www.ti.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* --/COPYRIGHT--*/
// allocate out of this shared region heap after IPC has been started.
var ti_sysbios_family_c64p_EventCombiner = xdc.useModule('ti.sysbios.family.c64p.EventCombiner');
var ti_sysbios_family_c66_tci66xx_CpIntc = xdc.useModule('ti.sysbios.family.c66.tci66xx.CpIntc');
var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
// Configure HeapOMP for the shared memory heap
// HeapOMP created in ti/omp/common.cfg.xs
var HeapOMP = xdc.useModule('ti.omp.utils.HeapOMP');
var Exception = xdc.useModule('ti.sysbios.family.c64p.Exception');
Exception.enablePrint = true;
var Log = xdc.useModule('xdc.runtime.Log');
var LoggerSys = xdc.useModule('xdc.runtime.LoggerSys');
var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
var Agent = xdc.useModule('ti.sysbios.rta.Agent');
HeapOMP.sharedRegionId = 2;
HeapOMP.localHeapSize = 0x20000;
HeapOMP.sharedHeapSize = 0x1000000;
// Specify the Shared Region
SharedRegion.setEntryMeta( HeapOMP.sharedRegionId,
{ base: 0x90000000,
len: HeapOMP.sharedHeapSize,
ownerProcId: 0,
cacheEnable: true,
createHeap: true,
isValid: true,
name: "heapomp",
}
);
/* load the common configuration file */
xdc.loadCapsule('ti/omp/common.cfg.xs');
var System = xdc.useModule('xdc.runtime.System');
System.extendedFormats = "%$S";
var OpenMP = xdc.useModule('ti.omp.utils.OpenMP');
OpenMP.setNumProcessors( 8 );
Program.sectMap[".ddr"] = new Program.SectionSpec();
Program.sectMap[".ddr"].loadSegment = "DDR3";
Program.sectMap[".threadprivate"] = new Program.SectionSpec();
Program.sectMap[".threadprivate"].loadSegment = "L2SRAM";
// Enable Cache Write-back for HEAPOMP
var Cache = xdc.useModule('ti.sysbios.family.c66.Cache');
Cache.setMarMeta(0x80000000, 0x20000000, Cache.PC | Cache.WTE);
/* ===================== Optional ============================= */
/* Advance User settings */
/* The default settings are commented out. */
/* Uncomment the same and modify, if different setting is desired */
/* =============================================================================*/
//OpenMP.qmssInit = true ;
//OpenMP.qmssMemRegion = -1;
//OpenMP.qmssStartIndex = 0;
//OpenMP.qmssDestQueueNum = -1;
//OpenMP.stackRegionId = -1;
//OpenMP.internalOsal = true;
//OpenMP.cppiHwSem = 3;
//OpenMP.qmssHwSem = 4;
//OpenMP.ompHwSem = 5;
//OpenMP.mpaxIndex = 3;
var loggerBuf0Params = new LoggerBuf.Params();
loggerBuf0Params.instance.name = "loggerBuf0";
loggerBuf0Params.numEntries = 200;
Program.global.loggerBuf0 = LoggerBuf.create(loggerBuf0Params);
var loggerSys0Params = new LoggerSys.Params();
loggerSys0Params.instance.name = "loggerSys0";
Program.global.loggerSys0 = LoggerSys.create(loggerSys0Params);
TELNET .CFG file:
/*
* client.cfg
*
* Memory Map and Program intiializations for the client example Utility
*
* Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/*
* @file client.cfg
*
* @brief
* Memory Map and Program intiializations for the HPDSP Utility.
*
*/
/********************************************************************************************************************
* Specify all needed RTSC MOudles and ocnfigure them. *
********************************************************************************************************************/
var Memory = xdc.useModule('xdc.runtime.Memory');
var BIOS = xdc.useModule('ti.sysbios.BIOS');
var Task = xdc.useModule('ti.sysbios.knl.Task');
var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf');
var Log = xdc.useModule('xdc.runtime.Log');
/*
** Allow storing of task names. By default if you name a task with a friendly display name it will not be saved
** to conserve RAM. This must be set to true to allow it. We use friendly names on the Task List display.
*/
//Defaults.common$.namedInstance = true;
Task.common$.namedInstance = true;
var Clock = xdc.useModule ('ti.sysbios.knl.Clock');
/*
** Interface with IPC. Depending on the version of BIOS you are using the
** module name may have changed.
*/
/* Use this for pre BIOS 6.30 */
/* var Sem = xdc.useModule ('ti.sysbios.ipc.Semaphore'); */
/* Use this for BIOS 6.30 plus to get the IPC module */
var Sem = xdc.useModule ('ti.sysbios.knl.Semaphore');
var Hwi = xdc.useModule ('ti.sysbios.hal.Hwi');
var Ecm = xdc.useModule ('ti.sysbios.family.c64p.EventCombiner');
/*
** Configure this to turn on the CPU Load Module for BIOS.
**
*/
/*
var Load = xdc.useModule('ti.sysbios.utils.Load');
Load.common$.diags_USER4 = Diags.ALWAYS_ON;
*/
var Diags = xdc.useModule('xdc.runtime.Diags');
/* Load the CSL package */
var Csl = xdc.useModule('ti.csl.Settings');
/* Load the CPPI package */
var Cppi = xdc.loadPackage('ti.drv.cppi');
/* Load the QMSS package */
var Qmss = xdc.loadPackage('ti.drv.qmss');
/* Load the PA package */
var Pa = xdc.useModule('ti.drv.pa.Settings');
/* Load the Platform/NDK Transport packages */
var PlatformLib = xdc.loadPackage('ti.platform.evmc6678l');
var NdkTransport = xdc.loadPackage('ti.transport.ndk');
/*
** Sets up the exception log so you can read it with ROV in CCS
*/
var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
var Exc = xdc.useModule('ti.sysbios.family.c64p.Exception');
Exc.common$.logger = LoggerBuf.create();
Exc.enablePrint = true; /* prints exception details to the CCS console */
/*
** Give the Load module it's own LoggerBuf to make sure the
** events are not overwritten.
*/
/* var loggerBufParams = new LoggerBuf.Params();
loggerBufParams.exitFlush = true;
loggerBufParams.numEntries = 64;
Load.common$.logger = LoggerBuf.create(loggerBufParams);
*/
/*
** Use this load to configure NDK 2.2 and above using RTSC. In previous versions of
** the NDK RTSC configuration was not supported and you should comment this out.
*/
var Global = xdc.useModule('ti.ndk.config.Global');
/*
** This allows the heart beat (poll function) to be created but does not generate the stack threads
**
** Look in the cdoc (help files) to see what CfgAddEntry items can be configured. We tell it NOT
** to create any stack threads (services) as we configure those ourselves in our Main Task
** thread hpdspuaStart.
*/
Global.enableCodeGeneration = false;
/* Define a variable to set the MAR mode for MSMCSRAM as all cacheable */
var Cache = xdc.useModule('ti.sysbios.family.c66.Cache');
//Cache.MAR224_255 = 0x0000000f;
var Startup = xdc.useModule('xdc.runtime.Startup');
var System = xdc.useModule('xdc.runtime.System');
/*
** Create a Heap.
*/
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var heapMemParams = new HeapMem.Params();
heapMemParams.size = 0x300000;
heapMemParams.sectionName = "systemHeap";
Program.global.heap0 = HeapMem.create(heapMemParams);
/* This is the default memory heap. */
Memory.defaultHeapInstance = Program.global.heap0;
Program.sectMap["sharedL2"] = "DDR3";
Program.sectMap["systemHeap"] = "DDR3";
Program.sectMap[".sysmem"] = "DDR3";
Program.sectMap[".args"] = "DDR3";
Program.sectMap[".cio"] = "DDR3";
Program.sectMap[".far"] = "DDR3";
Program.sectMap[".rodata"] = "DDR3";
Program.sectMap[".neardata"]= "DDR3";
Program.sectMap[".cppi"] = "DDR3";
Program.sectMap[".init_array"] = "DDR3";
Program.sectMap[".qmss"] = "DDR3";
Program.sectMap[".cinit"] = "DDR3";
Program.sectMap[".bss"] = "DDR3";
Program.sectMap[".const"] = "DDR3";
Program.sectMap[".text"] = "DDR3";
Program.sectMap[".code"] = "DDR3";
Program.sectMap[".switch"] = "DDR3";
Program.sectMap[".data"] = "DDR3";
Program.sectMap[".fardata"] = "DDR3";
Program.sectMap[".args"] = "DDR3";
Program.sectMap[".cio"] = "DDR3";
Program.sectMap[".vecs"] = "DDR3";
Program.sectMap["platform_lib"] = "DDR3";
Program.sectMap[".DbgSection"] = "DDR3";
Program.sectMap[".far:taskStackSection"] = "L2SRAM";
Program.sectMap[".stack"] = "L2SRAM";
Program.sectMap[".nimu_eth_ll2"] = "L2SRAM";
Program.sectMap[".resmgr_memregion"] = {loadSegment: "L2SRAM", loadAlign:128}; /* QMSS descriptors region */
Program.sectMap[".resmgr_handles"] = {loadSegment: "L2SRAM", loadAlign:16}; /* CPPI/QMSS/PA Handles */
Program.sectMap[".resmgr_pa"] = {loadSegment: "L2SRAM", loadAlign:8}; /* PA Memory */
Program.sectMap[".far:IMAGEDATA"] = {loadSegment: "L2SRAM", loadAlign: 8};
Program.sectMap[".far:NDK_OBJMEM"] = {loadSegment: "L2SRAM", loadAlign: 8};
Program.sectMap[".far:NDK_PACKETMEM"] = {loadSegment: "L2SRAM", loadAlign: 128};
/* Required if using System_printf to output on the console */
SysStd = xdc.useModule('xdc.runtime.SysStd');
System.SupportProxy = SysStd;
/********************************************************************************************************************
* Define hooks and static tasks that will always be running. *
********************************************************************************************************************/
/*
** Register an EVM Init handler with BIOS. This will initialize the hardware. BIOS calls before it starts.
**
** If yuo are debugging with CCS, then this function will execute as CCS loads it if the option in your
** Target Configuraiton file (.ccxml) has the option set to execute all code before Main. That is the
** default.
*/
Startup.lastFxns.$add('&EVM_init');
/*
** Create the stack Thread Task for our application.
*/
var tskNdkStackTest = Task.create("&StackTest");
tskNdkStackTest.stackSize = 0x1400;
tskNdkStackTest.priority = 0x5;
/*
** Create a Periodic task to handle all NDK polling functions.
** If you are using RTSC configuration with NDK 2.2 and above, this is done by default and
** you do not need to do this.
*/
/*var prdNdkClkParams = new Clock.Params ();
prdNdkClkParams.period = 0x64;
prdNdkClkParams.startFlag = true;
Program.global.clockInst1 = Clock.create("&llTimerTick", 5, prdNdkClkParams);
*/
/*
** If you are using RTSC configuration with NDK 2.2 and above, this is done by default, else
** register hooks so that the stack can track all Task creation
Task.common$.namedInstance = true;
Task.addHookSet ({ registerFxn: '&NDK_hookInit', createFxn: '&NDK_hookCreate', });
/* Enable BIOS Task Scheduler */
BIOS.taskEnabled = true;
/*
* Enable Event Groups here and registering of ISR for specific GEM INTC is done
* using EventCombiner_dispatchPlug() and Hwi_eventMap() APIs
*/
Ecm.eventGroupHwiNum[0] = 7;
Ecm.eventGroupHwiNum[1] = 8;
Ecm.eventGroupHwiNum[2] = 9;
Ecm.eventGroupHwiNum[3] = 10;