/* * helloWorld.cfg * * Memory Map and Program intiializations for the helloWorld 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 helloWorld.cfg * * @brief * Memory Map and Program intiializations for the hello world NDK unit test. * */ /******************************************************************************************************************** * 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'); var Settings = xdc.useModule('ti.sysbios.posix.Settings'); var ti_drv_gpio_Settings = xdc.useModule('ti.drv.gpio.Settings'); Settings.supportsMutexPriority = true; var ti_transport_ndk_nimu_Settings = xdc.useModule('ti.transport.ndk.nimu.Settings'); var EventCombiner = xdc.useModule('ti.sysbios.family.c64p.EventCombiner'); var Tcp = xdc.useModule('ti.ndk.config.Tcp'); var Ip = xdc.useModule('ti.ndk.config.Ip'); var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore'); var CpIntc = xdc.useModule('ti.sysbios.family.c66.tci66xx.CpIntc'); var core = xdc.useModule('ti.sysbios.hal.Core'); var GIO = xdc.useModule('ti.sysbios.io.GIO'); var Swi = xdc.useModule('ti.sysbios.knl.Swi'); var Icmp = xdc.useModule('ti.ndk.config.Icmp'); var Pppoe = xdc.useModule('ti.ndk.config.Pppoe'); var Ppp = xdc.useModule('ti.ndk.config.Ppp'); var Route = xdc.useModule('ti.ndk.config.Route'); var Nat = xdc.useModule('ti.ndk.config.Nat'); var Emac = xdc.useModule('ti.ndk.config.Emac'); /* ** 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 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 Diags = xdc.useModule('xdc.runtime.Diags'); /* ** 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 devType = "c6678"; var osType = "tirtos"; /* Load the OSAL package */ var Osal = xdc.useModule('ti.osal.Settings'); Osal.osType = osType; Osal.socType = devType; /* Load the CSL package */ var Csl = xdc.useModule('ti.csl.Settings'); Csl.deviceType = devType; Csl.useCSLIntcLib = true; /* Load the Board package and set the board name */ var Board = xdc.loadPackage('ti.board'); Board.Settings.boardName = "evmC6678"; /* Load Profiling package */ var Utils = xdc.loadPackage('ti.utils.profiling'); /* Load the gpio package */ var Gpio = xdc.loadPackage('ti.drv.gpio'); Gpio.Settings.enableProfiling = true; Gpio.Settings.socType = devType; /* Load the spi package */ var Spi = xdc.loadPackage('ti.drv.spi'); Spi.Settings.enableProfiling = true; Spi.Settings.socType = devType; /* Load the uart package */ var Uart = xdc.loadPackage('ti.drv.uart'); Uart.Settings.enableProfiling = true; Uart.Settings.socType = devType; /* Load the CPPI package */ var Cppi = xdc.loadPackage('ti.drv.cppi'); /* Load the RM package */ var Rm = xdc.useModule('ti.drv.rm.Settings'); Rm.deviceType = devType; /* 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 NIMU packages */ var Nimu = xdc.loadPackage('ti.transport.ndk.nimu'); Nimu.Settings.socType = devType; /* ** Sets up the exception log so you can read it with ROV in CCS */ var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf'); var Exception = xdc.useModule('ti.sysbios.family.c64p.Exception'); Exception.common$.logger = LoggerBuf.create(); Exception.enablePrint = true; /* prints exception details to the CCS console */ /* ** 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 Ndk = xdc.loadPackage('ti.ndk.config'); var Global = xdc.useModule('ti.ndk.config.Global'); /*Global.autoOpenCloseFD = true;*/ /* ** 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; /*Global.multiCoreStackRunMode = Global.STACKRUN_FLG_CORE_1;*/ /* 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 = 0x3C00000; /* HEAP SIZE IS 60 MB */ heapMemParams.sectionName = "systemHeap"; Program.global.heap0 = HeapMem.create(heapMemParams); /* System stack size (used by ISRs and Swis) */ Program.stack = 0xC800; /* System stack size is 50 kB */ /* This is the memory heap definition */ Memory.defaultHeapInstance = Program.global.heap0; Program.sectMap["sharedL2"] = "MSMCSRAM"; Program.sectMap["systemHeap"] = "DDR3"; Program.sectMap[".sysmem"] = "MSMCSRAM"; Program.sectMap[".args"] = "MSMCSRAM"; Program.sectMap[".cio"] = "MSMCSRAM"; Program.sectMap[".far"] = "DDR3"; Program.sectMap[".rodata"] = "DDR3"; Program.sectMap[".neardata"] = "DDR3"; Program.sectMap[".cppi"] = "MSMCSRAM"; Program.sectMap[".init_array"] = "MSMCSRAM"; Program.sectMap[".qmss"] = "MSMCSRAM"; Program.sectMap[".cinit"] = "MSMCSRAM"; Program.sectMap[".bss"] = "DDR3"; Program.sectMap[".const"] = "MSMCSRAM"; Program.sectMap[".text"] = "MSMCSRAM"; Program.sectMap[".code"] = "DDR3"; Program.sectMap[".switch"] = "MSMCSRAM"; Program.sectMap[".data"] = "DDR3"; Program.sectMap[".fardata"] = "DDR3"; Program.sectMap[".args"] = "MSMCSRAM"; Program.sectMap[".cio"] = "MSMCSRAM"; Program.sectMap[".vecs"] = "MSMCSRAM"; Program.sectMap[".far:taskStackSection"] = "DDR3"; Program.sectMap[".stack"] = "DDR3"; Program.sectMap[".nimu_eth_ll2"] = "DDR3"; Program.sectMap[".resmgr_memregion"] = {loadSegment: "DDR3", loadAlign:16}; Program.sectMap[".resmgr_handles"] = {loadSegment: "DDR3", loadAlign: 16}; Program.sectMap[".resmgr_pa"] = {loadSegment: "DDR3", loadAlign: 8}; Program.sectMap[".far:IMAGEDATA"] = {loadSegment: "DDR3", loadAlign: 8}; Program.sectMap[".far:NDK_OBJMEM"] = {loadSegment: "DDR3", loadAlign: 8}; Program.sectMap[".far:NDK_PACKETMEM"] = {loadSegment: "DDR3", loadAlign:128}; Program.sectMap["platform_lib"] = "DDR3"; Program.sectMap[".sharedGRL"] = "DDR3"; Program.sectMap[".sharedPolicy"] = "DDR3"; Program.sectMap[".qmssDescSpace_Dpx2DspIf_1"] = {loadSegment: "L2SRAM", loadAlign: 16}; /* 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("&StackStart"); tskNdkStackTest.stackSize = 0x1400; /* ndkStacktest size is 5 kB */ tskNdkStackTest.priority = 5; /* ** 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; Task.defaultStackSize = 10240; Global.IPv6 = false; Global.netSchedulerPri = Global.NC_PRIORITY_HIGH; Global.debugPrintLevel = Global.DBG_ERROR; Global.netSchedulerOpMode = Global.NC_OPMODE_INTERRUPT; Global.stackBeginHook = "&stackBegin"; Global.stackInitHook = "&stackInitialise"; Global.stackDeleteHook = "&stackDelete"; Global.serviceReportHook = "&networkStatus"; Global.networkOpenHook = "&networkOpen"; Global.networkCloseHook = "&networkClose"; Global.networkIPAddrHook = "&networkIPAddress"; Emac.device = Emac.NONE; /* * Enable Event Groups here and registering of ISR for specific GEM INTC is done * using EventCombiner_dispatchPlug() and Hwi_eventMap() APIs */ EventCombiner.eventGroupHwiNum[0] = 11; EventCombiner.eventGroupHwiNum[1] = 12; EventCombiner.eventGroupHwiNum[2] = 13; EventCombiner.eventGroupHwiNum[3] = 15;