Unable to add a Serial Port to Arduino MKR 1500

We are unable to add a serial port to the Arduino MKR 1500? We have to use the newly added serial port for the GPS module to work?

This is the solution what we tried https://www.arduino.cc/en/Tutorial/SamdSercom but it did not work.

Is there a simple yet effective solution available?

I’ve deleted your other cross-post @DawoodO.

Cross-posting is against the rules of the forum. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend 15 minutes (or more) writing a detailed answer on this topic, without knowing that someone else already did the same in the other topic.

Repeated cross-posting will result in a suspension from the forum.

In the future, please take some time to pick the forum board that best suits the topic of your question and then only post once to that forum board. This is basic forum etiquette, as explained in the sticky “How to use this forum - please read.” post you will find at the top of every forum board. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

And his other cross post deleted.

Final warning.

Other post/duplicate DELETED Please do NOT cross post / duplicate as it wastes peoples time and efforts to have more than one post for a single topic. Continued cross posting could result in a time out from the forum.

Could you take a few moments to Learn How To Use The Forum. It will help you get the best out of the forum in the future. Other general help and troubleshooting advice can be found here.

Keep in mind that there is a spare hardware serial port on pins 13 and 14 of the MKR NB 1500, Serial1. This is separate from the Serial port used for communication with your computer.

If you are already using Serial1 for something else, then it makes sense to follow the SERCOM tutorial to create another serial port. Forum member Juraj has pointed out that there is an error in the "Create a new Serial instance" example sketch on that tutorial: https://forum.arduino.cc/index.php?topic=630415

The fixed version of the sketch:

#include "wiring_private.h"

Uart mySerial (&sercom3, 1, 0, SERCOM_RX_PAD_1, UART_TX_PAD_0); // Create the new UART instance assigning it to pin 1 and 0

// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
  mySerial.begin(9600);

  pinPeripheral(1, PIO_SERCOM); //Assign RX function to pin 1
  pinPeripheral(0, PIO_SERCOM); //Assign TX function to pin 0
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // print out the reading to mySerial
  mySerial.println(sensorValue);

  // print incoming data from mySerial to Serial  
  while (mySerial.available()) {
    Serial.write(mySerial.read());
  }
  delay(500);        // delay in between reads for stability
}

// Attach the interrupt handler to the SERCOM
void SERCOM3_Handler()
{
  mySerial.IrqHandler();
}

Note that, unlike what is claimed in the tutorial, the corrected code uses pin 1 for RX and pin 0 for TX.