Firmata Boards.h definition for XIAO SAMD21

Hey all,

I wanted to play with Firmata but there is no board definition for SAMD21 or XIAO.

I tried to write my own, which allows it to compile but when I try to connect with my test script, it cannot connect over serial.

Here is my board def.

Arduino/libraries/Firmata/Boards.h

// XIAO SAMD21          
#elif defined(SEEED_XIAO_M0)    
#define TOTAL_ANALOG_PINS       11
#define TOTAL_PINS              17 // 8 digital + 3 spi + 2 i2c + 2 uart + 7 analog
#define IS_PIN_DIGITAL(p)       ((p) >= 0 && (p) <= 17)
#define IS_PIN_ANALOG(p)        ((p) >= 0 && (p) <= 10 + TOTAL_ANALOG_PINS)
#define IS_PIN_PWM(p)           digitalPinHasPWM(p)
#define IS_PIN_SERVO(p)         (IS_PIN_DIGITAL(p) && (p) < MAX_SERVOS) // deprecated since v2.4
#define IS_PIN_I2C(p)           ((p) == 4 || (p) == 5) // SDA = 11, SCL = 12
#define IS_PIN_SPI(p)           ((p) == SS || (p) == MOSI || (p) == MISO || (p) == SCK)
#define IS_PIN_SERIAL(p)        ((7) == PIN_SERIAL1_RX || (6) == PIN_SERIAL1_TX) //defined in variant.h  RX = 13, TX = 14
#define PIN_TO_DIGITAL(p)       (p)
#define PIN_TO_ANALOG(p)        ((p) - 0)
#define PIN_TO_PWM(p)           PIN_TO_DIGITAL(p)
#define PIN_TO_SERVO(p)         (p) // deprecated since v2.4

The serial port configuration should match the hardware setup on the XIAO. The correct serial port initialization is crucial for communication.