Portenta H7 M7 core
VSCode + PlatformIO
I posted this on the Arduino forum but thought I’d try here as well.
I’m trying to write simple dual-core sketches to learn RPC between the M7 and M4 cores (simpler that the add/subtract example).
The RPC never becomes available. Looking at the setup() function below, the message “M7-Waiting for RPC to become available…” just continuously prints to the serial monitor.
Here is my platformio.ini file:
[env:portenta_h7_m7]
platform = ststm32
board = portenta_h7_m7
framework = arduino
lib_deps =
RPC
monitor_filters =
default
time
log2file
monitor_speed = 115200
Below is my setup() method. Obviously I’m missing something and after several days of reading forums and looking for other Portenta H7 RPC documentation I’m at a loss. Are there any specific docs that address the Portenta H7 RPC API? Any help is greatly appreciated.
String currentCPU() {
return HAL_GetCurrentCPUID() == CM7_CPUID ? "M7" : "M4";
}
void setup() {
pinMode(LEDB, OUTPUT);
Serial.begin(115200);
while (!Serial) {}
// Initialize RPC library; this also boots the M4 core
Serial.println(currentCPU() + "-Before RPC.begin()");
int retc = RPC.begin();
if (retc != 0) {
Serial.println("Failed to initialize RPC library");
while (1) {}
}
Serial.println(currentCPU() + "-After RPC.begin()");
Serial.println(currentCPU() + "-RPC initializing...");
while(!RPC.available()) {
Serial.println(currentCPU() + "-Waiting for RPC to become available...");
delay(1);
}
Serial.println(currentCPU() + "-RPC initialized");
}
And here is the output:
16:07:54.409 > M7-Before RPC.begin()
16:07:55.444 > M7-After RPC.begin()
16:07:55.444 > M7-RPC initializing...
16:07:55.444 > M7-Waiting for RPC to become available...
16:07:55.444 > M7-Waiting for RPC to become available...
16:07:55.444 > M7-Waiting for RPC to become available...
16:07:55.444 > M7-Waiting for RPC to become available...
16:07:55.444 > M7-Waiting for RPC to become available...
.
.
.
Forever and ever…
BTW: Compiling and uploading my sketch with the Arduino IDE has the same results. Running the Portenta H7 RPC examples in the Arduino IDE has the same results (M7-Waiting for RPC to become available…).