Based on what I am seeing in this thread:
Passing variable from CM7 to CM4 using RPC - Portenta / Portenta H7 - Arduino Forum
you are probably better off using the method shown in String sharing between M7 cores and M4 cores - Hardware / GIGA R1 - Arduino Forum if you have a lot of sensor data it will be faster.