dsp6657的helloworld例程测试-第二篇-CFG文件

1. 上一篇疑问,int StackTest()这个函数是怎么运行的,后来在.cfg文件找到了答案,.cfg包含丰富的信息,对于用惯C语言的,确实不太习惯

  1 var Memory  =   xdc.useModule(‘xdc.runtime.Memory‘);
  2 //使用的模块,XDCTools配置工具,
  3 var BIOS    =   xdc.useModule(‘ti.sysbios.BIOS‘);
  4
  5 var Task    =   xdc.useModule(‘ti.sysbios.knl.Task‘);
  6
  7 var HeapBuf =   xdc.useModule(‘ti.sysbios.heaps.HeapBuf‘);
  8
  9 var Log     =   xdc.useModule(‘xdc.runtime.Log‘);
 10
 11 /*
 12 ** Allow storing of task names. By default if you name a task with a friendly display name it will not be saved
 13 ** to conserve RAM. This must be set to true to allow it. We use friendly names on the Task List display.
 14 */
 15 //Defaults.common$.namedInstance = true;
 16 Task.common$.namedInstance = true;
 17
 18 var Clock   =   xdc.useModule (‘ti.sysbios.knl.Clock‘);
 19
 20 /*
 21 ** Interface with IPC. Depending on the version of BIOS you are using the
 22 ** module name may have changed.
 23 */
 24 /* Use this for pre BIOS 6.30 */
 25 /* var Sem        =      xdc.useModule (‘ti.sysbios.ipc.Semaphore‘); */
 26
 27 /* Use this for BIOS 6.30 plus to get the IPC module */
 28 var Sem    = xdc.useModule (‘ti.sysbios.knl.Semaphore‘);
 29
 30 var Hwi    = xdc.useModule (‘ti.sysbios.hal.Hwi‘);
 31
 32 var Ecm = xdc.useModule (‘ti.sysbios.family.c64p.EventCombiner‘);
 33
 34 /*
 35 ** Configure this to turn on the CPU Load Module for BIOS.
 36 **
 37 */
 38 /*
 39 var Load       =   xdc.useModule(‘ti.sysbios.utils.Load‘);
 40 Load.common$.diags_USER4 = Diags.ALWAYS_ON;
 41 */
 42
 43 var Diags       = xdc.useModule(‘xdc.runtime.Diags‘);
 44
 45 /*
 46 ** Sets up the exception log so you can read it with ROV in CCS
 47 */
 48 //var LoggerBuf = xdc.useModule(‘xdc.runtime.LoggerBuf‘);
 49 //var Exc = xdc.useModule(‘ti.sysbios.family.c66x.Exception‘);
 50 //Exc.common$.logger = LoggerBuf.create();
 51 //Exc.enablePrint = true; /* prints exception details to the CCS console */
 52
 53 /*
 54 **  Give the Load module it‘s own LoggerBuf to make sure the
 55 **  events are not overwritten.
 56 */
 57 /* var loggerBufParams = new LoggerBuf.Params();
 58 loggerBufParams.exitFlush = true;
 59 loggerBufParams.numEntries = 64;
 60 Load.common$.logger = LoggerBuf.create(loggerBufParams);
 61 */
 62
 63 /* Load the CSL package */
 64 var Csl                         =     xdc.useModule(‘ti.csl.Settings‘);
 65
 66 /* Load the CPPI package */
 67 var Cppi                        =   xdc.loadPackage(‘ti.drv.cppi‘);
 68
 69 /* Load the QMSS package */
 70 var Qmss                        =   xdc.loadPackage(‘ti.drv.qmss‘);
 71
 72 /* Load the Platform/NDK Transport/EMAC packages */
 73 var PlatformLib  = xdc.loadPackage(‘ti.platform.evmc6657l‘);
 74 var NdkTransport = xdc.loadPackage(‘ti.transport.ndk‘);
 75 var EmacLLD = xdc.loadPackage(‘ti.drv.emac‘);
 76
 77 /*
 78 ** Use this load to configure NDK 2.2 and above using RTSC. In previous versions of
 79 ** the NDK RTSC configuration was not supported and you should comment this out.
 80 */
 81 var Global       = xdc.useModule(‘ti.ndk.config.Global‘);
 82
 83 /*
 84 ** This allows the heart beat (poll function) to be created but does not generate the stack threads
 85 **
 86 ** Look in the cdoc (help files) to see what CfgAddEntry items can be configured. We tell it NOT
 87 ** to create any stack threads (services) as we configure those ourselves in our Main Task
 88 ** thread hpdspuaStart.
 89 */
 90 Global.enableCodeGeneration = false;
 91
 92
 93 var Startup     =   xdc.useModule(‘xdc.runtime.Startup‘);
 94
 95 var System      =   xdc.useModule(‘xdc.runtime.System‘);
 96
 97
 98
 99 /*
100 ** Create a Heap.
101 */
102 var HeapMem = xdc.useModule(‘ti.sysbios.heaps.HeapMem‘);
103 var heapMemParams = new HeapMem.Params();
104 heapMemParams.size = 0x30000;
105 heapMemParams.sectionName = "systemHeap";
106 Program.global.heap0 = HeapMem.create(heapMemParams);
107
108 /* This is the default memory heap. */
109 Memory.defaultHeapInstance  =   Program.global.heap0;
110 Program.sectMap["emacComm"] = "DDR3";
111 Program.sectMap["systemHeap"] = "DDR3";
112 Program.sectMap[".switch"]  = "DDR3";
113 Program.sectMap[".sysmem"]  = "DDR3";
114 Program.sectMap[".args"]    = "DDR3";
115 Program.sectMap[".cio"]     = "DDR3";
116 Program.sectMap[".far"]     =     "DDR3";
117 Program.sectMap[".cinit"]     =     "DDR3";
118 Program.sectMap[".bss"]        =    "DDR3";
119 Program.sectMap[".rodata"]        =    "DDR3";
120 Program.sectMap[".neardata"]        =    "DDR3";
121 Program.sectMap[".const"]    =    "DDR3";
122 Program.sectMap[".text"]    =    "DDR3";
123 Program.sectMap[".code"]    =    "DDR3";
124 Program.sectMap[".data"]    =    "DDR3";
125 Program.sectMap["platform_lib"]     =     "DDR3";
126 Program.sectMap[".far:taskStackSection"] = "L2SRAM";
127 Program.sectMap[".stack"]    =    "L2SRAM";
128 Program.sectMap[".far:IMAGEDATA"] = {loadSegment: "L2SRAM", loadAlign: 8};
129 Program.sectMap[".far:NDK_OBJMEM"] = {loadSegment: "L2SRAM", loadAlign: 8};
130 Program.sectMap[".far:NDK_PACKETMEM"] = {loadSegment: "L2SRAM", loadAlign: 128};
131
132 /* Required if using System_printf to output on the console */
133 SysStd                  =   xdc.useModule(‘xdc.runtime.SysStd‘);
134 System.SupportProxy     =   SysStd;
135
136 /********************************************************************************************************************
137 * Define hooks and static tasks  that will always be running.                                                       *
138  ********************************************************************************************************************/
139
140 /*
141 ** Register an EVM Init handler with BIOS. This will initialize the hardware. BIOS calls before it starts.
142 **
143 ** If yuo are debugging with CCS, then this function will execute as CCS loads it if the option in your
144 ** Target Configuraiton file (.ccxml) has the option set to execute all code before Main. That is the
145 ** default.
146 */
147 Startup.firstFxns.$add(‘&EVM_init‘);
148
149 /*
150 ** Create the stack Thread Task for our application.
151 */
152 var tskNdkStackTest          =   Task.create("&StackTest");
153 tskNdkStackTest.stackSize      =     0x1000;
154 tskNdkStackTest.priority    =     0x5;
155
156
157 /*
158 ** Create a Periodic task to handle all NDK polling functions.
159 ** If you are using RTSC configuration with NDK 2.2 and above, this is done by default and
160 ** you do not need to do this.
161 */
162 /*var prdNdkClkParams         =   new Clock.Params ();
163 prdNdkClkParams.period      =   0x64;
164 prdNdkClkParams.startFlag   =   true;
165 Program.global.clockInst1   =   Clock.create("&llTimerTick", 5, prdNdkClkParams);
166 */
167
168 /*
169 ** If you are using RTSC configuration with NDK 2.2 and above, this is done by default, else
170 ** register hooks so that the stack can track all Task creation
171 Task.common$.namedInstance  =   true;
172 Task.addHookSet ({ registerFxn: ‘&NDK_hookInit‘, createFxn: ‘&NDK_hookCreate‘, });
173
174 /* Enable BIOS Task Scheduler */
175 BIOS.taskEnabled            =   true;

2. RTSC里面有包的概念,类似于java语言的包格式,如下,其实也就是函数库,也可以说是,这个工程使用这个模块,不用再C语言添加代码了。

1 ti.sysbios.knl.Semaphore

3. 真正的任务创建函数,终于找到你

1 var tskNdkStackTest          =   Task.create("&StackTest");
2 tskNdkStackTest.stackSize      =     0x1000;
3 tskNdkStackTest.priority    =     0x5;

4. 这个是启动函数

1 Startup.firstFxns.$add(‘&EVM_init‘);

5. 钩子函数,和启动任务调度,每一个任务都可以有一个钩子函数,用途暂时不明白。

1 Task.common$.namedInstance  =   true;
2 Task.addHookSet ({ registerFxn: ‘&NDK_hookInit‘, createFxn: ‘&NDK_hookCreate‘, });
3
4 /* Enable BIOS Task Scheduler */
5 BIOS.taskEnabled            =   true;

6. 不是很习惯,非C语言的配置方式。

时间: 2024-08-02 18:59:40

dsp6657的helloworld例程测试-第二篇-CFG文件的相关文章

建立apk定时自动打包系统第二篇——自动上传文件

在<建立apk定时自动打包系统第一篇——Ant多渠道打包并指定打包目录和打包日期>这篇文章中介绍多渠道打包的流程.很多时候我们需要将打包好的apk上传到ftp中,这时候我可以修改custom_rules.xml这个文件就可以实现这个需求了. 1.下载 common-net-3.3.jar 并将其放在ant安装目录下的lib文件夹中. 2.修改ant.properties文件 key.store=./test.keystore key.alias=test.keystore key.store.

&lt;邮件服务postfix+mysql&gt;MAIL第二篇

环境:本服务是建立在第一篇的基础之上的,最好搭建好第一篇 玩此服务的前提是你的系统装好了msql和postfix服务. Postfix+mysql主要是把邮件服务的发与mysql结合使用.当然mysql要是一直是在命令行下使用也不是很方便对吧,下面我们来看linux图形化下mysql的使用: 下面的软件包. phpMyAdmin-2.11.3-all-languages.tar.gz是以php的格式结合Apache通过网页的形式管理mysql. 既然是使用网页管理mysql,当然很定得将这个软件

centos7搭建kafka集群-第二篇

好了,本篇开始部署kafka集群 Zookeeper集群搭建 注:Kafka集群是把状态保存在Zookeeper中的,首先要搭建Zookeeper集群(也可以用kafka自带的ZK,但不推荐) 1.软件环境 (3台服务器) 10.0.20.131 10.0.20.132 10.0.20.133 1.Linux服务器一台.三台.五台.(2*n+1),Zookeeper集群的工作是超过半数才能对外提供服务,3台中超过两台超过半数,允许1台挂掉 ,是否可以用偶数,其实没必要. 如果有四台那么挂掉一台还

prometheus监控第二篇之告警alertmanager

kubernetes之prometheus监控第二篇-alertmanager监控告警:   在前期的博文中,我已经简单的介绍过了prometheus的安装,以及通过grafana来实施监控.这篇博文,我们更深入的介绍一下prometheus的监控.本篇博文主要分为以下几个知识点: 1. 使用prometheus监控ceph存储: 2. 学习简单的PromQL语言,在grafana里面根据业务自定义dashboard; 3. alertmanager自定义告警的配置:讲述邮件告警和企业微信告警:

第二篇 Replication:分发服务器的作用

本篇文章是SQL Server Replication系列的第二篇,详细内容请参考原文. 分发服务器是SQL Server复制的核心组件.分发服务器控制并执行数据从一个服务器移动到另一个服务器的进程.它将发布和订阅的信息存储在分发数据库.几个代理促进真实数据的移动.术语在这一系列你会看到"分发服务器","发布服务器","订阅服务器".They always refer to a SQL Server instance together with

cocos2d-x 3.2 之 别踩白块(第二篇)

***************************************转载请注明出处:http://blog.csdn.net/lttree****************************************** 别踩白块--第二篇 全文摘要 > 监听 > 整个游戏的逻辑 > 游戏结束 > 计时 别踩白块到这里算是一个分号了, 游戏整体逻辑已经交代清除, 但是还不够完善,之后我将完善它,就是说一定还会有第三篇滴~ ************************

转载:eclipse 搭建SSH项目(第二篇,有具体的项目例子)

原文地址:http://blog.csdn.net/yeohcooller/article/details/9316923 读博文前应该注意: 本文提纲:本文通过一个用户注册的实例讲解SSH的整合.创建Struts项目,整合Hibernate,整合Spring.最后总结如何熟练创建SSH项目. 仅是创建SSH项目,对于其他的扩展例如Struts的国际化,Hibernate的缓存优化,Spring的AOP等,本博文涉及不到.想学习更多的东西请搜索其他博文. 本项目的环境:Windows 8-64位

【转】Cache Buffer Chain 第二篇

文章转自:http://m.bianceng.cn/database/Oracle/201407/42884.htm 测试环境:版本11gR2 SQL> select * from v$version where rownum=1; BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Releas

[C#] 软硬结合第二篇——酷我音乐盒的逆天玩法

1.灵感来源: LZ是纯宅男,一天从早上8:00起一直要呆在电脑旁到晚上12:00左右吧~平时也没人来闲聊几句,刷空间暑假也没啥动态,听音乐吧...~有些确实不好听,于是就不得不打断手头的工作去点击下一曲或是找个好听的歌来听...但是,[移动手锁定鼠标-->移动鼠标关闭当前页面选择音乐软件页面-->选择合适的音乐-->恢复原来的界面] 这一过程也会烦人不少,如果说软件的设计要在用户体验上做足功夫,感觉这一点是软件设计人员很难管住的方面,毕竟操作系统也就这样安排的嘛(当然,有些机智的开发人