Problem with Serial Comunication between Due-Due

Hi! If someone can help me with this problem.
First of all, i tried to send a char array from one Arduino Due to another Arduino Due by the serial port. From my perspective the simpliest way to do this is like it's shown in this article -> Serial Input Basics - updated - Introductory Tutorials - Arduino Forum
I based my solution basically like the Example #5 showed in the article. It's work when i send a message by the Monitor Serial, but, if i try to send a message by a another Serial port the data doesn't look complete. I don't know why... Help!

The sender code:

void setup()
{
  Serial.begin(9600);
  Serial3.begin(9600);//Iniciamos serial para nivel inferior
}
void loop(){
  char msg[32];
  strcpy(msg,"#-29.12345,-71.12345,120@");
  Serial.println(msg);
  Serial3.println(msg); 
}

The receiver code:

// Example 5 - Receive with start- and end-markers combined with parsing

const byte numChars = 32;
char receivedChars[numChars];
char tempChars[numChars];        // temporary array for use when parsing

// variables to hold the parsed data
float latitud = 0.0;
float longitud = 0.0;
int orientacion = 0;

boolean newData = false;

//============

void setup() {
  Serial.begin(9600);
  Serial1.begin(9600);
}

//============

void loop() {
  recvWithStartEndMarkers();
  if (newData == true) {
    strcpy(tempChars, receivedChars);
    // this temporary copy is necessary to protect the original data
    //   because strtok() used in parseData() replaces the commas with \0
    parseData();
    showParsedData();
    newData = false;
  }
}

//============

void recvWithStartEndMarkers() {
  static boolean recvInProgress = false;
  static byte ndx = 0;
  char startMarker = '#';
  char endMarker = '@';
  char rc;

  while (Serial1.available() > 0 && newData == false) {
    rc = Serial1.read();
    if (recvInProgress == true) {
      if (rc != endMarker) {
        receivedChars[ndx] = rc;
        ndx++;
        if (ndx >= numChars) {
          ndx = numChars - 1;
        }
      }
      else {
        receivedChars[ndx] = '\0'; // terminate the string
        recvInProgress = false;
        ndx = 0;
        newData = true;
      }
    }

    else if (rc == startMarker) {
      recvInProgress = true;
    }
  }
}

//============

void parseData() {      // split the data into its parts

  char * strtokIndx; // this is used by strtok() as an index

  strtokIndx = strtok(tempChars, ",");     // get the first part - the string
  latitud = atof(strtokIndx);     // convert this part to a float

  strtokIndx = strtok(NULL, ","); // this continues where the previous call left off
  longitud = atof(strtokIndx);     // convert this part to a float

  strtokIndx = strtok(NULL, ",");
  orientacion = atoi(strtokIndx);     // convert this part to an integer

}

//============

void showParsedData() {
  Serial.print("Latitud ");
  Serial.println(latitud, 5);
  Serial.print("Longitud ");
  Serial.println(longitud, 5);
  Serial.print("Orientacion ");
  Serial.println(orientacion);
}

Like i said, the receiver code it's very similar to the example #5. The only difference it's in the Serial port that i listen and the variables I Parsed to.

General guidance:

Keep Serial for communications between Arduino DUE and Serial Monitor, and use Serialx (x=1,2,3 or 4 with some more lines of code) for communications between your 2 arduino DUE.

Connect Serialx RX (DUE 1)to Serialy TX (DUE 2), Serialx TX (DUE 1) to Serialy RX (DUE 2). Connect Gnd (DUE 1) to Gnd (DUE 2).

An basic example sketch for DUE 1 and DUE 2:

/*********************   DUE 1    **************/
/**   DUE 1 connected to Serial Monitor       **/
/***********************************************/
char c = 0;
void setup() {

  Serial.begin(250000);
  Serial1.begin(250000);

  Serial1.print("Hello"); // Send Hello to DUE 2
}


void loop() {
  String s;
  s.reserve(20);
  s = "";

  while (Serial1.available() > 0) {
    c = Serial1.read();
    s += c;

  }
  if (s.length() > 0) {
    Serial.println(s);
    Serial1.print(s);
  }
  delay(1000);
}
/**************    DUE 2   ***********************/
char c = 0;
void setup() {

  Serial2.begin(250000);

}

void loop() {
  String s;
  s.reserve(20);
  s = "";

  // Receive from DUE 1
  while (Serial2.available() > 0) {
    c = Serial2.read();
    s += c;

  }

  // Send back to DUE 1
  if (s.length() > 0) {
    Serial2.print(s);
  }
}

Once this basic sketch works for you, you can explore all possibilities to transfer arrays. The String type (S uppercase) may be helpful with a sufficient reserve() option.

Since the communication between DUE 1 <--> Serial Monitor and DUE 1 <--> DUE 2 are distinct, you can set the baud rate to 5000000 between DUE 1 and DUE 2 whereas the baud rate is left to 250000 between DUE 1 and Seril Monitor.

mmm, i tried to set a higher baud rate to the Serial conection between the arduino's but it didn't work.
I'm still receiving the same kind of messages. :c

Okey, the problem was the grounds e.e holy cr....
Regards.

ard_newbie:
Connect Serialx RX (DUE 1)to Serialy TX (DUE 2), Serialx TX (DUE 1) to Serialy RX (DUE 2). Connect Gnd (DUE 1) to Gnd (DUE 2).