Part Number: MCU-PLUS-SDK-AM263X
I have been stepping through the sdk rpmessage example to try to more fully understand interprocessor communication on the Sitara. I am confused about how message contents are shared between processors- specifically the location where the message contents are being copied in and out of by the respective processors.
My interpretation of the code/documentation is that the VRING is the dedicated space in memory where processors can leave messages for each other. Each subsection of the vring is a circular buffer where a specific processor can leave messages for another specific processor. The base location of the vring is the MBOX_SRAM, which starts at 0x72000000 (AM263x technical reference manual section 8.1.1) Then, in another part of memory there is a large struct that contains information about the ipc endpoints and vring itself. The RPMessage_vringGetRxBufAddr() function uses this struct to extract the address for vring buffer where messages are being held for a specific processor.
Hopefully that is all correct... the part where I get confused stems from a specific line of code:
memcpy( &vringBufAddr[sizeof(RPMessage_Header)], datam *dataLen); (line 257of ipc_rpmsg.c; part of RPMessage_send()).
This line and the related line where the data is copied from this location in the receive function, copies the memory not into the dedicated space in the vring buffer, but instead points to the location where the address for the vringbuffer is stored, and copies the data 16 bytes later. I have verified in debug mode that the contents of the rpmessage header are located in the vring buffer in the memory space starting with 0x7200... (as described in the data sheet). But the data/message contents itself is stored 16 bytes after the location where the address of the vringbuf is stored. Somewhere in the 0x7000…. Block of memory.
I took this screenshot to try to illustrate what I’m seeing

You can see the vringBufAddr is 0x72001F98. That value is the memory address where the vring buffer is that should be storing the message header and data. The location that stores the location of the buffer is at 0x70059820. You can see that the data has been copied into the space that is (sizeof(rpMessage_header)) bytes after that location (0x70059840), NOT into a space in the vring in mbox_sram, that occurs right after the header.
Is this the intended behavior of the module? Have I misunderstood the documentation? Thanks