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