您好,.cfg文件如下
var System = xdc.useModule('xdc.runtime.System');
var SysStd = xdc.useModule('xdc.runtime.SysStd');
System.SupportProxy = SysStd;
var BIOS = xdc.useModule('ti.sysbios.BIOS');
BIOS.heapSize = 0x10000000;//256MBIOS.libType = BIOS.LibType_Custom;
var Settings = xdc.useModule('ti.sysbios.posix.Settings');
Settings.supportsMutexPriority = true;
var Clock = xdc.useModule('ti.sysbios.knl.Clock');
var Swi = xdc.useModule('ti.sysbios.knl.Swi');
var Task = xdc.useModule('ti.sysbios.knl.Task');
var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
//Create a task for all cores
var task0Params = new Task.Params();
task0Params.instance.name = "task0";
task0Params.stackSize = 4194304;//4M
Program.global.task0 = Task.create("&taskallcore_func", task0Params);
//Create a semaphore with count 0var semaphore0Params = new Semaphore.Params();
semaphore0Params.instance.name = "semaphore0";
Program.global.semaphore0 = Semaphore.create(null, semaphore0Params);
var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
var Ipc = xdc.useModule('ti.sdo.ipc.Ipc');
var Notify = xdc.useModule('ti.sdo.ipc.Notify');
var MessageQ = xdc.useModule('ti.sdo.ipc.MessageQ');
var HeapBufMP = xdc.useModule('ti.sdo.ipc.heaps.HeapBufMP');
var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
var nameList = MultiProc.getDeviceProcNames();
MultiProc.setConfig(null, nameList);
Ipc.procSync = Ipc.ProcSync_PAIR;
配置文件里面已近新建了信号量semaphore0,但是在源文件中引用的时候,还是提示semaphore0没有定义,编译不能通过,但是task0确实可以编译通过的,请问是什么原因,谢谢!
Shine:
请问用的是哪个版本的SYS/BIOS, XDCtool版本是否多少?
qq z:
回复 Shine:
CCS6.1.0 BIOS6.46.04.53 XDC3.32.01.22 IPC3.44.01.01
Shine:
回复 qq z:
Semaphore.create新建semaphore0,请问是怎么用semaphore的,semaphore0这个handle没写错吧?具体编译的时候报什么错误信息?
qq z:
回复 Shine:
就是Semaphore_post(semaphore0)之类的,配置就是上面.cfg文件里面的,编译就是提示semaphore0没有定义