I’m afraid there is no best practice for this. I would start your definition with the question, against what kind of error the communication should be secured.
The RpMsg data is stored directly in the DRAM, and the availability of data is signaled through the SoC’s MU peripheral. There cannot be classical transfer errors like on a UART line. Possible failure modes I can think of are all based on misbehavior of the software.
- if the signaling does not work, the data does not arrive at all
- the data could be overwritten by another part of the software
The RpMsg data protocol is packet based (as you see it on the M4 side). Only on the Linux side it is converted into a stream (imx_rpmsg_tty).
I probably would keep the fixed-length RpMsg blocks, and secure each block with a CRC.