How to get src and dst for pru_rpmsg_send?

I seem to be missing something obvious: Where do I get the values for src and dst in the pru_rpmsg_send() function?

The TI examples do a pru_rpmsg_receive() first and then echo back to the same src and dst. That seems … odd. What’s the point of having a variable src and dst if they are effectively hardwired to a single communication channel?

Thanks.

I don’t think there is any good documentation on it (would be very cool if someone made one), but it can be found experimentally rather quick. The source and destination values represent the ports. You can manually set them to whatever you like. No echoing or first message needed. Just be mindful of loops I have lagged out my system many times.

If you look at the example code we create a rpmsg channel with port 30 for pru0 and port 31 for pru1 (CHAN_PORT). Thru some tests I found that the arm processor gets port 1024.

TLDR: you set your src and set dst to your desired device:
pru0 30
pru1 31
arm 1024

unless you have defined them otherwise

While I can experiment with the numbers, presumably this gets a bit trickier with the AI which has more PRUs and has those Cortex units.