Using RPC communication on the same core for GIGA R1

Hey everybody,

I want to use the RPC communication system on the same core (m7) for the GIGA R1 board. I need that for mocking some classes and for unit testing. In my opinion it is easier to do the tests on one core instead of deploying two seperate applications to the m7 and m4.
Please share your opinion if you have other/better ideas :wink:

I cant find something in that direction in the online documentation. I tried the example under the section " RPCs in the Arduino Environment" from this site:
https://docs.arduino.cc/tutorials/giga-r1-wifi/giga-dual-core/

Did somebody tried something like that already? Is it possible to use RPC for communication on one core?
Thanks for your help ! :slight_smile:

Hi @ctcoding , interesting question. I've not tried it, but I suspect you'll need to run the m4 code as a separate m7 thread.

Unfortunately it doesn't work, or do I miss something? Here is my code:

#include <RPC.h>
#include <Arduino.h>

bool MsgReceived = false;
void MsgCb() {
  Serial.println("MsgCb");
  MsgReceived = true;
}

void ReadMessage() {
  RPC.bind("Func", MsgCb);
  for(;;) {
    if(MsgReceived) {
      Serial.println("Success !!!!");
      break;
    }
    delay(1);
  }
}

void setup() {
  while (!Serial) {
    delay(1);
  }

  RPC.begin();
  rtos::Thread MsgThread;
  MsgThread.start(ReadMessage);

  for(;;) {
    if(MsgReceived)
      break;
    RPC.call("Func");
    delay(1);
  }
  MsgThread.join();
}

So nobody has an idea? Or it is not possible?