Other Parts Discussed in Thread: C2000WARE
我在CLA程序中使用了sqrt 或 _sqrt 都报警 且 DSP运行不正常,
信息如下
undefined first referenced
symbol in file
--------- ----------------
__sqrt ./CLA.obj?
请问, 怎么样才能CLA中正确使用库函数?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
我在CLA程序中使用了sqrt 或 _sqrt 都报警 且 DSP运行不正常,
信息如下
undefined first referenced
symbol in file
--------- ----------------
__sqrt ./CLA.obj?
请问, 怎么样才能CLA中正确使用库函数?
一、看相关手册不需要什么配置,如下
C28x Control Law Accelerator Math Library SPRC99.PDF
Description Returns the square root of a floating-point argument X using a Newton-
Raphson algorithm.
Header File None
Macro Declaration CLAsqrt .macro y, x
Input: x = 32-bit floating-point input
Output: y = sqrt(x) in 32-bit floating-point
Lookup Tables None
Special Cases If X = FLT_MAX or FLT_MIN CLAsqrt will set the LUF flag.
If X = -FLT_MIN CLAsqrt will set both the LUF and LVF flags.
If X = 0.0, CLAsqrt sets the LVF flag.
If X is negative, CLAsqrt will set LVF and return 0.0.
二、看了C200WARE中的sqrt例子,详细对比了CMD LIB等配置,也没找出原因
你好,不知道你看的是哪个例程?这个路径下的例程sqrt的代码:C:\ti\c2000\C2000Ware_4_01_00_00\device_support\f2803x\examples\cla\asin
检查一下你的程序中是否include了必要的.h文件。
另外,也可以考虑使用 C28x 控制律加速器 (CLA) 数学宏程序库:https://www.ti.com.cn/tool/cn/SPRC910?_ticdt=MTY0OTk5MjY4N3wwMTc5N2Q3MDUxZjkwMDE5ZDI0ZGZmMzRhYWZlMDMwNzMwMDEzMDZiMDA4NmV8R0ExLjIuODA4MzUxNDAzLjE2MjEzMjQyMzA#overview