极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12607|回复: 0

关于ALPHA D21G18A + BMP280气压传感器出现的编译错误

[复制链接]
发表于 2019-2-21 20:51:43 | 显示全部楼层 |阅读模式
求助大佬!!!
使用同样的i2c_BMP280示例程序,在ALPHA 8F328P-U上可以正常运行并读取气压等数据,在ALPHA D21G18A出现以下编译错误,外行水平!!!完全看不懂!!!求助!!!!!!!!

Arduino:0.1.3 (Mac OS X), 开发板:"Arduino/OCROBOT Zero (OCROBOT D21G18A)"

/Applications/OCROBOT_1.3.0.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware "/Applications/OCROBOT_1.3.0.app/Contents/Java/hardware" -hardware "/Users/chenzhiyun/Library/OcrobotPath/packages" -tools "/Applications/OCROBOT_1.3.0.app/Contents/Java/tools-builder" -tools "/Users/chenzhiyun/Library/OcrobotPath/packages" -built-in-libraries "/Applications/OCROBOT_1.3.0.app/Contents/Java/libraries" -libraries "/Users/chenzhiyun/Documents/Arduino/libraries" -fqbn=OCROBOT:samd:arduino_zero_native -ide-version=103 -build-path "/var/folders/rx/2tfnbjlj6sl4yxckm63v5jmc0000gn/T/build9537c2e0bc94a80cf35175cecd3a3edb.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "/Users/chenzhiyun/Documents/Arduino/libraries/I2C-Sensor-Lib_iLib/examples/i2c_BMP280/i2c_BMP280.ino"
/Applications/OCROBOT_1.3.0.app/Contents/Java/arduino-builder -compile -logger=machine -hardware "/Applications/OCROBOT_1.3.0.app/Contents/Java/hardware" -hardware "/Users/chenzhiyun/Library/OcrobotPath/packages" -tools "/Applications/OCROBOT_1.3.0.app/Contents/Java/tools-builder" -tools "/Users/chenzhiyun/Library/OcrobotPath/packages" -built-in-libraries "/Applications/OCROBOT_1.3.0.app/Contents/Java/libraries" -libraries "/Users/chenzhiyun/Documents/Arduino/libraries" -fqbn=OCROBOT:samd:arduino_zero_native -ide-version=103 -build-path "/var/folders/rx/2tfnbjlj6sl4yxckm63v5jmc0000gn/T/build9537c2e0bc94a80cf35175cecd3a3edb.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "/Users/chenzhiyun/Documents/Arduino/libraries/I2C-Sensor-Lib_iLib/examples/i2c_BMP280/i2c_BMP280.ino"
Using board 'arduino_zero_native' from platform in folder: /Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2
Using core 'arduino' from platform in folder: /Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2
Detecting libraries used...
/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++ -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=103 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804d -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Zero\"" -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/tools/CMSIS/4.0.0-atmel/CMSIS/Include/ -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/tools/CMSIS/4.0.0-atmel/Device/ATMEL/ -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/cores/arduino -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/variants/arduino_zero /var/folders/rx/2tfnbjlj6sl4yxckm63v5jmc0000gn/T/build9537c2e0bc94a80cf35175cecd3a3edb.tmp/sketch/i2c_BMP280.ino.cpp -o /dev/null
/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++ -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=103 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804d -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Zero\"" -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/tools/CMSIS/4.0.0-atmel/CMSIS/Include/ -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/tools/CMSIS/4.0.0-atmel/Device/ATMEL/ -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/cores/arduino -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/variants/arduino_zero -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/libraries/Wire /var/folders/rx/2tfnbjlj6sl4yxckm63v5jmc0000gn/T/build9537c2e0bc94a80cf35175cecd3a3edb.tmp/sketch/i2c_BMP280.ino.cpp -o /dev/null
/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++ -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=103 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804d -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Zero\"" -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/tools/CMSIS/4.0.0-atmel/CMSIS/Include/ -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/tools/CMSIS/4.0.0-atmel/Device/ATMEL/ -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/cores/arduino -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/variants/arduino_zero -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/libraries/Wire -I/Users/chenzhiyun/Documents/Arduino/libraries/I2C-Sensor-Lib_iLib/src /var/folders/rx/2tfnbjlj6sl4yxckm63v5jmc0000gn/T/build9537c2e0bc94a80cf35175cecd3a3edb.tmp/sketch/i2c_BMP280.ino.cpp -o /dev/null
/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++ -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=103 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804d -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Zero\"" -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/tools/CMSIS/4.0.0-atmel/CMSIS/Include/ -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/tools/CMSIS/4.0.0-atmel/Device/ATMEL/ -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/cores/arduino -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/variants/arduino_zero -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/libraries/Wire -I/Users/chenzhiyun/Documents/Arduino/libraries/I2C-Sensor-Lib_iLib/src /Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/libraries/Wire/Wire.cpp -o /dev/null
/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++ -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=103 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804d -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Zero\"" -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/tools/CMSIS/4.0.0-atmel/CMSIS/Include/ -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/tools/CMSIS/4.0.0-atmel/Device/ATMEL/ -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/cores/arduino -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/variants/arduino_zero -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/libraries/Wire -I/Users/chenzhiyun/Documents/Arduino/libraries/I2C-Sensor-Lib_iLib/src /Users/chenzhiyun/Documents/Arduino/libraries/I2C-Sensor-Lib_iLib/src/i2c.cpp -o /dev/null
Generating function prototypes...
/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++ -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=103 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804d -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Zero\"" -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/tools/CMSIS/4.0.0-atmel/CMSIS/Include/ -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/tools/CMSIS/4.0.0-atmel/Device/ATMEL/ -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/cores/arduino -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/variants/arduino_zero -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/libraries/Wire -I/Users/chenzhiyun/Documents/Arduino/libraries/I2C-Sensor-Lib_iLib/src /var/folders/rx/2tfnbjlj6sl4yxckm63v5jmc0000gn/T/build9537c2e0bc94a80cf35175cecd3a3edb.tmp/sketch/i2c_BMP280.ino.cpp -o /var/folders/rx/2tfnbjlj6sl4yxckm63v5jmc0000gn/T/build9537c2e0bc94a80cf35175cecd3a3edb.tmp/preproc/ctags_target_for_gcc_minus_e.cpp
/Applications/OCROBOT_1.3.0.app/Contents/Java/tools-builder/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /var/folders/rx/2tfnbjlj6sl4yxckm63v5jmc0000gn/T/build9537c2e0bc94a80cf35175cecd3a3edb.tmp/preproc/ctags_target_for_gcc_minus_e.cpp
正在编译项目...
/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++ -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD -DF_CPU=48000000L -DARDUINO=103 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804d -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino Zero\"" -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/tools/CMSIS/4.0.0-atmel/CMSIS/Include/ -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/tools/CMSIS/4.0.0-atmel/Device/ATMEL/ -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/cores/arduino -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/variants/arduino_zero -I/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/libraries/Wire -I/Users/chenzhiyun/Documents/Arduino/libraries/I2C-Sensor-Lib_iLib/src /var/folders/rx/2tfnbjlj6sl4yxckm63v5jmc0000gn/T/build9537c2e0bc94a80cf35175cecd3a3edb.tmp/sketch/i2c_BMP280.ino.cpp -o /var/folders/rx/2tfnbjlj6sl4yxckm63v5jmc0000gn/T/build9537c2e0bc94a80cf35175cecd3a3edb.tmp/sketch/i2c_BMP280.ino.cpp.o
In file included from /var/folders/rx/2tfnbjlj6sl4yxckm63v5jmc0000gn/T/build9537c2e0bc94a80cf35175cecd3a3edb.tmp/sketch/i2c_BMP280.ino.cpp:1:0:
/Users/chenzhiyun/Documents/Arduino/libraries/I2C-Sensor-Lib_iLib/src/i2c.h: In constructor 'WirePlus::WirePlus()':
/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/cores/arduino/Arduino.h:111:37: error: no match for 'operator|=' (operand types are '_EPortType' and 'long unsigned int')
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
                                     ^
/Users/chenzhiyun/Documents/Arduino/libraries/I2C-Sensor-Lib_iLib/src/i2c.h:70:5: note: in expansion of macro 'bitSet'
     bitSet(PORTC, 4);  // deactivate internal pull-ups for twi
     ^
/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/cores/arduino/Arduino.h:111:37: note: candidate is:
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
                                     ^
/Users/chenzhiyun/Documents/Arduino/libraries/I2C-Sensor-Lib_iLib/src/i2c.h:70:5: note: in expansion of macro 'bitSet'
     bitSet(PORTC, 4);  // deactivate internal pull-ups for twi
     ^
/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/cores/arduino/Arduino.h:111:37: note: operator|=(_EPortType&, long unsigned int) <built-in>
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
                                     ^
/Users/chenzhiyun/Documents/Arduino/libraries/I2C-Sensor-Lib_iLib/src/i2c.h:70:5: note: in expansion of macro 'bitSet'
     bitSet(PORTC, 4);  // deactivate internal pull-ups for twi
     ^
/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/cores/arduino/Arduino.h:111:37: note:   no known conversion for argument 1 from '_EPortType' to '_EPortType&'
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
                                     ^
/Users/chenzhiyun/Documents/Arduino/libraries/I2C-Sensor-Lib_iLib/src/i2c.h:70:5: note: in expansion of macro 'bitSet'
     bitSet(PORTC, 4);  // deactivate internal pull-ups for twi
     ^
/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/cores/arduino/Arduino.h:111:37: error: no match for 'operator|=' (operand types are '_EPortType' and 'long unsigned int')
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
                                     ^
/Users/chenzhiyun/Documents/Arduino/libraries/I2C-Sensor-Lib_iLib/src/i2c.h:71:5: note: in expansion of macro 'bitSet'
     bitSet(PORTC, 5);  // as per note from atmega8 manual pg167
     ^
/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/cores/arduino/Arduino.h:111:37: note: candidate is:
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
                                     ^
/Users/chenzhiyun/Documents/Arduino/libraries/I2C-Sensor-Lib_iLib/src/i2c.h:71:5: note: in expansion of macro 'bitSet'
     bitSet(PORTC, 5);  // as per note from atmega8 manual pg167
     ^
/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/cores/arduino/Arduino.h:111:37: note: operator|=(_EPortType&, long unsigned int) <built-in>
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
                                     ^
/Users/chenzhiyun/Documents/Arduino/libraries/I2C-Sensor-Lib_iLib/src/i2c.h:71:5: note: in expansion of macro 'bitSet'
     bitSet(PORTC, 5);  // as per note from atmega8 manual pg167
     ^
/Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/cores/arduino/Arduino.h:111:37: note:   no known conversion for argument 1 from '_EPortType' to '_EPortType&'
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
                                     ^
/Users/chenzhiyun/Documents/Arduino/libraries/I2C-Sensor-Lib_iLib/src/i2c.h:71:5: note: in expansion of macro 'bitSet'
     bitSet(PORTC, 5);  // as per note from atmega8 manual pg167
     ^
In file included from /Users/chenzhiyun/Documents/Arduino/libraries/I2C-Sensor-Lib_iLib/examples/i2c_BMP280/i2c_BMP280.ino:2:0:
/Users/chenzhiyun/Documents/Arduino/libraries/I2C-Sensor-Lib_iLib/src/i2c.h:73:5: error: 'TWBR' was not declared in this scope
     TWBR = ((F_CPU / 400000L) - 16) / 2; // see twi_init in Wire/utility/twi.c
     ^
使用 1.0  版本的库 Wire 在文件夹: /Users/chenzhiyun/Library/OcrobotPath/packages/OCROBOT/hardware/samd/0.0.2/libraries/Wire
使用 0.8.2  版本的库 I2C-Sensor-Lib_iLib 在文件夹: /Users/chenzhiyun/Documents/Arduino/libraries/I2C-Sensor-Lib_iLib
exit status 1
为开发板 Arduino/OCROBOT Zero (OCROBOT D21G18A) 编译时出错。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 需要先绑定手机号

Archiver|联系我们|极客工坊

GMT+8, 2024-3-29 07:59 , Processed in 0.045952 second(s), 18 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

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