#include <Servo.h> results in a compile error for the Metro M4 Express
#include <Servo.h>int main(void) {}
What I've Tried
I have tried using the standard PlatformIO <Servo.h>. See logs below.
I have tried rebuilding the library from Adafruit's version. See logs below.
This same header compiles fine on the Arduino IDE with this BSP. Per this issue, the latest BSP has a working Servo library. See logs below.
Expected Outcome#include <Servo.h> compiles without error. PlatformIO matches the Arduino IDE in header support for Metro M4.
^~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:99:9: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'
99
WAIT_TC16_REGS_SYNC(tc)
^~~~~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp: In function 'void resetTC(Tc*)':
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::' has no member named 'SYNCBUSY'
44
^~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:116:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'
116
WAIT_TC16_REGS_SYNC(TCx)
^~~~~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp: In function 'void _initISR(Tc*, uint8_t, uint32_t, IRQn_Type, uint8_t, uint8_t)':
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:123:11: error: 'struct Gclk' has no member named 'CLKCTRL'
123
^~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:123:37: error: 'GCLK_CLKCTRL_CLKEN' was not declared in this scope; did you mean 'GCLK_CLKCTRL_IDs'?
123
GCLK_CLKCTRL_IDs
Compiling .pio/build/adafruit_metro_m4/FrameworkArduino/Print.cpp.o
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:123:58: error: 'GCLK_CLKCTRL_GEN_GCLK0' was not declared in this scope; did you mean 'GCLK_PCHCTRL_GEN_GCLK0'?
123
GCLK_PCHCTRL_GEN_GCLK0
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:123:83: error: 'GCLK_CLKCTRL_ID' was not declared in this scope; did you mean 'GCLK_CLKCTRL_IDs'?
123
GCLK_CLKCTRL_IDs
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:124:18: error: 'struct Gclk' has no member named 'STATUS'
124
while (GCLK->STATUS.bit.SYNCBUSY);
^~
In file included from /Users/adam2/.platformio/packages/framework-cmsis-atmel/CMSIS/Device/ATMEL/samd51/include/samd51.h:44,
from /Users/adam2/.platformio/packages/framework-cmsis-atmel/CMSIS/Device/ATMEL/samd.h:143,
from /Users/adam2/.platformio/packages/framework-cmsis-atmel/CMSIS/Device/ATMEL/sam.h:540,
from /Users/adam2/.platformio/packages/framework-arduino-samd-adafruit/cores/arduino/Arduino.h:48,
from /Users/adam2/.platformio/packages/framework-arduino-samd-adafruit/cores/arduino/Print.cpp:23:
/Users/adam2/.platformio/packages/framework-cmsis-atmel/CMSIS/Device/ATMEL/samd51/include/samd51j19a.h:525: warning: "LITTLE_ENDIAN" redefined
525
#define LITTLE_ENDIAN 1
In file included from /Users/adam2/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/sys/types.h:49,
from /Users/adam2/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/stdio.h:61,
from /Users/adam2/.platformio/packages/framework-arduino-samd-adafruit/cores/arduino/Print.cpp:20:
/Users/adam2/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/machine/endian.h:17: note: this is the location of the previous definition
17
#define LITTLE_ENDIAN _LITTLE_ENDIAN
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:134:30: error: 'TC_CTRLA_WAVEGEN_NPWM' was not declared in this scope; did you mean 'TCC_WAVE_WAVEGEN_NPWM'?
134 | tc->COUNT16.CTRLA.reg |= TC_CTRLA_WAVEGEN_NPWM;
| ^~~~~
| TCC_WAVE_WAVEGEN_NPWM
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::' has no member named 'SYNCBUSY'
44 | #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);
| ^~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:141:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'
141 | WAIT_TC16_REGS_SYNC(tc)
| ^~~~~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::' has no member named 'SYNCBUSY'
44 | #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);
| ^~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:145:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'
145 | WAIT_TC16_REGS_SYNC(tc)
| ^~~~~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::' has no member named 'SYNCBUSY'
44 | #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);
| ^~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:159:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'
159 | WAIT_TC16_REGS_SYNC(tc)
| ^~~~~~~
*** [.pio/build/adafruit_metro_m4/liba37/Servo/samd/Servo.cpp.o] Error 1
=========================================================== [FAILED] Took 2.86 seconds ===========================================================
Using Adafruit's Library
Per this forum, I download this .zip , renamed it to 'Servo', then copied it to my PlatformIO project's 'lib' folder.
Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/adafruit_metro_m4.html
PLATFORM: Atmel SAM (5.1.1) > Adafruit Metro M4
HARDWARE: SAMD51J19A 120MHz, 192KB RAM, 512KB Flash
DEBUG: Current (atmel-ice) External (atmel-ice, jlink)
PACKAGES:
framework-arduino-samd-adafruit 1.6.4
framework-cmsis 2.50400.181126 (5.4.0)
framework-cmsis-atmel 1.2.0
toolchain-gccarmnoneeabi 1.90301.200702 (9.3.1)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 13 compatible libraries
Scanning dependencies...
Dependency Graph
|-- 1.1.7
Building in release mode
Compiling .pio/build/adafruit_metro_m4/liba37/Servo/samd/Servo.cpp.o
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp: In function 'void Servo_Handler(timer16_Sequence_t, Tc, uint8_t, uint8_t)':
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::' has no member named 'SYNCBUSY'
44 | #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);
| ^~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:64:9: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'
64 | WAIT_TC16_REGS_SYNC(tc)
| ^~~~~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::' has no member named 'SYNCBUSY'
44 | #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);
| ^~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:81:9: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'
81 | WAIT_TC16_REGS_SYNC(tc)
| ^~~~~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::' has no member named 'SYNCBUSY'
44 | #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);
| ^~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:84:9: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'
84 | WAIT_TC16_REGS_SYNC(tc)
| ^~~~~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::' has no member named 'SYNCBUSY'
44 | #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);
| ^~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:91:9: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'
91 | WAIT_TC16_REGS_SYNC(tc)
| ^~~~~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::' has no member named 'SYNCBUSY'
44 | #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);
| ^~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:99:9: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'
99 | WAIT_TC16_REGS_SYNC(tc)
| ^~~~~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp: In function 'void resetTC(Tc)':
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::' has no member named 'SYNCBUSY'
44 | #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);
| ^~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:112:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'
112 | WAIT_TC16_REGS_SYNC(TCx)
| ^~~~~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::' has no member named 'SYNCBUSY'
44 | #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);
| ^~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:116:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'
116 | WAIT_TC16_REGS_SYNC(TCx)
| ^~~~~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp: In function 'void _initISR(Tc*, uint8_t, uint32_t, IRQn_Type, uint8_t, uint8_t)':
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:123:11: error: 'struct Gclk' has no member named 'CLKCTRL'
123 | GCLK->CLKCTRL.reg = (uint16_t) (GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_ID(gcmForTimer));
| ^~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:123:37: error: 'GCLK_CLKCTRL_CLKEN' was not declared in this scope; did you mean 'GCLK_CLKCTRL_IDs'?
123 | GCLK->CLKCTRL.reg = (uint16_t) (GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_ID(gcmForTimer));
| ^~~~~~
| GCLK_CLKCTRL_IDs
Archiving .pio/build/adafruit_metro_m4/libFrameworkArduinoVariant.a
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:123:58: error: 'GCLK_CLKCTRL_GEN_GCLK0' was not declared in this scope; did you mean 'GCLK_PCHCTRL_GEN_GCLK0'?
123 | GCLK->CLKCTRL.reg = (uint16_t) (GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_ID(gcmForTimer));
| ^~~~~~
| GCLK_PCHCTRL_GEN_GCLK0
Indexing .pio/build/adafruit_metro_m4/libFrameworkArduinoVariant.a
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:123:83: error: 'GCLK_CLKCTRL_ID' was not declared in this scope; did you mean 'GCLK_CLKCTRL_IDs'?
123 | GCLK->CLKCTRL.reg = (uint16_t) (GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_ID(gcmForTimer));
| ^~~~~~~
| GCLK_CLKCTRL_IDs
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:124:18: error: 'struct Gclk' has no member named 'STATUS'
124 | while (GCLK->STATUS.bit.SYNCBUSY);
| ^~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:134:30: error: 'TC_CTRLA_WAVEGEN_NPWM' was not declared in this scope; did you mean 'TCC_WAVE_WAVEGEN_NPWM'?
134 | tc->COUNT16.CTRLA.reg |= TC_CTRLA_WAVEGEN_NPWM;
| ^~~~~
| TCC_WAVE_WAVEGEN_NPWM
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::' has no member named 'SYNCBUSY'
44 | #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);
| ^~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:141:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'
141 | WAIT_TC16_REGS_SYNC(tc)
| ^~~~~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::' has no member named 'SYNCBUSY'
44 | #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);
| ^~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:145:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'
145 | WAIT_TC16_REGS_SYNC(tc)
| ^~~~~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::' has no member named 'SYNCBUSY'
44 | #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);
| ^~~~
.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:159:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'
159 | WAIT_TC16_REGS_SYNC(tc)
| ^~~~~~~
Compiling .pio/build/adafruit_metro_m4/FrameworkArduino/Reset.cpp.o
Compiling .pio/build/adafruit_metro_m4/FrameworkArduino/SERCOM.cpp.o
*** [.pio/build/adafruit_metro_m4/liba37/Servo/samd/Servo.cpp.o] Error 1
=========================================================== [FAILED] Took 2.15 seconds ===========================================================
Using Arduino IDE
Configured with this BSPLogs
Sketch uses 5584 bytes (1%) of program storage space. Maximum is 507904 bytes.
Device : ATSAMD51x19
Version : v1.1 [Arduino:XYZ] May 17 2020 17:56:35
Address : 0x0
Pages : 1024
Page Size : 512 bytes
Total Size : 512KB
Planes : 1
Lock Regions : 32
Locked : none
Security : false
BOD : false
BOR : true
Write 5616 bytes to flash (11 pages)
[==============================] 100% (11/11 pages)
Done in 0.079 seconds
Verify 5616 bytes of flash
[==============================] 100% (11/11 pages)
Verify successful
Done in 0.132 seconds
#include <Servo.h>
results in a compile error for the Metro M4 Express#include <Servo.h>
int main(void) {}
What I've Tried I have tried using the standard PlatformIO
<Servo.h>
. See logs below. I have tried rebuilding the library from Adafruit's version. See logs below. This same header compiles fine on the Arduino IDE with this BSP. Per this issue, the latest BSP has a working Servo library. See logs below.Expected Outcome
#include <Servo.h>
compiles without error. PlatformIO matches the Arduino IDE in header support for Metro M4.Using Standard Library Log
Processing adafruit_metro_m4 (platform: atmelsam; board: adafruit_metro_m4; framework: arduino)
Verbose mode can be enabled via
-v, --verbose
option CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/adafruit_metro_m4.html PLATFORM: Atmel SAM (5.1.1) > Adafruit Metro M4 HARDWARE: SAMD51J19A 120MHz, 192KB RAM, 512KB Flash DEBUG: Current (atmel-ice) External (atmel-ice, jlink) PACKAGES:~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:64:9: note: in expansion of macro 'WAIT_TC16_REGS_SYNC' 64~~~~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::~~~ .pio/libdeps/adafruit_metrCompiling .pio/build/adafruit_metro_m4/FrameworkArduino/IPAddress.cpp.o o_m4/Servo/src/samd/Servo.cpp:81:9: note: in expansion of macro 'WAIT_TC16_REGS_SYNC' 81~~~~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:84:9: note: in expansion of macro 'WAIT_TC16_REGS_SYNC' 84~~~~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:91:9: note: in expansion of macro 'WAIT_TC16_REGS_SYNC' 91~~~~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:99:9: note: in expansion of macro 'WAIT_TC16_REGS_SYNC' 99~~~~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp: In function 'void resetTC(Tc*)': .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:112:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC' 112~~~~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:116:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC' 116~~~~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp: In function 'void _initISR(Tc*, uint8_t, uint32_t, IRQn_Type, uint8_t, uint8_t)': .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:123:11: error: 'struct Gclk' has no member named 'CLKCTRL' 123~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:123:37: error: 'GCLK_CLKCTRL_CLKEN' was not declared in this scope; did you mean 'GCLK_CLKCTRL_IDs'? 123~~~~~~~~~~~~~~~~~In file included from /Users/adam2/.platformio/packages/framework-cmsis-atmel/CMSIS/Device/ATMEL/samd51/include/samd51.h:44, from /Users/adam2/.platformio/packages/framework-cmsis-atmel/CMSIS/Device/ATMEL/samd.h:143, from /Users/adam2/.platformio/packages/framework-cmsis-atmel/CMSIS/Device/ATMEL/sam.h:540, from /Users/adam2/.platformio/packages/framework-arduino-samd-adafruit/cores/arduino/Arduino.h:48, from /Users/adam2/.platformio/packages/framework-arduino-samd-adafruit/cores/arduino/Print.cpp:23: /Users/adam2/.platformio/packages/framework-cmsis-atmel/CMSIS/Device/ATMEL/samd51/include/samd51j19a.h:525: warning: "LITTLE_ENDIAN" redefined 525.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:134:30: error: 'TC_CTRLA_WAVEGEN_NPWM' was not declared in this scope; did you mean 'TCC_WAVE_WAVEGEN_NPWM'? 134 | tc->COUNT16.CTRLA.reg |= TC_CTRLA_WAVEGEN_NPWM; | ^' has no member named 'SYNCBUSY'
44 | #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);
| ^' has no member named 'SYNCBUSY'
44 | #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);
| ^' has no member named 'SYNCBUSY'
44 | #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);
| ^
~~~~| TCC_WAVE_WAVEGEN_NPWM .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:141:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC' 141 | WAIT_TC16_REGS_SYNC(tc) | ^~~~~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:145:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC' 145 | WAIT_TC16_REGS_SYNC(tc) | ^~~~~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:159:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC' 159 | WAIT_TC16_REGS_SYNC(tc) | ^~~~~~~ *** [.pio/build/adafruit_metro_m4/liba37/Servo/samd/Servo.cpp.o] Error 1 =========================================================== [FAILED] Took 2.86 seconds ===========================================================Using Adafruit's Library
Per this forum, I download this .zip , renamed it to 'Servo', then copied it to my PlatformIO project's 'lib' folder.
Log
Processing adafruit_metro_m4 (platform: atmelsam; board: adafruit_metro_m4; framework: arduino)
Verbose mode can be enabled via
-v, --verbose
option CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/adafruit_metro_m4.html PLATFORM: Atmel SAM (5.1.1) > Adafruit Metro M4 HARDWARE: SAMD51J19A 120MHz, 192KB RAM, 512KB Flash DEBUG: Current (atmel-ice) External (atmel-ice, jlink) PACKAGES:~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:64:9: note: in expansion of macro 'WAIT_TC16_REGS_SYNC' 64 | WAIT_TC16_REGS_SYNC(tc) | ^~~~~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:81:9: note: in expansion of macro 'WAIT_TC16_REGS_SYNC' 81 | WAIT_TC16_REGS_SYNC(tc) | ^~~~~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:84:9: note: in expansion of macro 'WAIT_TC16_REGS_SYNC' 84 | WAIT_TC16_REGS_SYNC(tc) | ^~~~~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:91:9: note: in expansion of macro 'WAIT_TC16_REGS_SYNC' 91 | WAIT_TC16_REGS_SYNC(tc) | ^~~~~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:99:9: note: in expansion of macro 'WAIT_TC16_REGS_SYNC' 99 | WAIT_TC16_REGS_SYNC(tc) | ^~~~~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp: In function 'void resetTC(Tc~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:112:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC' 112 | WAIT_TC16_REGS_SYNC(TCx) | ^~~~~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:116:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC' 116 | WAIT_TC16_REGS_SYNC(TCx) | ^~~~~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp: In function 'void _initISR(Tc*, uint8_t, uint32_t, IRQn_Type, uint8_t, uint8_t)': .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:123:11: error: 'struct Gclk' has no member named 'CLKCTRL' 123 | GCLK->CLKCTRL.reg = (uint16_t) (GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_ID(gcmForTimer)); | ^~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:123:37: error: 'GCLK_CLKCTRL_CLKEN' was not declared in this scope; did you mean 'GCLK_CLKCTRL_IDs'? 123 | GCLK->CLKCTRL.reg = (uint16_t) (GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_ID(gcmForTimer)); | ^~~~~~ | GCLK_CLKCTRL_IDs Archiving .pio/build/adafruit_metro_m4/libFrameworkArduinoVariant.a .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:123:58: error: 'GCLK_CLKCTRL_GEN_GCLK0' was not declared in this scope; did you mean 'GCLK_PCHCTRL_GEN_GCLK0'? 123 | GCLK->CLKCTRL.reg = (uint16_t) (GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_ID(gcmForTimer)); | ^~~~~~ | GCLK_PCHCTRL_GEN_GCLK0 Indexing .pio/build/adafruit_metro_m4/libFrameworkArduinoVariant.a .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:123:83: error: 'GCLK_CLKCTRL_ID' was not declared in this scope; did you mean 'GCLK_CLKCTRL_IDs'? 123 | GCLK->CLKCTRL.reg = (uint16_t) (GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_ID(gcmForTimer)); | ^~~~~~~ | GCLK_CLKCTRL_IDs .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:124:18: error: 'struct Gclk' has no member named 'STATUS' 124 | while (GCLK->STATUS.bit.SYNCBUSY); | ^~.pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:134:30: error: 'TC_CTRLA_WAVEGEN_NPWM' was not declared in this scope; did you mean 'TCC_WAVE_WAVEGEN_NPWM'? 134 | tc->COUNT16.CTRLA.reg |= TC_CTRLA_WAVEGEN_NPWM; | ^~~~~| TCC_WAVE_WAVEGEN_NPWM .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:141:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC' 141 | WAIT_TC16_REGS_SYNC(tc) | ^~~~~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:145:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC' 145 | WAIT_TC16_REGS_SYNC(tc) | ^~~~~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::~~~ .pio/libdeps/adafruit_metro_m4/Servo/src/samd/Servo.cpp:159:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC' 159 | WAIT_TC16_REGS_SYNC(tc) | ^~~~~~~ Compiling .pio/build/adafruit_metro_m4/FrameworkArduino/Reset.cpp.o Compiling .pio/build/adafruit_metro_m4/FrameworkArduino/SERCOM.cpp.o *** [.pio/build/adafruit_metro_m4/liba37/Servo/samd/Servo.cpp.o] Error 1 =========================================================== [FAILED] Took 2.15 seconds ===========================================================Using Arduino IDE Configured with this BSP Logs Sketch uses 5584 bytes (1%) of program storage space. Maximum is 507904 bytes. Device : ATSAMD51x19 Version : v1.1 [Arduino:XYZ] May 17 2020 17:56:35 Address : 0x0 Pages : 1024 Page Size : 512 bytes Total Size : 512KB Planes : 1 Lock Regions : 32 Locked : none Security : false BOD : false BOR : true Write 5616 bytes to flash (11 pages) [==============================] 100% (11/11 pages) Done in 0.079 seconds Verify 5616 bytes of flash [==============================] 100% (11/11 pages) Verify successful Done in 0.132 seconds