/******************************************************************************************************************** * Specify all needed RTSC Modules and configure them. * ********************************************************************************************************************/ var Memory = xdc.useModule('xdc.runtime.Memory'); var BIOS = xdc.useModule('ti.sysbios.BIOS'); var List = xdc.useModule('ti.sdo.utils.List'); var MessageQ = xdc.useModule('ti.sdo.ipc.MessageQ'); var Main = xdc.useModule('xdc.runtime.Main'); /* Enable BIOS Task Scheduler */ BIOS.taskEnabled = true; var Task = xdc.useModule('ti.sysbios.knl.Task'); /* ** 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. */ 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 BIOS 6.30 plus to get the IPC module */ var Sem = xdc.useModule ('ti.sysbios.knl.Semaphore'); /* Hardware Interrupt module */ var Hwi = xdc.useModule ('ti.sysbios.hal.Hwi'); var Ecm = xdc.useModule ('ti.sysbios.family.c64p.EventCombiner'); /* * 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; /* ** Load Module - 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; */ /* * Diagnostic Module */ var Diags = xdc.useModule('xdc.runtime.Diags'); var Exc = xdc.useModule('ti.sysbios.family.c64p.Exception'); 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 DDR2 as all cacheable */ /*FixUp - changed to C66*/ var Cache = xdc.useModule('ti.sysbios.family.c66.Cache'); /*FixUp*/ /*Cache.MAR224_255 = 0x0000000f;*/ var Startup = xdc.useModule('xdc.runtime.Startup'); var System = xdc.useModule('xdc.runtime.System'); /* Required if using System_printf to output on the console */ SysStd = xdc.useModule('xdc.runtime.SysStd'); System.SupportProxy = SysStd; /* ** Heap Management Module - Create a default Heap. */ var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem'); var heapMemParams = new HeapMem.Params(); heapMemParams.size = 0xF4240; /* 1Mb*/ heapMemParams.sectionName = "systemHeap"; Program.global.heap0 = HeapMem.create(heapMemParams); Memory.defaultHeapInstance = Program.global.heap0; /* Load the CSL package - LoadPackage is equivalent to linking the library */ var Csl = xdc.loadPackage('ti.csl'); /* Load the CPPI package - LoadPackage is equivalent to linking the library */ var Cppi = xdc.loadPackage('ti.drv.cppi'); /* Load the QMSS package - LoadPackage is equivalent to linking the library*/ var Qmss = xdc.loadPackage('ti.drv.qmss'); /* Load the PA package - LoadPackage is equivalent to linking the library*/ var Pa = xdc.loadPackage('ti.drv.pa'); /* Load Platform Library - LoadPackage is equivalent to linking the library */ var Plib = xdc.loadPackage('ti.platform.evmc6678l'); /* Load Platform Library - LoadPackage is equivalent to linking the library */ var Nimulib = xdc.loadPackage('ti.transport.ndk'); /******************************************************************************************************************** * Define our Memory Map. We made up the memory names LL2RAM, DDR2 and SL2RAM. They do have special meaning. * * * * DDR - Anyhting destined for DDR always goes into the external RAM on the paltform. * * L2SRAM - This is data that should be placed into the Local L2 of the core. * * MCMSRAM - This is data that should go into the shared L2 (if it exists) or could be placed into LL2 if it doesnt.* * * * These section names are mapped to specific addresses for a paltform using our custom memroy maps which are * * defined using the Platform Wizard. Examples are custom.hpdpsua.evm6678l, etc.,. * ********************************************************************************************************************/ Program.sectMap[".vecs"] = {loadSegment: "L2SRAM", loadAlign:8}; /* CSL per core data structures */ Program.sectMap[".switch"] = {loadSegment: "L2SRAM", loadAlign:8}; /* CSL per core data structures */ Program.sectMap[".cio"] = {loadSegment: "L2SRAM", loadAlign:8}; /* per core data structures */ Program.sectMap[".args"] = {loadSegment: "L2SRAM", loadAlign:8}; /* per core data structures */ Program.sectMap[".cppi"] = {loadSegment: "L2SRAM", loadAlign:16}; /* per core data structures */ Program.sectMap[".far:NDK_OBJMEM"]= {loadSegment: "L2SRAM", loadAlign:16}; /* NDK structures */ Program.sectMap[".nimu_eth_ll2"]= {loadSegment: "L2SRAM", loadAlign:16}; /* per core data structures */ Program.sectMap[".qmss"] = {loadSegment: "L2SRAM", loadAlign:16}; /* per core data structures */ 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[".stack"] = "L2SRAM"; Program.sectMap[".bss"] = "DDR"; /* BSS. .neardata and .rodata are GROUPED */ Program.sectMap[".neardata"] = "DDR"; Program.sectMap[".rodata"] = "DDR"; Program.sectMap["systemHeap"] = {loadSegment: "DDR", loadAlign:128}; /* XDC Heap .. eg Memory_alloc () */ Program.sectMap[".far"] = "DDR"; Program.sectMap[".cinit"] = "DDR"; Program.sectMap[".const"] = "DDR"; Program.sectMap[".text"] = "DDR"; Program.sectMap[".code"] = "DDR"; Program.sectMap[".data"] = "DDR"; Program.sectMap[".sysmem"] = "DDR"; /* Malloc memory area */ Program.sectMap["platform_lib"] = "DDR"; /* Platform Library data structures */ Program.sectMap[".gBuffer"] = {loadSegment: "DDR", loadAlign:32}; /* Upload buffer used by the Web Server */ Program.sectMap[".far:WEBDATA"] = {loadSegment: "DDR", loadAlign: 32}; /* Web Pages and web server structures */ Program.sectMap[".far:taskStackSection"]= "DDR"; /* BIOS task stacks */ Program.sectMap[".far:NDK_PACKETMEM"]= {loadSegment: "MSMCSRAM", loadAlign: 128}; /* NDK Buffer Pool */ /******************************************************************************************************************** * 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.firstFxns.$add('&EVM_init'); var StartEthernetParams = new Task.Params(); StartEthernetParams.instance.name = "ethernetTask"; StartEthernetParams.priority = 9; Program.global.ethernetTask = Task.create("&StartEthernet", StartEthernetParams); Global.netSchedulerPri = Global.NC_PRIORITY_HIGH; var Log = xdc.useModule('xdc.runtime.Log'); var LogSnapShot = xdc.useModule('ti.uia.runtime.LogSnapshot'); var Logger = xdc.useModule('ti.uia.runtime.LoggerCircBuf'); var Snapshot = xdc.useModule('ti.uia.events.UIASnapshot'); var LoggerParams = new Logger.Params(); LoggerParams.transferBufSize = 32768; LoggerParams.transferType = xdc.module("ti.uia.runtime.IUIATransfer").TransferType_RELIABLE; logger = Logger.create(LoggerParams); logger.instance.name = "Logar"; Main.common$.logger = logger; Main.common$.diags_ENTRY = Diags.ALWAYS_ON; Main.common$.diags_USER1 = Diags.ALWAYS_ON; Main.common$.diags_EXIT = Diags.ALWAYS_ON; Logger.enableFlush = true;