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

 var Memory  =   xdc.useModule('xdc.runtime.Memory');
//使用的模块,XDCTools配置工具,
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'); /*
** 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.c66x.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);
*/ /* 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 Platform/NDK Transport/EMAC packages */
var PlatformLib = xdc.loadPackage('ti.platform.evmc6657l');
var NdkTransport = xdc.loadPackage('ti.transport.ndk');
var EmacLLD = xdc.loadPackage('ti.drv.emac'); /*
** 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; 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 = 0x30000;
heapMemParams.sectionName = "systemHeap";
Program.global.heap0 = HeapMem.create(heapMemParams); /* This is the default memory heap. */
Memory.defaultHeapInstance = Program.global.heap0;
Program.sectMap["emacComm"] = "DDR3";
Program.sectMap["systemHeap"] = "DDR3";
Program.sectMap[".switch"] = "DDR3";
Program.sectMap[".sysmem"] = "DDR3";
Program.sectMap[".args"] = "DDR3";
Program.sectMap[".cio"] = "DDR3";
Program.sectMap[".far"] = "DDR3";
Program.sectMap[".cinit"] = "DDR3";
Program.sectMap[".bss"] = "DDR3";
Program.sectMap[".rodata"] = "DDR3";
Program.sectMap[".neardata"] = "DDR3";
Program.sectMap[".const"] = "DDR3";
Program.sectMap[".text"] = "DDR3";
Program.sectMap[".code"] = "DDR3";
Program.sectMap[".data"] = "DDR3";
Program.sectMap["platform_lib"] = "DDR3";
Program.sectMap[".far:taskStackSection"] = "L2SRAM";
Program.sectMap[".stack"] = "L2SRAM";
Program.sectMap[".far:IMAGEDATA"] = {loadSegment: "L2SRAM", loadAlign: };
Program.sectMap[".far:NDK_OBJMEM"] = {loadSegment: "L2SRAM", loadAlign: };
Program.sectMap[".far:NDK_PACKETMEM"] = {loadSegment: "L2SRAM", loadAlign: }; /* 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.firstFxns.$add('&EVM_init'); /*
** Create the stack Thread Task for our application.
*/
var tskNdkStackTest = Task.create("&StackTest");
tskNdkStackTest.stackSize = 0x1000;
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;

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

 ti.sysbios.knl.Semaphore

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

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

4. 这个是启动函数

 Startup.firstFxns.$add('&EVM_init');

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

 Task.common$.namedInstance  =   true;
Task.addHookSet ({ registerFxn: '&NDK_hookInit', createFxn: '&NDK_hookCreate', }); /* Enable BIOS Task Scheduler */
BIOS.taskEnabled = true;

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

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

  1. dsp6657的helloworld例程测试-第一篇

    环境搭建可以参考http://blog.sina.com.cn/s/blog_ed2e19900102xi2j.html 1. 先从mcsdk导入工程,helloworld例程 2. 提示有错误,估计 ...

  2. 【AI测试】也许这有你想知道的人工智能 (AI) 测试--第二篇

    概述此为人工智能 (AI) 测试第二篇 第一篇主要介绍了 人工智能测试.测试什么.测试数据等.第二篇主要介绍测试用例和测试报告.之后的文章可能具体介绍如何开展各项测试,以及具体项目举例如何测试.测试用 ...

  3. 【AI测试】人工智能 (AI) 测试--第二篇

    测试用例 人工智能 (AI) 测试 或者说是 算法测试,主要做的有三件事. 收集测试数据 思考需要什么样的测试数据,测试数据的标注 跑测试数据 编写测试脚本批量运行 查看数据结果 统计正确和错误的个数 ...

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

    在<建立apk定时自动打包系统第一篇——Ant多渠道打包并指定打包目录和打包日期>这篇文章中介绍多渠道打包的流程.很多时候我们需要将打包好的apk上传到ftp中,这时候我可以修改custo ...

  5. Python全栈开发记录_第二篇(文件操作及三级菜单栏增删改查)

    python3文件读写操作(本篇代码大约100行) f = open(xxx.txt, "r", encoding="utf-8") 不写“r”(只读)默认是只 ...

  6. WEB安全第二篇--用文件搞定服务器:任意文件上传、文件包含与任意目录文件遍历

    零.前言 最近做专心web安全有一段时间了,但是目测后面的活会有些复杂,涉及到更多的中间件.底层安全.漏洞研究与安全建设等越来越复杂的东东,所以在这里想写一个系列关于web安全基础以及一些讨巧的pay ...

  7. RabbitMQ学习总结 第二篇:快速入门HelloWorld

    目录 RabbitMQ学习总结 第一篇:理论篇 RabbitMQ学习总结 第二篇:快速入门HelloWorld RabbitMQ学习总结 第三篇:工作队列Work Queue RabbitMQ学习总结 ...

  8. 第二篇 界面开发 (Android学习笔记)

    第二篇 界面开发 第5章 探索界面UI元素 ●The Android View Class     ●△Widget设计步骤 需要修改三个XML,以及一个class: 1)第一个xml是布局XML文件 ...

  9. centos7搭建kafka集群-第二篇

    好了,本篇开始部署kafka集群 Zookeeper集群搭建 注:Kafka集群是把状态保存在Zookeeper中的,首先要搭建Zookeeper集群(也可以用kafka自带的ZK,但不推荐) 1.软 ...

随机推荐

  1. 【nodejs】学习笔记

    学习链接:http://www.cnblogs.com/zhongweiv/p/nodejs_environment.html (一)简介及环境安装 Node.js是让Javascript脱离浏览器运 ...

  2. python sorted() count() set(list)-去重 -- search + match

    2.用python实现统计一篇英文文章内每个单词的出现频率,并返回出现频率最高的前10个单词及其出现次数,并解答以下问题?(标点符号可忽略) (1) 创建文件对象f后,解释f的readlines和xr ...

  3. 软工之词频统计器及基于sketch在大数据下的词频统计设计

    目录 摘要 算法关键 红黑树 稳定排序 代码框架 .h文件: .cpp文件 频率统计器的实现 接口设计与实现 接口设计 核心功能词频统计器流程 效果 单元测试 性能分析 性能分析图 问题发现 解决方案 ...

  4. SSM项目引入文件失败

    <mvc:resources mapping="/styles/**" location="/css/"/> <mvc:resources m ...

  5. CentOS7安装及相关配置转载

    1. 怎样在 CentOS 7.0 上安装和配置 VNC 服务器 https://linux.cn/article-5335-1.html 2. 安装完最小化 RHEL/CentOS 7 后需要做的 ...

  6. React Native获取组件位置和大小

    RN页面中定位或滚动操作时,需要获取元素的大小和位置信息,有几种常用的方法 获取设备屏幕的宽高 import {Dimensions} from 'react-native'; var {height ...

  7. 【2017 ICPC亚洲区域赛北京站 J】Pangu and Stones(区间dp)

    In Chinese mythology, Pangu is the first living being and the creator of the sky and the earth. He w ...

  8. Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first.

    最近在开发一个网站时,有个需要是 如果有新预警信息要在网页中播放提示音.页面打开会请求是否有新信息,有则播放提示音.在Chrome的最新浏览器中,播放会报错,控制台显示Uncaught (in pro ...

  9. nginx 源码安装以及后续升级https

    事情的来源是,公司要将网站从http升级到https,由于历史遗留原因,才发现现有的nginx是通过源码安装的,并没有安装ssl模块,需要现安装sll模块,这个nginx是整个公司最前端的一个代理,涉 ...

  10. ARM开发---Keil注册+JLink维修详解

    在ARM开发中,经常使用的开发环境就是Keil uVision集成开发环境+JLink仿真器,本文就是就是介绍.总结使用该开发环境中遇到的问题,并在问题后方附上亲测可行的解决方法.如果各位看官在开发过 ...