SAMD21 SERCOM Serial1 & Serial2 not working

I have some issue getting SERCOM Serial to work ...

SerialUSB is working fine ...
I2C is working fine ...

I made a board with "almost" similar pinout as Arduino Zero ...

UART0 is PA11/PA10 ( Rx/Tx )
UART1 is PB09/PB08 ( Rx/Tx )

I want to access the Serial1 or Serial2 but both I read both the Sparkfun & Adafruit documentation link below, still could NOT get it working...

Looking at the codes, I hv setup the Sercom4 with pad1 & pad0

I also hv setup the pinPeripheral

pinPeripheral(15, PIO_SERCOM_ALT);
pinPeripheral(16, PIO_SERCOM_ALT);

No compilation or upload errors , just no output ...

I have open up both variant.cpp and variant.h and SERCOM.h files at the SAMD cores

I connect both the Serial1 and Serial2 Tx pins to a FTDI USB Serial port to check the output ....

https://learn.sparkfun.com/tutorials/adding-more-sercom-ports-for-samd-boards#helpful-charts

SAMD21 pinout

SERCOM on SAMD21

#define PIN_SERIAL2_RX       (16ul)
#define PIN_SERIAL2_TX       (15ul)
#define PAD_SERIAL2_TX       (0x1ul)
#define PAD_SERIAL2_RX       (0x0ul)


// PB09 , PB08, SERCOM4 , Pad1, Pad0

Uart Serial2(&sercom4,16ul, 15ul, SERCOM_RX_PAD_1,UART_TX_PAD_0);

void SERCOM4_Handler()
{
  Serial2.IrqHandler();


void setup() {
  
  Serial.begin(57600);
  while (!Serial) {
    ; // wait for serial port to connect
  }

  Serial1.begin(57600);
  Serial2.begin(57600);

  pinPeripheral(15, PIO_SERCOM_ALT); 
  pinPeripheral(16, PIO_SERCOM_ALT);

  pinPeripheral(0, PIO_SERCOM); 
  pinPeripheral(1, PIO_SERCOM);
  
  delay(500);

  Serial.println("SAMD21 Serial");
  Serial1.println("SAMD21 Serial1");
  Serial2.println("SAMD21 Serial2");
  
}


}

Hi stan001,

If you're using the Arduino Zero core code then you should automatically get Serial1 on digital pins D0 and D1.

By default, SERCOM4 on the Arduino Zero is already used by the SPI port. Depending on you custom board layout, other pins that offer unused SERCOM modules might be a better option.

Here are the SERCOM assignments on the Arduino Zero:

SERCOM0: Serial1
SERCOM1: Unused
SERCOM2: Unused
SERCOM3: I2C
SERCOM4: SPI
SERCOM5: Serial

By default, SERCOM4 on the Arduino Zero is already used by the SPI port.

(but also note that SPI is not enabled on the port unless you load in the SPI library.)