打印

AN1017中dspic30F3010BLDC电机正弦波驱动编译出错。

[复制链接]
5217|6
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
MPLAB IDE 8.80开发环境,使用XC16编译器。
AN1017中dspic30F3010BLDC电机正弦波驱动编译出错。请问这是怎么回事?谢谢----------------------------------------------------------------------
Release build of project `D:\gong\program\DSPIC30F\AN1017_30F3010_V1\AN1017_30F3010_V1\AN1017.mcp' started.
Language tool versions: xc16-as.exe v1.70, xc16-gcc.exe v1.70, xc16-ld.exe v1.70, xc16-ranlib.exe v1.70
Fri Aug 06 23:04:16 2021
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Deleted file "D:\gong\program\DSPIC30F\AN1017_30F3010_V1\AN1017_30F3010_V1\AN1017.mcs".
Clean: Done.
Executing: "C:\Program Files\Microchip\xc16\v1.70\bin\xc16-gcc.exe" -mcpu=30F3010 -x c -c   "SinusoidalBLDC v1.2.c" -o"SinusoidalBLDC v1.2.o" -g
SinusoidalBLDC v1.2.c: In function 'SpeedControl':
SinusoidalBLDC v1.2.c:1017:2: error: too few arguments to function '__builtin_subab'
SinusoidalBLDC v1.2.c:1020:6: error: too few arguments to function '__builtin_movsac'
SinusoidalBLDC v1.2.c:1024:31: warning: passing argument 3 of '__builtin_mac' makes integer from pointer without a cast
SinusoidalBLDC v1.2.c:1024:31: note: expected 'int' but argument is of type 'SFRAC16 **'
SinusoidalBLDC v1.2.c:1024:31: warning: passing argument 4 of '__builtin_mac' from incompatible pointer type
SinusoidalBLDC v1.2.c:1024:31: note: expected 'int **' but argument is of type 'SFRAC16 *'
SinusoidalBLDC v1.2.c:1024:31: warning: passing argument 5 of '__builtin_mac' makes pointer from integer without a cast
SinusoidalBLDC v1.2.c:1024:31: note: expected 'int *' but argument is of type 'int'
SinusoidalBLDC v1.2.c:1024:31: warning: passing argument 6 of '__builtin_mac' makes integer from pointer without a cast
SinusoidalBLDC v1.2.c:1024:31: note: expected 'int' but argument is of type 'SFRAC16 **'
SinusoidalBLDC v1.2.c:1024:31: warning: passing argument 7 of '__builtin_mac' from incompatible pointer type
SinusoidalBLDC v1.2.c:1024:31: note: expected 'int **' but argument is of type 'SFRAC16 *'
SinusoidalBLDC v1.2.c:1024:31: warning: passing argument 8 of '__builtin_mac' makes pointer from integer without a cast
SinusoidalBLDC v1.2.c:1024:31: note: expected 'int *' but argument is of type 'int'
SinusoidalBLDC v1.2.c:1024:31: error: too few arguments to function '__builtin_mac'
SinusoidalBLDC v1.2.c:1027:31: warning: passing argument 3 of '__builtin_mac' makes integer from pointer without a cast
SinusoidalBLDC v1.2.c:1027:31: note: expected 'int' but argument is of type 'SFRAC16 **'
SinusoidalBLDC v1.2.c:1027:31: warning: passing argument 4 of '__builtin_mac' from incompatible pointer type
SinusoidalBLDC v1.2.c:1027:31: note: expected 'int **' but argument is of type 'SFRAC16 *'
SinusoidalBLDC v1.2.c:1027:31: warning: passing argument 5 of '__builtin_mac' makes pointer from integer without a cast
SinusoidalBLDC v1.2.c:1027:31: note: expected 'int *' but argument is of type 'int'
SinusoidalBLDC v1.2.c:1027:31: warning: passing argument 6 of '__builtin_mac' makes integer from pointer without a cast
SinusoidalBLDC v1.2.c:1027:31: note: expected 'int' but argument is of type 'SFRAC16 **'
SinusoidalBLDC v1.2.c:1027:31: warning: passing argument 7 of '__builtin_mac' from incompatible pointer type
SinusoidalBLDC v1.2.c:1027:31: note: expected 'int **' but argument is of type 'SFRAC16 *'
SinusoidalBLDC v1.2.c:1027:31: warning: passing argument 8 of '__builtin_mac' makes pointer from integer without a cast
SinusoidalBLDC v1.2.c:1027:31: note: expected 'int *' but argument is of type 'int'
SinusoidalBLDC v1.2.c:1027:31: error: too few arguments to function '__builtin_mac'
SinusoidalBLDC v1.2.c:1030:31: warning: passing argument 3 of '__builtin_mac' makes integer from pointer without a cast
SinusoidalBLDC v1.2.c:1030:31: note: expected 'int' but argument is of type 'SFRAC16 **'
SinusoidalBLDC v1.2.c:1030:31: warning: passing argument 4 of '__builtin_mac' from incompatible pointer type
SinusoidalBLDC v1.2.c:1030:31: note: expected 'int **' but argument is of type 'SFRAC16 *'
SinusoidalBLDC v1.2.c:1030:31: warning: passing argument 5 of '__builtin_mac' makes pointer from integer without a cast
SinusoidalBLDC v1.2.c:1030:31: note: expected 'int *' but argument is of type 'int'
SinusoidalBLDC v1.2.c:1030:31: warning: passing argument 6 of '__builtin_mac' makes integer from pointer without a cast
SinusoidalBLDC v1.2.c:1030:31: note: expected 'int' but argument is of type 'SFRAC16 **'
SinusoidalBLDC v1.2.c:1030:31: warning: passing argument 7 of '__builtin_mac' from incompatible pointer type
SinusoidalBLDC v1.2.c:1030:31: note: expected 'int **' but argument is of type 'SFRAC16 *'
SinusoidalBLDC v1.2.c:1030:31: warning: passing argument 8 of '__builtin_mac' makes pointer from integer without a cast
SinusoidalBLDC v1.2.c:1030:31: note: expected 'int *' but argument is of type 'int'
SinusoidalBLDC v1.2.c:1030:31: error: too few arguments to function '__builtin_mac'
Halting build on first failure as requested.
----------------------------------------------------------------------
Release build of project `D:\gong\program\DSPIC30F\AN1017_30F3010_V1\AN1017_30F3010_V1\AN1017.mcp' failed.
Language tool versions: xc16-as.exe v1.70, xc16-gcc.exe v1.70, xc16-ld.exe v1.70, xc16-ranlib.exe v1.70
Fri Aug 06 23:04:25 2021
----------------------------------------------------------------------
BUILD FAILED

使用特权

评论回复
沙发
yangxiaor520| | 2021-8-7 08:09 | 只看该作者
是不是缺少文件或头文件路径不对

使用特权

评论回复
板凳
鲤鱼山人|  楼主 | 2021-8-7 19:45 | 只看该作者
yangxiaor520 发表于 2021-8-7 08:09
是不是缺少文件或头文件路径不对

谢谢!

使用特权

评论回复
地板
鲤鱼山人|  楼主 | 2021-8-7 19:47 | 只看该作者

//#include "p30f3010.h"
增加了这条后,
#include <xc.h>
编译,错误提示还是这样,
Release build of project `D:\gong\program\DSPIC30F\AN1017_30F3010_V1\AN1017_30F3010_V1\AN1017.mcp' started.
Language tool versions: xc16-as.exe v1.70, xc16-gcc.exe v1.70, xc16-ld.exe v1.70, xc16-ranlib.exe v1.70
Sat Aug 07 19:33:19 2021
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\xc16\v1.70\bin\xc16-gcc.exe" -mcpu=30F3010 -x c -c   "SinusoidalBLDC v1.2.c" -o"SinusoidalBLDC v1.2.o" -g
SinusoidalBLDC v1.2.c: In function 'SpeedControl':
SinusoidalBLDC v1.2.c:1018:2: error: too few arguments to function '__builtin_subab'
SinusoidalBLDC v1.2.c:1021:6: error: too few arguments to function '__builtin_movsac'
SinusoidalBLDC v1.2.c:1025:31: warning: passing argument 3 of '__builtin_mac' makes integer from pointer without a cast
c:\program files\microchip\xc16\v1.70\bin\bin\../..\support\generic\h/builtins.h:170:9: note: expected 'int' but argument is of type 'SFRAC16 **'
SinusoidalBLDC v1.2.c:1025:31: warning: passing argument 4 of '__builtin_mac' from incompatible pointer type
c:\program files\microchip\xc16\v1.70\bin\bin\../..\support\generic\h/builtins.h:170:9: note: expected 'int **' but argument is of type 'SFRAC16 *'
SinusoidalBLDC v1.2.c:1025:31: warning: passing argument 5 of '__builtin_mac' makes pointer from integer without a cast
c:\program files\microchip\xc16\v1.70\bin\bin\../..\support\generic\h/builtins.h:170:9: note: expected 'int *' but argument is of type 'int'
SinusoidalBLDC v1.2.c:1025:31: warning: passing argument 6 of '__builtin_mac' makes integer from pointer without a cast
c:\program files\microchip\xc16\v1.70\bin\bin\../..\support\generic\h/builtins.h:170:9: note: expected 'int' but argument is of type 'SFRAC16 **'
SinusoidalBLDC v1.2.c:1025:31: warning: passing argument 7 of '__builtin_mac' from incompatible pointer type
c:\program files\microchip\xc16\v1.70\bin\bin\../..\support\generic\h/builtins.h:170:9: note: expected 'int **' but argument is of type 'SFRAC16 *'
SinusoidalBLDC v1.2.c:1025:31: warning: passing argument 8 of '__builtin_mac' makes pointer from integer without a cast
c:\program files\microchip\xc16\v1.70\bin\bin\../..\support\generic\h/builtins.h:170:9: note: expected 'int *' but argument is of type 'int'
SinusoidalBLDC v1.2.c:1025:31: error: too few arguments to function '__builtin_mac'
SinusoidalBLDC v1.2.c:1028:31: warning: passing argument 3 of '__builtin_mac' makes integer from pointer without a cast
c:\program files\microchip\xc16\v1.70\bin\bin\../..\support\generic\h/builtins.h:170:9: note: expected 'int' but argument is of type 'SFRAC16 **'
SinusoidalBLDC v1.2.c:1028:31: warning: passing argument 4 of '__builtin_mac' from incompatible pointer type
c:\program files\microchip\xc16\v1.70\bin\bin\../..\support\generic\h/builtins.h:170:9: note: expected 'int **' but argument is of type 'SFRAC16 *'
SinusoidalBLDC v1.2.c:1028:31: warning: passing argument 5 of '__builtin_mac' makes pointer from integer without a cast
c:\program files\microchip\xc16\v1.70\bin\bin\../..\support\generic\h/builtins.h:170:9: note: expected 'int *' but argument is of type 'int'
SinusoidalBLDC v1.2.c:1028:31: warning: passing argument 6 of '__builtin_mac' makes integer from pointer without a cast
c:\program files\microchip\xc16\v1.70\bin\bin\../..\support\generic\h/builtins.h:170:9: note: expected 'int' but argument is of type 'SFRAC16 **'
SinusoidalBLDC v1.2.c:1028:31: warning: passing argument 7 of '__builtin_mac' from incompatible pointer type
c:\program files\microchip\xc16\v1.70\bin\bin\../..\support\generic\h/builtins.h:170:9: note: expected 'int **' but argument is of type 'SFRAC16 *'
SinusoidalBLDC v1.2.c:1028:31: warning: passing argument 8 of '__builtin_mac' makes pointer from integer without a cast
c:\program files\microchip\xc16\v1.70\bin\bin\../..\support\generic\h/builtins.h:170:9: note: expected 'int *' but argument is of type 'int'
SinusoidalBLDC v1.2.c:1028:31: error: too few arguments to function '__builtin_mac'
SinusoidalBLDC v1.2.c:1031:31: warning: passing argument 3 of '__builtin_mac' makes integer from pointer without a cast
c:\program files\microchip\xc16\v1.70\bin\bin\../..\support\generic\h/builtins.h:170:9: note: expected 'int' but argument is of type 'SFRAC16 **'
SinusoidalBLDC v1.2.c:1031:31: warning: passing argument 4 of '__builtin_mac' from incompatible pointer type
c:\program files\microchip\xc16\v1.70\bin\bin\../..\support\generic\h/builtins.h:170:9: note: expected 'int **' but argument is of type 'SFRAC16 *'
SinusoidalBLDC v1.2.c:1031:31: warning: passing argument 5 of '__builtin_mac' makes pointer from integer without a cast
c:\program files\microchip\xc16\v1.70\bin\bin\../..\support\generic\h/builtins.h:170:9: note: expected 'int *' but argument is of type 'int'
SinusoidalBLDC v1.2.c:1031:31: warning: passing argument 6 of '__builtin_mac' makes integer from pointer without a cast
c:\program files\microchip\xc16\v1.70\bin\bin\../..\support\generic\h/builtins.h:170:9: note: expected 'int' but argument is of type 'SFRAC16 **'
SinusoidalBLDC v1.2.c:1031:31: warning: passing argument 7 of '__builtin_mac' from incompatible pointer type
c:\program files\microchip\xc16\v1.70\bin\bin\../..\support\generic\h/builtins.h:170:9: note: expected 'int **' but argument is of type 'SFRAC16 *'
SinusoidalBLDC v1.2.c:1031:31: warning: passing argument 8 of '__builtin_mac' makes pointer from integer without a cast
c:\program files\microchip\xc16\v1.70\bin\bin\../..\support\generic\h/builtins.h:170:9: note: expected 'int *' but argument is of type 'int'
SinusoidalBLDC v1.2.c:1031:31: error: too few arguments to function '__builtin_mac'
Halting build on first failure as requested.
----------------------------------------------------------------------
Release build of project `D:\gong\program\DSPIC30F\AN1017_30F3010_V1\AN1017_30F3010_V1\AN1017.mcp' failed.
Language tool versions: xc16-as.exe v1.70, xc16-gcc.exe v1.70, xc16-ld.exe v1.70, xc16-ranlib.exe v1.70
Sat Aug 07 19:33:23 2021
----------------------------------------------------------------------
BUILD FAILED

使用特权

评论回复
5
郑朝清| | 2021-8-9 00:27 | 只看该作者
这是没定义数据类型

使用特权

评论回复
6
huquanz711| | 2021-8-9 07:41 | 只看该作者
又是一长串复制粘贴

使用特权

评论回复
7
CoolSilicon| | 2021-8-9 10:39 | 只看该作者
-mcpu=30F3010???
你现在用的是什么板子?用的是那么型号的芯片??
官网现在有很多不同版本的代码提供, 奈何你偏偏选了个最老的,还是用MPLAB IDE的环境..这倒如何是好呢?
https://www.microchip.com/en-us/application-notes/an1017

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

3

帖子

0

粉丝