Unable to send data from NXP processor to M4 core using RPC communication in Portenta X8

Problem :
-> Unable to Transmit data variables of any type using RPC calls. Trying to bind functions on M4 which can be called on Linux using Msgpack-RPC library but errors on calling the bounded function.

Hardware Setup :
-> Just Portenta X8

Steps Taken:
-> Added basic Msgpack-RPC client on linux to call the variables as well as the functions that have been bound on the M4 side.


Fig: Script on Linux used to call “SUM” function on M4(link)

-> Flashed M4 with a script consisting of an “SUM” function to add the variables provided by Linux side.

-> The Basic_AddSub.ino script (link) was referred to bind the functions on RPC by M4, and on Linux side bench_client.py (link) was referred to call the bounded “SUM” function to transfer the data variables.


Fig : Script for binding “SUM” function on M4 (link)

Expected Outcome :
-> Was expecting the integers 1 and 2 that were transferred from linux using the “sum” function to be available on M4.

Actual Outcome :
-> The python script was not working , an error came while using rpc_client.call(“sum”,1,2) indicating the connection is closed but the M4 service is running and all the data transfer works from M4-> Linux.


Fig: Error received on executing the python script to call the function “SUM”

Hi Himanshu!
Can you try this solution and let me know whether it works or not.

Hey @thayit , I have already established successful RPC communication for sending data from the microcontroller M4 to the NXP microprocessor (linux) but I am unable to do the same in the opposite direction from linux-> M4 , have tried few examples but none seem to work. If you have successfully tried this then you could you please share the link for the same. I have added the example I used above if you want to try.