2020-02-13 09:32 AM
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.
Solved! Go to Solution.
2020-02-14 01:28 AM
Hi @wpaulilkinson
Got feedback from expert that issue may come from lack of equivalence of "stty -onlcr -echo -F /dev/ttyRPMSG0" bash command in your Linux app.
You can first validate this assumption by issuing it prior to launch your app.
Hope it help,
Olivier
2020-02-14 12:31 AM
Hi @wpaulilkinson
I have to contact expert to answer about what can goes wrong with your POC.
Anyway for complex or big data structure there is an alternative presented in those page which maybe better suit your need :
https://wiki.st.com/stm32mpu/wiki/How_to_exchange_large_data_buffers_with_the_coprocessor_-_example
Hope it help,
Olivier
2020-02-14 01:28 AM
Hi @wpaulilkinson
Got feedback from expert that issue may come from lack of equivalence of "stty -onlcr -echo -F /dev/ttyRPMSG0" bash command in your Linux app.
You can first validate this assumption by issuing it prior to launch your app.
Hope it help,
Olivier
2020-02-14 05:30 AM
Hi @Community member
Thank you very much for both of your replies, very much appreciated.
The example application you referred me to in your first reply uses rpmsg in addition to rpmsg_sdb so provides an example of what I'm trying to do as well as the code to perform the equivalent of the command line stty(1) command you listed.
Debugging in progress.
Best regards,
Paul.
2020-02-20 05:10 AM
Turns out I had inadvertently neglected to account for the different structure member padding and layout between the CubeIDE M4 compiler and the open embedded gnueabi compiler for the A7 code.