打印
[PIC®/AVR®/dsPIC®产品]

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

[复制链接]
604|11
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
chenho|  楼主 | 2022-12-10 13:15 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

使用特权

评论回复
沙发
renyaq| | 2022-12-10 13:17 | 只看该作者
是不是缺少文件或头文件路径不对

使用特权

评论回复
板凳
chenho|  楼主 | 2022-12-10 13:20 | 只看该作者
//#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

使用特权

评论回复
地板
juventus9554| | 2022-12-10 13:22 | 只看该作者
这是没定义数据类型

使用特权

评论回复
5
supernan| | 2022-12-10 13:25 | 只看该作者
又是一长串复制粘贴

使用特权

评论回复
6
jiaxw| | 2022-12-10 13:29 | 只看该作者
-mcpu=30F3010???
你现在用的是什么板子?用的是那么型号的芯片??

使用特权

评论回复
7
zhanghqi| | 2022-12-10 13:31 | 只看该作者
官网现在有很多不同版本的代码提供, 奈何你偏偏选了个最老的,还是用MPLAB IDE的环境..这倒如何是好呢?

使用特权

评论回复
8
zhanghqi| | 2022-12-10 13:33 | 只看该作者

使用特权

评论回复
9
chenho|  楼主 | 2022-12-10 13:35 | 只看该作者

嗯,我再好好缕一缕吧,有了好消息及时通知大家

使用特权

评论回复
10
花似毒0315| | 2022-12-12 09:20 | 只看该作者

网址是多少可以分享一下吗

使用特权

评论回复
11
LOVEEVER| | 2022-12-24 15:42 | 只看该作者
版本比较老了,可以尝试官网的不同版本

使用特权

评论回复
12
小夏天的大西瓜| | 2022-12-25 12:11 | 只看该作者
是不是缺文件嘛,这种时候是不是就从头来一种办法啊

使用特权

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

本版积分规则

748

主题

9853

帖子

5

粉丝