How to send and receive structured data using /dev/ttyRPMSG0 in openstlinux-4.19-thud-mp1-19-10-09 running openstlinux-eglfs distro on an STM32MP157C-DK2.
I've included the stock OpenAMP echo code for the M4 from CubeIDE 1.10-2 and am able to echo a message to /dev/ttyRPMSG0 and have cat print the echoed message.
I've written a simple app in C to open the RPMSG0 device, write(2) a structure and then read(2) the structure back. I've modified the OpenAMP callback code to modify a sructure member and a debugger on the M4 shows that VIRT_UART_Transmit() buffer arg(2) contains the changed structure member value, however, my read(2) on the A7 displays the original structure member value.
This is for a POC so I'm hoping to simply use /dev/RPMSG driver subsystem as is.
Can the standard st-linux RPMSG facility be used to pass structures to M4 and back to A7 as I'm attempted to do .... open(); write(); read() - no close() as I'm expecting to write and read more messages ?
Are there /dev/RPMSGn settings I need to use in order for this to work as intended ?
Are there examples of how to pass structured messages through RPMSGn ?
The STM32Cube_FW_MP1_V1.1.0 Middlewares->Third Party->OpenAmp is quite different in that it uses openamp library calls, is this what I SHOULD be doing ?
Thanks in advance.
Paul.
