TI中文支持网
TI专业的中文技术问题搜集分享网站

TMS320F280025C: 导入示例项目可以使用SysCtl_delay(),但如果自行引用sysctl.h来使用SysCtl_delay()就显示No source available for "SysCtl_delay()"

Part Number:TMS320F280025COther Parts Discussed in Thread: C2000WARE

您好:

我正在初学使用TMS320F280025C芯片,从C:\ti\c2000\C2000Ware_5_04_00_00\driverlib\f28002x\examples\led导入这个LED闪烁的项目时,main函数中的Device_init();跳转→SysCtl_setClock(DEVICE_SETCLOCK_CFG);跳转→SysCtl_delay(23U);这个延时函数是可以正常运行的。但是,当我尝试学习从零开始新建一个项目,把C:\ti\c2000\C2000Ware_5_04_00_00\driverlib\f28002x\driverlib里面的文件都复制到工作区,也正确设置了路径、也正确引用了相关头文件后,Device_init();跳转→SysCtl_setClock(DEVICE_SETCLOCK_CFG);跳转→SysCtl_delay(23U);延时函数就无法运行了,连接仿真器时显示No source available for "SysCtl_delay()"。

我查看这个延时函数,发现是在sysctl.c中使用汇编语言写的,如下:

//
// Define to isolate inline assembly
//
#define SYSCTL_DELAY__asm(" .if __TI_EABI__\n"\" .asgSysCtl_delay, _SysCtl_delay\n" \" .endif\n"\" .def _SysCtl_delay\n"\" .sect \".TI.ramfunc\"\n"\" .global  _SysCtl_delay\n"\"_SysCtl_delay:\n"\" SUBACC,#1\n"\" BF_SysCtl_delay, GEQ\n"\" LRETR\n")
//*****************************************************************************
//
// SysCtl_delay()
//
//*****************************************************************************
SYSCTL_DELAY;

在sysctl.h中也有声明

extern void SysCtl_delay(uint32_t count);

然后我试了其他示例,发现均是在C:\ti\c2000\C2000Ware_5_04_00_00\driverlib\f28002x\examples路径导入的项目全部能使用SysCtl_delay()函数,只要是自己引用sysctl.h文件使用SysCtl_delay()函数的就会失败,提示No source available for "SysCtl_delay()",找了很久一直没有找到原因,很奇怪,请帮忙解答一下,不甚感激!

Taylor:

您好,

已经收到了您的案例,调查需要些时间,感谢您的耐心等待。

,

Vivian Gao:

Have you verified that the include options and file search paths are the same between the example projects and your project that you have created?

If there is no source available for sysctl_delay, can you browse for the correct file and will it show it?

,

LI WEN:

I copied the file from C:\ti\c2000\C2000Ware_5_04_00_00\driverlib\f28002x\driverlib to my project path D:\LED_blinky\driverlib, In CCS, D:\LED_blinky\driverlib is also used as a reference path. Press F3 open declaration in the main.c file to jump to sysctl.h as shown in the problem description, indicating that this resource can be found

,

LI WEN:

你好,请问调查情况如何了,是否复现了此问题了?有解决方案吗?

,

Vivian Gao:

Do you have both the sysctl.c and sysctl.h file copied over? Are you including these files properly in your main file?

赞(0)
未经允许不得转载:TI中文支持网 » TMS320F280025C: 导入示例项目可以使用SysCtl_delay(),但如果自行引用sysctl.h来使用SysCtl_delay()就显示No source available for "SysCtl_delay()"
分享到: 更多 (0)

© 2025 TI中文支持网   网站地图 鲁ICP备2022002796号-1