This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SK-AM62A-LP: about IPC between a53 and r5f, how do I know that DM r5f and C7X can be accessed when remote_endpt=21, and mcu r5f can be accessed when remote_endpt=14

Part Number: SK-AM62A-LP

Tool/software:

Hi Mr.

I met a problem, i try to get to know IPC function between a53 and mcu r5f, and I use "rpmsg_char_simple" sample code, when using this app, you need to specify proc id and remote_endpt. so there is a question : how remote_endpt=14 or 21 corresponds to C7X, DM r5f, and mcu r5f. the function "_rpmsg_char_find_ctrldev()" looks for the specified path “/sys/bus/virtio/devices/virtiox/virtio2.rpmsg_chrdev.-1.21”,this seems to confirm that remote_endpt must be 21 for IPC communication with DM and C7X.

uder the /dev path, there are several /dev/rpmsgx char device, Is there a simpler way, /dev/rpmsgx associated with a remoteproc, to access the character device for direct ipc communication?

because the relevant information or document is relatively limited, please explain it in detail, thanks!

Best Regard

Demon

  • Hi Demon, AM62Ax Academy has really good information about IPC. I would recommend you take a look to below links which can lead you to other links and collateral

    IPC Basics

    How to run the out-of-box IPC Example: IPC Example (https://dev.ti.com/tirex/explore/node?node=A__AYEyuCg.JDdHqpTk3sF27g__AM62A-ACADEMY__WeZ9SsL__LATEST)

    How to boot a remote core: Booting Remote Cores (https://dev.ti.com/tirex/explore/node?node=A__AX2DLf3J3o-JHYMSq7Eg0w__AM62A-ACADEMY__WeZ9SsL__LATEST)

    Specifically, to answer your question, we have remote processor IDs defined here: rproc_id.h « include - rpmsg/ti-rpmsg-char - Unnamed repository; edit this file 'description' to name the repository.

    Thank you,

    Paula

  • Hi Paula

    thank you for your reply!

    I knew above content, I mean when I try to create a new thread to communicate with  mcu-r5f or dm-r5f or c7x, how I new the value of remote endpoint for each core, this means although rproc_id is defined in rproc_id.h, remote endpoint must be specified when communicating with other cores for ipc, so where remote endpoint is defined or created, is a fixed match? I meaning "rproc=0, remote=14 "stands for r5f," rproc=15, remote=21 "stands for dm," rproc=8, remote=21 "stands for c7x, and" Rproc =14 "stands for R5F. is that right? 

    please help to explain detail

    thank you so much!

    Best Regard

    Demon

  • Hello,

    To clarify, there is a difference between the remote processor ID (each non-Linux core has a fixed remote processor ID, as in the link Paula provided), and an individual rpmsg endpoint (which is assigned by the software).

    Even if you have multiple Linux tasks talking with multiple MCU+ tasks on the same non-Linux core, having unique endpoints allows the cores to know exactly which task they are talking to on the other core.

    In our default RPMsg Echo example, the Linux application tells the Linux OS to auto-assign an endpoint number to it (so the number is generated at runtime, and will be 1024 or later), and the MCU+ cores create 2 endpoints, one with 13 (for testing with the Linux kernel test), and one with 14 (for testing with the Linux userspace test): https://github.com/TexasInstruments/mcupsdk-core-k3/blob/k3_main/examples/drivers/ipc/ipc_rpmsg_echo_linux/ipc_rpmsg_echo.c 

    For more information about what is going on with the Linux side (and how to set a fixed endpoint value for Linux if you want), refer to
    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1369380/sk-am62a-lp-ipc-rp-message-related-queries-communication-between-a53-and-mcu-r5-core/5229585#5229585

    Regards,

    Nick

  • Hi Nick

    thank you for you reply!

    through this page : How to add multiple RPMsg endpoints to an MCU+ project?, so about remote endpoint variable used by Linux a53 , It's already defined in advance on the mcu side, just like follow, is that right?

    #define IPC_RPMESSAGE_ENDPT_PING                    (13U)

    #define IPC_RPMESSAGE_ENDPT_CHRDEV_PING   (14U)

    #define IPC_RPMESSAGE_ENDPT_CHRDEV_PING2  (15U)

    ...

    so another question is for "mcu_plus_sdk_am62ax_10_01_00_33\examples\drivers\ipc\ipc_rpmsg_echo_linux\am62ax-sk\r5fss0-0_freertos" and "C:\ti\mcu_plus_sdk_am62ax_10_01_00_33\examples\drivers\ipc\ipc_rpmsg_echo_linux\am62ax-sk\c75ss0-0_freertos" two projects. when Linux a53 use "rpmsg_char_simple" app to communicate with dm-r5f and c7x, need to input "rpmsg_char_simple -r15 -p21 -n10" and "rpmsg_char_simple -r8 -p21 -n10",  I search both projects and did not find the definition of remote endpoint with value '8' and '21', so where are them?

    Best Regard

    Demon

  • Hello Demon,

    Yes, you are correct about the static RPMessage endpoints getting set in the MCU+ example ipc_rpmsg_echo_linux.

    How to interpret the Linux output 

    First, let's check which virtio instances are assigned to which remote cores:

    root@am62axx-evm:/opt/edgeai-gst-apps# uname -a
    Linux am62axx-evm 6.6.58-ti-01497-ga7758da17c28-dirty #1 SMP PREEMPT Wed Nov 27 13:23:15 UTC 2024 aarch64 GNU/Linux
    
    root@am62axx-evm:/opt/edgeai-gst-apps# dmesg | grep virtio
    [    7.122779] rproc-virtio rproc-virtio.7.auto: assigned reserved memory node c7x-dma-memory@99800000
    [    7.171508] virtio_rpmsg_bus virtio0: rpmsg host is online
    [    7.172074] virtio_rpmsg_bus virtio0: creating channel rpmsg_chrdev addr 0xd
    [    7.178284] rproc-virtio rproc-virtio.7.auto: registered virtio0 (type 7)
    [    7.255281] rproc-virtio rproc-virtio.8.auto: assigned reserved memory node r5f-dma-memory@9b800000
    [    7.265176] virtio_rpmsg_bus virtio1: rpmsg host is online
    [    7.266330] virtio_rpmsg_bus virtio1: creating channel ti.ipc4.ping-pong addr 0xd
    [    7.278335] rproc-virtio rproc-virtio.8.auto: registered virtio1 (type 7)
    [    7.278501] virtio_rpmsg_bus virtio1: creating channel rpmsg_chrdev addr 0xe
    [    7.479548] rproc-virtio rproc-virtio.9.auto: assigned reserved memory node r5f-dma-memory@9c800000
    [    7.489667] virtio_rpmsg_bus virtio2: rpmsg host is online
    [    7.495442] virtio_rpmsg_bus virtio2: creating channel rpmsg_chrdev addr 0xd
    [    7.502796] virtio_rpmsg_bus virtio2: creating channel rpmsg_chrdev addr 0x15
    [    7.509855] rproc-virtio rproc-virtio.9.auto: registered virtio2 (type 7)
    [    7.510092] virtio_rpmsg_bus virtio0: creating channel rpmsg_chrdev addr 0x15
    [    7.524102] virtio_rpmsg_bus virtio0: creating channel ti.ipc4.ping-pong addr 0xe
    [    7.539198] virtio_rpmsg_bus virtio0: msg received with no recipient
    [    7.556580] virtio_rpmsg_bus virtio2: creating channel ti.ipc4.ping-pong addr 0xe
    [    7.572311] virtio_rpmsg_bus virtio2: msg received with no recipient
    

    So in this boot, virtio2 --> rproc-virtio.9.auto --> r5f-dma-memory@9c800000

    If we check the devicetree file
    /board-support/ti-linux-kernel-6.6.58+git-ti/arch/arm64/boot/dts/ti$ vi k3-am62a7-sk.dts

    we see that r5f-dma-memory@9c800000 is the memory region for the DM R5F / wakeup domain R5F.
    For more information on memory regions, refer to AM62Ax academy > Multicore module > How to allocate memory
    https://dev.ti.com/tirex/explore/node?node=A__AZVZJv4-HUUgYw7e1iCjsg__AM62A-ACADEMY__WeZ9SsL__LATEST 

    Ok, so virtio2 is associated with the DM R5F. And we can see that whatever firmware is getting loaded is creating local endpoints 0xd, 0xe, 0x15. Does that make sense?

    It does. Keep in mind that the firmware running on the AM62Ax DM R5F in the default filesystem is not the IPC Echo demo. It is a different firmware to run the VPAC / ISP code (e.g., if you want to use a camera). We do not have access to the source code for this project, but it looks like they used the IPC Echo example as a template (hence why we see endpoints at 14 & 15), and then added another endpoint at 21.

    Is there any other useful information?

    These other pages in the AM62Ax academy have useful information about booting cores & running the IPC out-of-the-box demo:

    AM62Ax academy > Linux > booting remote cores
    https://dev.ti.com/tirex/explore/node?node=A__AX2DLf3J3o-JHYMSq7Eg0w__AM62A-ACADEMY__WeZ9SsL__LATEST

    AM62Ax academy > Linux > IPC example
    https://dev.ti.com/tirex/explore/node?node=A__AYEyuCg.JDdHqpTk3sF27g__AM62A-ACADEMY__WeZ9SsL__LATEST

    Regards,

    Nick

  • The IPC Example page discusses this more, but to clarify:

    By default, the MCU R5F core is the only core running the IPC Echo example on the AM62Ax default filesystem.

    DM R5F is running a different VPAC / ISP project, as discussed above.

    C7 is running the EdgeAI firmware.

    You can find some additional information about the demos you can run that interact with the C7 core here:
    https://dev.ti.com/tirex/explore/node?node=A__ADQsLuupElXo7JidqvGaRA__AM62A-ACADEMY__WeZ9SsL__LATEST

    Regards,

    NIck