请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:TMS320C6678 工具/软件:Code Composer Studio
我尝试使用 XDC 命令工具编译动态库。 但是,当我尝试在 DLL 中使用 SYS/BIOS 函数时,我发现我可以毫无错误地编译库,但是当我尝试在主函数中运行入口点时,线程未正确运行,入口点将不会返回。
#include <xdc/std.h>
#include <xdc/runtime/System.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <xdc/runtime/Error.h>
#include <ti/sysbios/knl/Semaphore.h>
char *__TI_STACK_END;
uint8_t *__c_args__;
UInt8 __TI_STACK_SIZE;
void test_TASK(void)
{
int a = 10;
// while(1) {
// printf("Hello, world\n");
// }
}
void main(void){
}
int test(void* args)
{
Semaphore_Params Sem_Params;
Semaphore_Params_init(&Sem_Params);
Sem_Params.mode = Semaphore_Mode_BINARY;
Semaphore_Handle sh = Semaphore_create(0, &Sem_Params, NULL);
return (int)sh;
// System_printf("hello world\n");
// Task_Handle htsk;
// Task_Params taskParams;
// Task_Params_init(&taskParams);
// // taskParams.stack = NULL;
// taskParams.stackSize = 1024;
// taskParams.priority = 3;
// htsk = Task_create((Task_FuncPtr)test_TASK, &taskParams, NULL);
return 10101;
}
makefile:
CGTOOLS = F:\\software\\ti_ccs5\\ccsv5\\tools\\compiler\\c6000_7.4.2
CC = $(CGTOOLS)/bin/cl6x
LNK = $(CGTOOLS)/bin/lnk6x
RTS = $(CGTOOLS)/lib/rts6600_elf.lib
CONFIG = mycfg
XDCTARGET = ti.targets.elf.C66
XDCPLATFORM = ti.platforms.evm6678
%/linker.cmd %/compiler.opt : %.cfg
xs --xdcpath="F:\\software\\ti_ccs5\\bios_6_35_01_29\\packages" xdc.tools.configuro -c $(CGTOOLS) -t $(XDCTARGET) -p $(XDCPLATFORM) $<
%.obj : %.c $(CONFIG)/compiler.opt
$(CC) -@$(CONFIG)/compiler.opt -c $<
dll_com.dll: dll_com.obj $(CONFIG)/linker.cmd
$(LNK) -o dll_com.dll --entry_point=test --dynamic=lib -c dll_com.obj $(CONFIG)/linker.cmd $(RTS)
cfg:
var System = xdc.useModule("xdc.runtime.System");
var BIOS = xdc.useModule('ti.sysbios.BIOS');
var Task = xdc.useModule('ti.sysbios.knl.Task');
var Program = xdc.useModule('xdc.cfg.Program');
结果:
相关主题:
https://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/623173


