上传GRBL 时出现编译错误-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 3287|回复: 6

[未解决] 上传GRBL 时出现编译错误

[复制链接]
发表于 2020-9-30 16:43 | 显示全部楼层 |阅读模式
本帖最后由 ink_chen 于 2020-9-30 17:26 编辑

刚接触Adiuno,请各位大神帮忙看看,谢谢!




Arduino:1.8.13 (Windows 10), 开发板:"Arduino Uno"

In file included from C:\Users\Administrator\Documents\Arduino\libraries\grbl/grbl.h:43:0,

                 from C:\Users\Administrator\Documents\Arduino\libraries\grbl\examples\grblUpload\grblUpload.ino:27:

C:\Users\Administrator\Documents\Arduino\libraries\grbl/nuts_bolts.h:56:0: warning: "max" redefined

#define max(a,b) (((a) > (b)) ? (a) : (b))



In file included from sketch\grblUpload.ino.cpp:1:0:

D:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:93:0: note: this is the location of the previous definition

#define max(a,b) ((a)>(b)?(a)b))



In file included from C:\Users\Administrator\Documents\Arduino\libraries\grbl/grbl.h:43:0,

                 from C:\Users\Administrator\Documents\Arduino\libraries\grbl\examples\grblUpload\grblUpload.ino:27:

C:\Users\Administrator\Documents\Arduino\libraries\grbl/nuts_bolts.h:57:0: warning: "min" redefined

#define min(a,b) (((a) < (b)) ? (a) : (b))



In file included from sketch\grblUpload.ino.cpp:1:0:

D:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:92:0: note: this is the location of the previous definition

#define min(a,b) ((a)<(b)?(a)b))



In file included from C:\Users\Administrator\Documents\Arduino\libraries\grbl/grbl.h:43:0,

                 from C:\Users\Administrator\Documents\Arduino\libraries\grbl\examples\grblUpload\grblUpload.ino:27:

C:\Users\Administrator\Documents\Arduino\libraries\grbl/nuts_bolts.h:61:0: warning: "bit" redefined

#define bit(n) (1 << n)



In file included from sketch\grblUpload.ino.cpp:1:0:

D:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:124:0: note: this is the location of the previous definition

#define bit(b) (1UL << (b))



In file included from C:\Users\Administrator\Documents\Arduino\libraries\grbl\grbl.h:47:0,

                 from C:\Users\Administrator\Documents\Arduino\libraries\grbl\coolant_control.c:21:

C:\Users\Administrator\Documents\Arduino\libraries\grbl\coolant_control.c: In function 'coolant_init':

C:\Users\Administrator\Documents\Arduino\libraries\grbl\cpu_map.h:81:31: error: 'DDRH' undeclared (first use in this function); did you mean 'DDRB'?

   #define COOLANT_FLOOD_DDR   DDRH

                               ^

C:\Users\Administrator\Documents\Arduino\libraries\grbl\coolant_control.c:26:3: note: in expansion of macro 'COOLANT_FLOOD_DDR'

   COOLANT_FLOOD_DDR |= (1 << COOLANT_FLOOD_BIT); // Configure as output pin.

   ^~~~~~~~~~~~~~~~~

C:\Users\Administrator\Documents\Arduino\libraries\grbl\cpu_map.h:81:31: note: each undeclared identifier is reported only once for each function it appears in

   #define COOLANT_FLOOD_DDR   DDRH

                               ^

C:\Users\Administrator\Documents\Arduino\libraries\grbl\coolant_control.c:26:3: note: in expansion of macro 'COOLANT_FLOOD_DDR'

   COOLANT_FLOOD_DDR |= (1 << COOLANT_FLOOD_BIT); // Configure as output pin.

   ^~~~~~~~~~~~~~~~~

In file included from C:\Users\Administrator\Documents\Arduino\libraries\grbl\grbl.h:43:0,

                 from C:\Users\Administrator\Documents\Arduino\libraries\grbl\coolant_control.c:21:

C:\Users\Administrator\Documents\Arduino\libraries\grbl\coolant_control.c: In function 'coolant_get_state':

C:\Users\Administrator\Documents\Arduino\libraries\grbl\cpu_map.h:82:31: error: 'PORTH' undeclared (first use in this function); did you mean 'PORT0'?

   #define COOLANT_FLOOD_PORT  PORTH

                               ^

C:\Users\Administrator\Documents\Arduino\libraries\grbl\nuts_bolts.h:64:30: note: in definition of macro 'bit_istrue'

#define bit_istrue(x,mask) ((x & mask) != 0)

                              ^

C:\Users\Administrator\Documents\Arduino\libraries\grbl\coolant_control.c:39:20: note: in expansion of macro 'COOLANT_FLOOD_PORT'

     if (bit_istrue(COOLANT_FLOOD_PORT,(1 << COOLANT_FLOOD_BIT))) {

                    ^~~~~~~~~~~~~~~~~~

In file included from C:\Users\Administrator\Documents\Arduino\libraries\grbl\grbl.h:47:0,

                 from C:\Users\Administrator\Documents\Arduino\libraries\grbl\coolant_control.c:21:

C:\Users\Administrator\Documents\Arduino\libraries\grbl\coolant_control.c: In function 'coolant_stop':

C:\Users\Administrator\Documents\Arduino\libraries\grbl\cpu_map.h:82:31: error: 'PORTH' undeclared (first use in this function); did you mean 'PORT0'?

   #define COOLANT_FLOOD_PORT  PORTH

                               ^

C:\Users\Administrator\Documents\Arduino\libraries\grbl\coolant_control.c:61:5: note: in expansion of macro 'COOLANT_FLOOD_PORT'

     COOLANT_FLOOD_PORT &= ~(1 << COOLANT_FLOOD_BIT);

     ^~~~~~~~~~~~~~~~~~

C:\Users\Administrator\Documents\Arduino\libraries\grbl\coolant_control.c: In function 'coolant_set_state':

C:\Users\Administrator\Documents\Arduino\libraries\grbl\cpu_map.h:82:31: error: 'PORTH' undeclared (first use in this function); did you mean 'PORT0'?

   #define COOLANT_FLOOD_PORT  PORTH

                               ^

C:\Users\Administrator\Documents\Arduino\libraries\grbl\coolant_control.c:83:7: note: in expansion of macro 'COOLANT_FLOOD_PORT'

       COOLANT_FLOOD_PORT |= (1 << COOLANT_FLOOD_BIT);

       ^~~~~~~~~~~~~~~~~~

exit status 1

为开发板 Arduino Uno 编译时出错。



在文件 -> 首选项开启
“编译过程中显示详细输出”选项
这份报告会包含更多信息。


 楼主| 发表于 2020-9-30 16:46 | 显示全部楼层
本帖最后由 ink_chen 于 2020-9-30 17:16 编辑



使用库 grbl 在文件夹: C:\Users\Administrator\Documents\Arduino\libraries\grbl (legacy)

exit status 1

为开发板 Arduino Uno 编译时出错。

 楼主| 发表于 2020-9-30 21:02 | 显示全部楼层
自己解决了,原因不知道。

只是重新找了好几个grbl,一一尝试,最后是一个208k的“grbl-master.zip”,解压后加载,然后上传成功了。
发表于 2020-9-30 21:17 | 显示全部楼层
ink_chen 发表于 2020-9-30 21:02
自己解决了,原因不知道。

只是重新找了好几个grbl,一一尝试,最后是一个208k的“grbl-master.zip”,解 ...

UNO没有DDRH寄存器的定义,所以编译报错
发表于 2020-12-27 18:03 | 显示全部楼层
请问 grbl 这个库在哪下的?
发表于 2020-12-27 18:22 | 显示全部楼层
  楼主| 发表于 2020-9-30 21:02 | 只看该作者
自己解决了,原因不知道。

只是重新找了好几个grbl,一一尝试,最后是一个208k的“grbl-master.zip”,解压后加载,然后上传成功了。
楼主 grbl-master.zip这的文件有吗?发我个。
发表于 2022-3-4 08:38 | 显示全部楼层
https://github.com/gnea/grbl/releases如果是在这个连接下载的,问题是出在哪个grblUpload.ino的文件,注释掉这些头文件引用就成了,因为grbl.h里头已经引用过了,grblUpload.ino不用引用
/*#include <config.h>
#include <coolant_control.h>
#include <cpu_map.h>
#include <defaults.h>
#include <eeprom.h>
#include <gcode.h>
#include <grbl.h>
#include <jog.h>
#include <limits.h>
#include <motion_control.h>
#include <nuts_bolts.h>
#include <planner.h>
#include <print.h>
#include <probe.h>
*/
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-11-28 13:35 , Processed in 0.089864 second(s), 15 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表