Timer driven interrupt on SAMD51

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I need to call an interrupt routine every 50 µs. The following code was written for the SAMD21 but does not compile for the SAMD51. This is code to be run on the Adafruit Metro M4. I'm not really sure how it works. It's based on something I found in the Arduino Zero forum. Any help you can provide would be deeply appreciated.

 

 

void initializeSAMD51timerInterrupt(void) {
  GCLK->CLKCTRL.reg = (uint16_t)(GCLK_CLKCTRL_CLKEN | 
                      GCLK_CLKCTRL_GEN_GCLK0 | 
                      GCLK_CLKCTRL_ID(IR_GCM));
  syncGCLK;
  IR_TCx->COUNT16.CTRLA.reg &= ~TC_CTRLA_ENABLE;
  syncTC;
  IR_TCx->COUNT16.CTRLA.reg = TC_CTRLA_SWRST;
  while (IR_TCx->COUNT16.CTRLA.bit.SWRST);
  IR_TCx->COUNT16.CTRLA.reg |= TC_CTRLA_MODE_COUNT16;
  IR_TCx->COUNT16.CTRLA.reg |= TC_CTRLA_WAVEGEN_MFRQ;
  IR_TCx->COUNT16.CC[0].reg = F_CPU/(1000000/USEC_PER_TICK) - 1;
  syncTC;
}

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So I can tell you what it is supposed to be doing... If you share the specific error messages, I may even be able to help 'fix' it.  It also seems to be missing some parts.

Since i do not recognize the macro names, i assume that there are headers needed and it may be best to start from scratch.

 

The first line is telling it to drive the timer from General Clock 0 (CPU clock) and enable the peripheral clock.

The second line accounts for the need to synchronize between different clocks in the chip before using the changed value.

The third line disables the timer and the fourth synchronizes.

The fifth resets the timer settings and the sixth sync's.

The seventh and eighth tell it to be in 16 bit mode and generate a frequency.

The ninth tells it the value to counto to, which is intended to get 50us as a number of CPU ticks.  EG 48MHz/(1MHz/50)-1 = 2399...

The last line sync's.

 

What is missing - even if it did compile - are:

IR_TCx->COUNT16.INTENSET.bit.MC0 = 1; // enable an interrupt on match condition 1

IR_TCx->COUNT16.CTRLA.bit.ENABLE = 1;

 

and an interrupt handler:

void TC0_Handler()
{
	static volatile uint32_t count = 0;
	count++;
	if (TC0->COUNT8.INTFLAG.bit.MC0)
	{
		#if TC0_ISR_RESET
			REG_TC0_INTFLAG = TC_INTFLAG_MC0;
		#endif
		#if TOGGLE_TEST_ON_ISR
			((Port *)PORT)->Group[TEST_PIN_PORT].OUTTGL.reg = 1<<TEST_PIN_BIT;
		#endif
	}
}

 

jeff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I apologize. I should have provided more detail and context. I've expanded out some of the macros. Here's a revised code.

 

#define IR_TCx   TC3
#define IR_GCM   GCM_TCC2_TC3
#define IR_RECV_INTR_NAME void TC3_Handler()
#define IR_IRQ   TC3_IRQn
void initializeSAMD51timerInterrupt(void) {
  GCLK->CLKCTRL.reg = (uint16_t)(GCLK_CLKCTRL_CLKEN | 
                      GCLK_CLKCTRL_GEN_GCLK0 | 
                      GCLK_CLKCTRL_ID(IR_GCM));
  while (GCLK->STATUS.bit.SYNCBUSY)
  IR_TCx->COUNT16.CTRLA.reg &= ~TC_CTRLA_ENABLE;
  while (IR_TCx->COUNT16.STATUS.bit.SYNCBUSY)
  IR_TCx->COUNT16.CTRLA.reg = TC_CTRLA_SWRST;
  while (IR_TCx->COUNT16.CTRLA.bit.SWRST);
  IR_TCx->COUNT16.CTRLA.reg |= TC_CTRLA_MODE_COUNT16;
  IR_TCx->COUNT16.CTRLA.reg |= TC_CTRLA_WAVEGEN_MFRQ;
  IR_TCx->COUNT16.CC[0].reg = 120000000/(1000000/50) - 1;
  while (IR_TCx->COUNT16.STATUS.bit.SYNCBUSY)
}

The above code is supposed to generate an interrupt every 50 µs. It just initializes. The following macros are used to turn the interrupts off and on.

#define IR_RECV_ENABLE_INTR ({NVIC_EnableIRQ(IR_IRQ);\
    IR_TCx->COUNT16.INTENSET.reg = TC_INTENSET_OVF;\
    IR_TCx->COUNT16.CTRLA.reg |= TC_CTRLA_ENABLE; syncTC;})
#define IR_RECV_DISABLE_INTR  IR_TCx->COUNT16.INTENCLR.reg = TC_INTENCLR_OVF;  

Here are some error messages

Arduino: 1.8.5 (Windows 10), Board: "Adafruit Metro M4 (SAMD51)"

C:\Users\Chris.cy\Documents\Arduino\libraries\IRLibProtocols\IRLibSAMD51.cpp: In function 'void initializeSAMD51timerInterrupt()':

C:\Users\Chris.cy\Documents\Arduino\libraries\IRLibProtocols\IRLibSAMD51.cpp:95:9: error: 'struct Gclk' has no member named 'CLKCTRL'

   GCLK->CLKCTRL.reg = (uint16_t)(GCLK_CLKCTRL_CLKEN | 

         ^

C:\Users\Chris.cy\Documents\Arduino\libraries\IRLibProtocols\IRLibSAMD51.cpp:95:34: error: 'GCLK_CLKCTRL_CLKEN' was not declared in this scope

   GCLK->CLKCTRL.reg = (uint16_t)(GCLK_CLKCTRL_CLKEN | 

                                  ^

C:\Users\Chris.cy\Documents\Arduino\libraries\IRLibProtocols\IRLibSAMD51.cpp:96:23: error: 'GCLK_CLKCTRL_GEN_GCLK0' was not declared in this scope

                       GCLK_CLKCTRL_GEN_GCLK0 | 

                       ^

C:\Users\Chris.cy\Documents\Arduino\libraries\IRLibProtocols\IRLibSAMD51.cpp:97:45: error: 'GCLK_CLKCTRL_ID' was not declared in this scope

                       GCLK_CLKCTRL_ID(IR_GCM));

                                             ^

C:\Users\Chris.cy\Documents\Arduino\libraries\IRLibProtocols\IRLibSAMD51.cpp:98:16: error: 'struct Gclk' has no member named 'STATUS'

   while (GCLK->STATUS.bit.SYNCBUSY);

                ^

C:\Users\Chris.cy\Documents\Arduino\libraries\IRLibProtocols\IRLibSAMD51.cpp:100:37: error: 'volatile struct TC_STATUS_Type::<anonymous>' has no member named 'SYNCBUSY'

   while (IR_TCx->COUNT16.STATUS.bit.SYNCBUSY);

                                     ^

C:\Users\Chris.cy\Documents\Arduino\libraries\IRLibProtocols\IRLibSAMD51.cpp:104:32: error: 'TC_CTRLA_WAVEGEN_MFRQ' was not declared in this scope

   IR_TCx->COUNT16.CTRLA.reg |= TC_CTRLA_WAVEGEN_MFRQ;

                                ^

C:\Users\Chris.cy\Documents\Arduino\libraries\IRLibProtocols\IRLibSAMD51.cpp:106:37: error: 'volatile struct TC_STATUS_Type::<anonymous>' has no member named 'SYNCBUSY'

   while (IR_TCx->COUNT16.STATUS.bit.SYNCBUSY);

                                     ^

exit status 1
Error compiling for board Adafruit Metro M4 (SAMD51).

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"error: 'struct Gclk' has no member named 'CLKCTRL'"

In the 51, the register bits for the GCLK source and PCLK target are separated:

GCLK->GENCTRL->bit.GENEN = 1;
GCLK->GENCTRL->bit.SRC = 1;

 

GCLK.PCHCTRL->bit.CHEN = 1;
GCLK.PCHCTRL->bit.GEN = 'gclk source, e.g. 0';

 

SYNCBUSY is it's own register now:

GCLK->SYNCBUSY. ...

TC3->COUNT16.SYNCBUSY. ...

 

and so is WAVE:

TC0->COUNT16.WAVE.bit.WAVEGEN = TC_WAVE_WAVEGEN_MFRQ;

 

As much as it pains me to admit - I prefer datasheets and direct register control - this is why they like us to use high level, abstract API's.

 

 

 

 

 

jeff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I hate to be such a noob but I still don't know what I need to do with the first line that deals with the GCLK because I still don't have a clear understanding of what that line does.

I thought I understood what you were saying about the SYNCBUSY registers but apparently I didn't understand that either.

Here is the latest version of the code and the latest error messages. Of course I made no changes to that first-line so I didn't expect it to be any different. But I'm not sure how the "while" statements are supposed to be.

 

void initializeSAMD51timerInterrupt(void) {
  GCLK->CLKCTRL.reg = (uint16_t)(GCLK_CLKCTRL_CLKEN | 
                      GCLK_CLKCTRL_GEN_GCLK0 | 
                      GCLK_CLKCTRL_ID(IR_GCM));
  while (GCLK->SYNCBUSY);
  IR_TCx->COUNT16.CTRLA.reg &= ~TC_CTRLA_ENABLE;
  while (IR_TCx->SYNCBUSY);
  IR_TCx->COUNT16.CTRLA.reg = TC_CTRLA_SWRST;
  while (IR_TCx->COUNT16.CTRLA.bit.SWRST);
  IR_TCx->COUNT16.CTRLA.reg |= TC_CTRLA_MODE_COUNT16;
  IR_TCx->COUNT16.CTRLA.reg |= TC_CTRLA_WAVEGEN_MFRQ;
  IR_TCx->COUNT16.CC[0].reg = F_CPU/(1000000/USEC_PER_TICK) - 1;
  while (IR_TCx->SYNCBUSY);
}

Arduino: 1.8.5 (Windows 10), Board: "Adafruit Metro M4 (SAMD51)"

C:\Users\Chris.cy\Documents\Arduino\libraries\IRLibProtocols\IRLibSAMD51.cpp: In function 'void initializeSAMD51timerInterrupt()':

C:\Users\Chris.cy\Documents\Arduino\libraries\IRLibProtocols\IRLibSAMD51.cpp:95:9: error: 'struct Gclk' has no member named 'CLKCTRL'

   GCLK->CLKCTRL.reg = (uint16_t)(GCLK_CLKCTRL_CLKEN | 

         ^

C:\Users\Chris.cy\Documents\Arduino\libraries\IRLibProtocols\IRLibSAMD51.cpp:95:34: error: 'GCLK_CLKCTRL_CLKEN' was not declared in this scope

   GCLK->CLKCTRL.reg = (uint16_t)(GCLK_CLKCTRL_CLKEN | 

                                  ^

C:\Users\Chris.cy\Documents\Arduino\libraries\IRLibProtocols\IRLibSAMD51.cpp:96:23: error: 'GCLK_CLKCTRL_GEN_GCLK0' was not declared in this scope

                       GCLK_CLKCTRL_GEN_GCLK0 | 

                       ^

C:\Users\Chris.cy\Documents\Arduino\libraries\IRLibProtocols\IRLibSAMD51.cpp:97:45: error: 'GCLK_CLKCTRL_ID' was not declared in this scope

                       GCLK_CLKCTRL_ID(IR_GCM));

                                             ^

C:\Users\Chris.cy\Documents\Arduino\libraries\IRLibProtocols\IRLibSAMD51.cpp:98:16: error: could not convert '1073748992u->Gclk::SYNCBUSY' from 'volatile GCLK_SYNCBUSY_Type' to 'bool'

   while (GCLK->SYNCBUSY);

                ^

C:\Users\Chris.cy\Documents\Arduino\libraries\IRLibProtocols\IRLibSAMD51.cpp:100:18: error: 'union Tc' has no member named 'SYNCBUSY'

   while (IR_TCx->SYNCBUSY);

                  ^

C:\Users\Chris.cy\Documents\Arduino\libraries\IRLibProtocols\IRLibSAMD51.cpp:104:32: error: 'TC_CTRLA_WAVEGEN_MFRQ' was not declared in this scope

   IR_TCx->COUNT16.CTRLA.reg |= TC_CTRLA_WAVEGEN_MFRQ;

                                ^

C:\Users\Chris.cy\Documents\Arduino\libraries\IRLibProtocols\IRLibSAMD51.cpp:106:18: error: 'union Tc' has no member named 'SYNCBUSY'

   while (IR_TCx->SYNCBUSY);

                  ^

exit status 1
Error compiling for board Adafruit Metro M4 (SAMD51).

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Might not make sense to try to get this to compile without knowing what it is supposed to do but you can look at some D51 GCLK setup code in this thread:

https://community.atmel.com/foru...

/Lars

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was struggling with setting up an interrupt service routine (ISR) timer on a SAMD51 as well on an Adafruit M4 Feather Express board. I have made a library which can be used for this. The method names are identical to the ZeroTimer library for M0 boards (SAMD21) such that it is easy to port from SAMD21 to SAMD51.

 

See GitHub: https://github.com/Dennis-van-Gi...

 

Usage:

#include <Arduino.h>
#include "SAMD51_InterruptTimer.h"

void myISR() {
  // Your code
}

void setup() {
  TC.startTimer(50, myISR); // Call myISR() every 50 usec
}

 

Have fun,

Dennis

Last Edited: Mon. Feb 11, 2019 - 07:38 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

 

I think I have very similar problems with my Adafruit M4 as well.

 

I've tried using the basic Servo library but it pops up a bunch of error messages you can see below.

 

How should I correct it to be able to use the servo library?

 

 

 

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp: In function 'void Servo_Handler(timer16_Sequence_t, Tc*, uint8_t, uint8_t)':

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::<anonymous>' has no member named 'SYNCBUSY'

 #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);

                                                            ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:64:9: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'

         WAIT_TC16_REGS_SYNC(tc)

         ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::<anonymous>' has no member named 'SYNCBUSY'

 #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);

                                                            ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:81:9: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'

         WAIT_TC16_REGS_SYNC(tc)

         ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::<anonymous>' has no member named 'SYNCBUSY'

 #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);

                                                            ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:84:9: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'

         WAIT_TC16_REGS_SYNC(tc)

         ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::<anonymous>' has no member named 'SYNCBUSY'

 #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);

                                                            ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:91:9: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'

         WAIT_TC16_REGS_SYNC(tc)

         ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::<anonymous>' has no member named 'SYNCBUSY'

 #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);

                                                            ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:99:9: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'

         WAIT_TC16_REGS_SYNC(tc)

         ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp: In function 'void resetTC(Tc*)':

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::<anonymous>' has no member named 'SYNCBUSY'

 #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);

                                                            ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:112:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'

     WAIT_TC16_REGS_SYNC(TCx)

     ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::<anonymous>' has no member named 'SYNCBUSY'

 #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);

                                                            ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:116:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'

     WAIT_TC16_REGS_SYNC(TCx)

     ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp: In function 'void _initISR(Tc*, uint8_t, uint32_t, IRQn_Type, uint8_t, uint8_t)':

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:123:11: error: 'struct Gclk' has no member named 'CLKCTRL'

     GCLK->CLKCTRL.reg = (uint16_t) (GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_ID(gcmForTimer));

           ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:123:37: error: 'GCLK_CLKCTRL_CLKEN' was not declared in this scope

     GCLK->CLKCTRL.reg = (uint16_t) (GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_ID(gcmForTimer));

                                     ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:123:58: error: 'GCLK_CLKCTRL_GEN_GCLK0' was not declared in this scope

     GCLK->CLKCTRL.reg = (uint16_t) (GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_ID(gcmForTimer));

                                                          ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:123:110: error: 'GCLK_CLKCTRL_ID' was not declared in this scope

     GCLK->CLKCTRL.reg = (uint16_t) (GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_ID(gcmForTimer));

                                                                                                              ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:124:18: error: 'struct Gclk' has no member named 'STATUS'

     while (GCLK->STATUS.bit.SYNCBUSY);

                  ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:134:30: error: 'TC_CTRLA_WAVEGEN_NPWM' was not declared in this scope

     tc->COUNT16.CTRLA.reg |= TC_CTRLA_WAVEGEN_NPWM;

                              ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::<anonymous>' has no member named 'SYNCBUSY'

 #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);

                                                            ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:141:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'

     WAIT_TC16_REGS_SYNC(tc)

     ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::<anonymous>' has no member named 'SYNCBUSY'

 #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);

                                                            ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:145:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'

     WAIT_TC16_REGS_SYNC(tc)

     ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:44:60: error: 'volatile struct TC_STATUS_Type::<anonymous>' has no member named 'SYNCBUSY'

 #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY);

                                                            ^

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo\src\samd\Servo.cpp:159:5: note: in expansion of macro 'WAIT_TC16_REGS_SYNC'

     WAIT_TC16_REGS_SYNC(tc)

     ^

Using library Servo at version 1.1.3 in folder: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo 
exit status 1
Error compiling for board Adafruit Feather M4 Express (SAMD51).

 

Thank you in advance!