Arduino Giga RPC communication Problem M7/M4

Hi all,

We had some small experiments about using dual core on Arduino Giga R1. First of all, for just learning basics, we tried this example on offical document page :

Arduino Giga Dual Core

//M4 Core Sketch

#include <RPC.h>

void setup() {
RPC.begin();
}

void loop() {
RPC.println("Printed from M4 core");
delay(1000);
}

/******************************************************/

//M7 Core Sketch

#include <RPC.h>

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

void loop() {
  String buffer = "";
  while (RPC.available()) {
    buffer += (char)RPC.read();  // Fill the buffer with characters
  }
  if (buffer.length() > 0) {
    Serial.print(buffer);
  }
}

For compiling the related codes, we selected Flash Split as 1.5MB M7 + 0.5MB M4. Then for "M7 Core Sketch", we selected targer processor as "Main Core" and uploaded code, second step, for "M4 Core Sketch" we selected target processor as "M4 Co-Processor" and uploaded core.

For the first experiment, everything is good work. Then after a few upload process, program started to print nothing. We just changed "Printed from M4 core" to another simple thing like "BlaBlaBla".

What we do false ? Is there any suggestions ? This can be caused by some cache problems ? If this is a caching problem how we can solve it ?

Sorry for this basic questions but we are beginner for this process. Thanks a lot for your answers...

Hi there @donemuhendislik , the sketch(es) you posted above seems to be right and should not cause any issues. I will try later today/this week to replicate this issue, and report back if I find something.

Thank you so much. Do you need any screenshot about this ? While waiting any answers from here, I was continue to searching for any solutions. Do I need to clear the Arduino IDE cache ? Or is there any way to clear the caches of cores in Arduino Giga ? Because while we change the string in RPC.println() function in M4 core code, nothing changes. Thanks again for your reply @ksoderby

EDIT :

For the next tryings, while we decrease the delay amount as 100 in M4 Core code, nothing changes and still shows the serial.println() result in M7 core in 1000 ms too.

By the way, we save ino files in different folders. The folder structure is like :

dual_core_test -> m7 -> m7.ino (contains m7 core codes)

dual_core_test -> m4 -> m4.ino (contains m4 core codes)

No problem at all @donemuhendislik . I just tested the implementation out (using the sketches you posted), and it has been running for ~30 minutes without any issues.

What this could point to is that the serial communication between your board and the IDE is not working (it likely works, but the IDE can't display the data for some reason).

One thing to check is if the baud rate is correct (see attached screenshot). You could try restarting the IDE as well and see if the issue persists.

Hopefully this helps!

@ksoderby hi again, first of all, thank you so much for support. After a few testing day, we solved problem. May this message helps someone else too.

For the first step, you are right. We uploaded the above example into the board as m7 and m4 sketches. We setted baudrate too. After a few testing, we detected a problem about Arduino IDE 2.2.1. This version saves and cannot clear some data in own cache. So we deleted the contents in core and sketch folder in TEMP folder (i m talking about Windows OS). Later, we restarted IDE. Then for clearing the mcu, upload an empty sketch.(with default selections, as 2MB for M7 and sdram for M4 and target core is Main Core). After this, first we uploaded m7 codes and then m4 codes. Then everything is working so good… Every update on code starts to come good. But for these steps, we used arduino nightly 2.2.2 (20231130) ide package.

We dont know, may we did something wrong or ide version 2.2.1 has some bugs, not sure... But for us, this one was solution.

Thanks again for your help, advices and effort… @ksoderby :clap:t2::clap:t2::clap:t2:

Happy to hear it work, and always happy to be of help! Have a great day :slightly_smiling_face: