2 /* =============================================================================
3 * Copyright (c) Texas Instruments Incorporated 2018
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the
15 * distribution.
16 *
17 * Neither the name of Texas Instruments Incorporated nor the names of
18 * its contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33 var Defaults = xdc.useModule('xdc.runtime.Defaults');
34 var Diags = xdc.useModule('xdc.runtime.Diags');
35 var Error = xdc.useModule('xdc.runtime.Error');
36 var Log = xdc.useModule('xdc.runtime.Log');
37 var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
38 var Main = xdc.useModule('xdc.runtime.Main');
39 var Memory = xdc.useModule('xdc.runtime.Memory');
40 var System = xdc.useModule('xdc.runtime.System');
41 var Text = xdc.useModule('xdc.runtime.Text');
42 var Clock = xdc.useModule('ti.sysbios.knl.Clock');
43 var Task = xdc.useModule('ti.sysbios.knl.Task');
44 var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
46 var BIOS = xdc.useModule('ti.sysbios.BIOS');
47 var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
48 var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
49 var SysMin = xdc.useModule('xdc.runtime.SysMin');
51 var Cache = xdc.module("ti.sysbios.hal.Cache");
52 Cache.CacheProxy = xdc.useModule("ti.sysbios.family.arm.v8a.Cache");
54 var Mmu = xdc.useModule('ti.sysbios.family.arm.v8a.Mmu');
55 Mmu.initFunc = "&InitMmu";
56 Mmu.tableArrayLen = 24;
57 Program.sectMap[".ti_sysbios_family_arm_v8a_Mmu_tableArray"] = "MSMC_SRAM";
59 /*
60 * Direct CIO to UART
61 */
62 /* System.SupportProxy = SysUart; */
63 System.SupportProxy = SysMin;
65 /*
66 * Program.argSize sets the size of the .args section.
67 * The examples don't use command line args so argSize is set to 0.
68 */
69 Program.argSize = 0x0;
71 /*
72 * Uncomment this line to globally disable Asserts.
73 * All modules inherit the default from the 'Defaults' module. You
74 * can override these defaults on a per-module basis using Module.common$.
75 * Disabling Asserts will save code space and improve runtime performance.
76 Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;
77 */
79 /*
80 * Uncomment this line to keep module names from being loaded on the target.
81 * The module name strings are placed in the .const section. Setting this
82 * parameter to false will save space in the .const section. Error and
83 * Assert messages will contain an "unknown module" prefix instead
84 * of the actual module name.
85 Defaults.common$.namedModule = false;
86 */
88 /* Create default heap and hook it into Memory */
89 var heapMemParams = new HeapMem.Params;
90 heapMemParams.size = 16384*3;
91 var heap0 = HeapMem.create(heapMemParams);
93 Memory.defaultHeapInstance = heap0;
95 /*
96 * Minimize exit handler array in System. The System module includes
97 * an array of functions that are registered with System_atexit() to be
98 * called by System_exit().
99 */
100 System.maxAtexitHandlers = 4;
102 /*
103 * Uncomment this line to disable the Error print function.
104 * We lose error information when this is disabled since the errors are
105 * not printed. Disabling the raiseHook will save some code space if
106 * your app is not using System_printf() since the Error_print() function
107 * calls System_printf().
108 Error.raiseHook = null;
109 */
111 /*
112 * Uncomment this line to keep Error, Assert, and Log strings from being
113 * loaded on the target. These strings are placed in the .const section.
114 * Setting this parameter to false will save space in the .const section.
115 * Error, Assert and Log message will print raw ids and args instead of
116 * a formatted message.
117 Text.isLoaded = false;
118 */
120 /*
121 * Uncomment this line to disable the output of characters by SysMin
122 * when the program exits. SysMin writes characters to a circular buffer.
123 * This buffer can be viewed using the SysMin Output view in ROV.
124 SysMin.flushAtExit = false;
125 */
127 /*
128 * Create and install logger for the whole system
129 */
130 var loggerBufParams = new LoggerBuf.Params();
131 loggerBufParams.numEntries = 32;
132 var logger0 = LoggerBuf.create(loggerBufParams);
133 Defaults.common$.logger = logger0;
134 Main.common$.diags_INFO = Diags.ALWAYS_ON;
136 BIOS.libType = BIOS.LibType_Custom;
138 /* Disable Timer frequency check, workaround for QT test */
139 var Timer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
140 Timer.checkFrequency = false;
142 /* Check if application needs to update with custom configuration options */
143 var cfgUpdate = java.lang.System.getenv("XDC_CFG_UPDATE")
144 if(cfgUpdate != '' && cfgUpdate != null)
145 {
146 xdc.print("Loading configuration update " + cfgUpdate);
147 xdc.loadCapsule(cfgUpdate);
148 }