Serial Trouble

Hi

I am having same strange issue, this issue appears on Arduino Mega family and code works fine with hardware serial on Leonardo.

I am posting simple code to reproduce the issue. Connecting any Serial device on Serial1 (I tested with SIM808) Sim800.

void setup() 
{
  while(!Serial);
  Serial.begin(115200);
  Serial1.begin(115200);
}

void loop() {
  while(Serial.available())
  {
    Serial1.write(Serial.read());
  }

  while(Serial1.available())
  {
    Serial.write(Serial1.read());
  }
  // put your main code here, to run repeatedly:

}

Sending AT with echo enabled on GSM should output

AT <---- Coming to Arduino
OK <----

but it outputs
AT <---- This is data which was transmitted on TX but it is recieved on RX as well, (THIS IS ISSUE!)
AT <---- Coming to Arduino
OK <----

Also check other ports as well, same issue.

Same issue posted by someone else.

Funny. I happen to have a test running just now, that has been running all week, with all four ports streaming at 1Mbps - no problems.

@mechatronicsengr, please do not hijack. Thread split.

Just for the record, I don't think this was a case of hijack - simply inexperience leading to re-awakening of a very old Thread.

...R