Portenta X8: Not working RPC Communication - Status ?

Dear community and Arduino Team,

I am aware of that the RPC communication between the i.MX 8M and the STM32H7 is not working due do some unknown technical issues. According to the post [1], the communication error seems to be on the m4_proxy [2]. However, I have tried the example in [2] and, unfortunately, the communication is not working. Without being a "Go" expert, I have added some print outs in the main.go in [2] for debug purposes. In particular, I was interested in the output of the "/dev/x8h7_ui" which is the device (ECSPI3) for the SPI based communication between i.MX 8M and STM32H7 [3 and 4].
Here the modified code snippet of the main.go [2]:

func chardevListener(chardev *os.File, resp chan []byte) {

	for {
		data := make([]byte, 1024)
		response := make([]byte, 1024)

		n, err := chardev.Read(data)

		data = data[:n]
	
		//Edit for Debug Purposes
		fmt.Printf("Received Data (Hex): %x\n", data)
		fmt.Printf("Received Data (String): %s\n", string(data))
		//Edit End
....

The chardev object is mapped to the device "/dev/x8h7_ui" as one can see from following code snippet of the main function in main.go [2]:

func main() {

	functions = make(map[string]int)

	chardev, err := os.OpenFile("/dev/x8h7_ui", os.O_RDWR, 0)
	if (err != nil) {
		fmt.Println(err)
		return
	}
.....

During testing the example with the modified m4_proxy (cross compiling to ARM64 on macOSX) , I was surprised that the added debug print outs for "/dev/x8h7_ui" were not executed. To ensure this, I also wrote a simple python script accessing on "/dev/x8h7_ui" using os.open(...) and could also not achieve any read out, whereby the the m4_proxy service was stopped to prevent any "device is busy"-issues. Now the question is, if the issue is on the device driver (kernel) level or even on the PortentaX8-STM32H7 firmware [5], since one would expect at least "data" on the ECSPI3 when the Arduino-Sketch on M4 Core is sending data using "SerialRPC.println(...)". Unfortunately, there is no "easy" way to hook an LogicAnalyzer on the ECSPI3 pins, at least for my understanding.

@Arduino-Team: Can you please provide any updates on the progress of the RPC communication issue and some more details? The lack of working RPC communication cancels the real-time use cases / potential of the Portenta X8.

References:
[1]: Issues with M4 Proxy on Portenta X8 in Docker-Container
[2]: GitHub - arduino/portentax8-m4-proxy
[3]: forum.arduino.cc/t/portenta-x8-how-to-share-data-stm32-nxp/1010154
[4]: portentax8-x8h7/example.dts at main · arduino/portentax8-x8h7 · GitHub
Note on [4]:
According to cat /sys/bus/spi/devices/spi2.0/modalias -> spi: x8h7 and if one can assume that spi2.0 is ECSPI3, since Portenta X8 lists "spi0.0, spi1.0 and spi3.0", whereby spi0.0 and spi 1.0 are using same driver and thus can be referred to ECSPI1 and ECSPI2 which are available for user applications.
[5]: GitHub - arduino/portentax8-stm32h7-fw

any news ? without the rpc communication the Portenta X8 is not useful

Hey massimo56,

you put it on point :wink:

The user "thayit" posted in [1] a solution based on some suggestion from Arduino-Team via E-Mail. Furthermore, "thayit" attached in [1] the firmware for the STM32H7 on the PortentaX8. Strange thing is, that I had over couple of months an e-mail traffic with one of the Arduino-Support Team, but they never proposed me a solution. I am well aware of, that in the Linux Image of the PortentaX8 there is the firmware for the STM32H7 as well as the tools for uploading it to the STM32H7 in some directory. However, I asked in [2] "thayit" from where he/she/it got the firmware for the STM32H7 he/she/it have attached in the post [1]. Unfortunately, I assume, that "thayit" misunderstand me, since he/she/it answered to my question that the attached binary file is not the Linux firmware, but the binary file for the STM32H7. However... I ask myself: When "thayit" got the firmware for the STM32H7 from Arduino-Team, why they did not send it to me or posted on GitHub.
I did not download the binary file attached by "thayit", so I can't provide any evidence that the solution is working or not, whereby I want to make clear, that I don't insinuate anything to "thayit".

Kind regards,
tuggybear

References:
[1]: Portenta X8 RPC tutorial is not working on the latest firmware - #8 by thayit
[2]: Portenta X8 RPC tutorial is not working on the latest firmware - #9 by tuggybear

Hi massimo56,
Just try my solution.

Hopefully works.

Tolga
He/Him/His

Thanks thayit ! I will try the solution that you described.
Massimo