Error Compiling for board Seeed XIAO BLE Sense

Hi everybody, I try to control servo motor with seeed xiao, but there is an error when I compile the example servo code using Arduino IDE 1.8.10. The operation system is Ubuntu 18.04. The code is :

#include <Servo.h>

Servo myservo;  // create servo object to control a servo
// twelve servo objects can be created on most boards

int pos = 0;    // variable to store the servo position

void setup() {
  myservo.attach(4);  // attaches the servo on pin 9 to the servo object
}

void loop() {
  for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
    // in steps of 1 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15 ms for the servo to reach the position
  }
  for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15 ms for the servo to reach the position
  }
}

And the error message:

Arduino: 1.8.10 (Linux), Board: "Seeed XIAO BLE Sense - nRF52840"

/home/nano/Arduino/libraries/Servo/src/nrf52/Servo.cpp: In member function 'void Servo::writeMicroseconds(int)':
/home/nano/Arduino/libraries/Servo/src/nrf52/Servo.cpp:92:33: error: invalid use of incomplete type 'PinDescription {aka struct _PinDescription}'
  instance=(g_APinDescription[pin].ulPWMChannel & 0xF0)/16;
                                 ^
In file included from /home/nano/Arduino/libraries/Servo/src/nrf52/Servo.cpp:21:0:
/home/nano/.arduino15/packages/Seeeduino/hardware/nrf52/2.6.1/cores/arduino/Arduino.h:80:16: note: forward declaration of 'PinDescription {aka struct _PinDescription}'
 typedef struct _PinDescription PinDescription;

                ^~~~~~~~~~~~~~~
/home/nano/Arduino/libraries/Servo/src/nrf52/Servo.cpp:94:31: error: invalid use of incomplete type 'PinDescription {aka struct _PinDescription}'
  channel=g_APinDescription[pin].ulPWMChannel & 0x0F;
                               ^
In file included from /home/nano/Arduino/libraries/Servo/src/nrf52/Servo.cpp:21:0:
/home/nano/.arduino15/packages/Seeeduino/hardware/nrf52/2.6.1/cores/arduino/Arduino.h:80:16: note: forward declaration of 'PinDescription {aka struct _PinDescription}'
 typedef struct _PinDescription PinDescription;

                ^~~~~~~~~~~~~~~
/home/nano/Arduino/libraries/Servo/src/nrf52/Servo.cpp:95:53: error: invalid use of incomplete type 'PinDescription {aka struct _PinDescription}'
  group_pins[instance][channel]=g_APinDescription[pin].ulPin;
                                                     ^
In file included from /home/nano/Arduino/libraries/Servo/src/nrf52/Servo.cpp:21:0:
/home/nano/.arduino15/packages/Seeeduino/hardware/nrf52/2.6.1/cores/arduino/Arduino.h:80:16: note: forward declaration of 'PinDescription {aka struct _PinDescription}'
 typedef struct _PinDescription PinDescription;

                ^~~~~~~~~~~~~~~
/home/nano/Arduino/libraries/Servo/src/nrf52/Servo.cpp: In member function 'int Servo::readMicroseconds()':
/home/nano/Arduino/libraries/Servo/src/nrf52/Servo.cpp:123:33: error: invalid use of incomplete type 'PinDescription {aka struct _PinDescription}'
  instance=(g_APinDescription[pin].ulPWMChannel & 0xF0)/16;
                                 ^
In file included from /home/nano/Arduino/libraries/Servo/src/nrf52/Servo.cpp:21:0:
/home/nano/.arduino15/packages/Seeeduino/hardware/nrf52/2.6.1/cores/arduino/Arduino.h:80:16: note: forward declaration of 'PinDescription {aka struct _PinDescription}'
 typedef struct _PinDescription PinDescription;

                ^~~~~~~~~~~~~~~
/home/nano/Arduino/libraries/Servo/src/nrf52/Servo.cpp:124:31: error: invalid use of incomplete type 'PinDescription {aka struct _PinDescription}'
  channel=g_APinDescription[pin].ulPWMChannel & 0x0F;
                               ^
In file included from /home/nano/Arduino/libraries/Servo/src/nrf52/Servo.cpp:21:0:
/home/nano/.arduino15/packages/Seeeduino/hardware/nrf52/2.6.1/cores/arduino/Arduino.h:80:16: note: forward declaration of 'PinDescription {aka struct _PinDescription}'
 typedef struct _PinDescription PinDescription;

                ^~~~~~~~~~~~~~~
Multiple libraries were found for "Servo.h"
 Used: /home/nano/Arduino/libraries/Servo
 Not used: /home/nano/Downloads/arduino-1.8.10/libraries/Servo
exit status 1
Error compiling for board Seeed XIAO BLE Sense - nRF52840.

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

If somebody can help me, I would be very appreciate for that.

I added your code into my Arduino IDE on Windows and the same errors showed up. I have XIAO BLE Sense 1.0 version (Adafruit) of the board installed. May be try to switch over to version 2.61. (Mbed) and see.

If that’s not it, my guess is that there is some sort of a configuration error because the proper servo libraries are not used or found…

Thanks for your suggestions. My board version is 2.6.1 and I can successfully compile the code in file/examples/basic/blink. I also think the servo libraries have some bugs. Perhaps this library do not support this board.

Here is another similar problem:
Nano 33 BLE + Servo library will not compile - Nano Family / Nano 33 BLE - Arduino Forum