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.

PROCESSOR-SDK-AM62X: Linux ARM to PRU RPMsg communication

Part Number: PROCESSOR-SDK-AM62X

Tool/software:

PROCESSOR-SDK-AM62X
Linux ARM to PRU RPMsg communication

Linux ARM to PRU RPMsg communication is supported on AM62x.
software-dl.ti.com/.../RPMsg.html

Are there any examples for using RPMsg for PRU?

The Hands-on Labs are examples for the AM335x, not the AM62x.
software-dl.ti.com/.../PRU-Hands-on-Labs.html

The AM62x Academy does not cover PRU development.
dev.ti.com/.../welcome.html

I can find simple examples for the PRU side, but I do not know how to use it with Linux.
git.ti.com/.../am62x

Best regards,

Daisuke

  • Hello Daisuke-san,

    Links to existing documentation

    You can find the link to the PRU Getting Started Labs (different from the Hands-on Labs) in your previous thread:
    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1480168/processor-sdk-am62x-how-to-toggle-gpio-pin-by-pru-with-mcu-sdk/5684276#5684276

    It looks like I already covered your question about PRU academy on that other thread earlier today:
    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1480168/processor-sdk-am62x-how-to-toggle-gpio-pin-by-pru-with-mcu-sdk/5712389#5712389

    The concepts in the RPMsg Quick Start Guide that applied to earlier devices also applies to AM62x, but it looks like the details are out of date:
    https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/10_01_10_04/exports/docs/linux/Foundational_Components/PRU-ICSS/RPMsg_Quick_Start_Guide.html#booting-the-board-and-testing-rpmsg

    Let's do the demo together 

    It will probably be fastest for me to show instead of telling. Here's me running the RPMsg demo on the latest AM62x RT Linux SDK 10.1

    am62xx-evm login: root
    root@am62xx-evm:~# uname -a
    Linux am62xx-evm 6.6.58-rt45-ti-rt-01780-gc79d7ef3a56f-dirty #1 SMP PREEMPT_RT Wed Nov 27 14:15:26 UTC 2024 aarch64 GNU/Linux
    
    // remoteprocX association can change each boot
    // that means you should check the name to figure out which
    // remoteprocX is associated with which core
    root@am62xx-evm:~# head /sys/class/remoteproc/remoteproc*/name
    ==> /sys/class/remoteproc/remoteproc0/name <==
    5000000.m4fss
    
    ==> /sys/class/remoteproc/remoteproc1/name <==
    78000000.r5f
    
    ==> /sys/class/remoteproc/remoteproc2/name <==
    30074000.pru
    
    ==> /sys/class/remoteproc/remoteproc3/name <==
    30078000.pru
    
    // what happened during Linux boot?
    root@am62xx-evm:~# dmesg | grep remoteproc
    [   21.556333] k3-m4-rproc 5000000.m4fss: configured M4 for remoteproc mode
    [   21.562085] remoteproc remoteproc0: 5000000.m4fss is available
    [   21.578014] remoteproc remoteproc0: powering up 5000000.m4fss
    [   21.578052] remoteproc remoteproc0: Booting fw image am62-mcu-m4f0_0-fw, size 55100
    [   21.601408] remoteproc remoteproc0: remote processor 5000000.m4fss is now up
    [   21.807209] remoteproc remoteproc1: 78000000.r5f is available
    [   21.807354] remoteproc remoteproc1: attaching to 78000000.r5f
    [   21.825583] remoteproc remoteproc1: remote processor 78000000.r5f is now attached
    [   22.512695] remoteproc remoteproc2: 30074000.pru is available
    [   22.525854] remoteproc remoteproc3: 30078000.pru is available
    
    // we expect the cores to be off based on the Linux boot. Is that true?
    root@am62xx-evm:~# cat /sys/class/remoteproc/remoteproc2/state
    offline
    root@am62xx-evm:~# cat /sys/class/remoteproc/remoteproc3/state
    offline
    
    // is the RPMsg firmware on the filesystem?
    root@am62xx-evm:~# ls /lib/firmware/pru/PRU_
    PRU_Halt.out                   PRU_RPMsg_Echo_Interrupt0.out  PRU_RPMsg_Echo_Interrupt1.out
    
    // is the remoteproc firmware already pointing to the RPMsg example?
    root@am62xx-evm:~# cat /sys/class/remoteproc/remoteproc2/firmware
    am62x-pru0-fw
    root@am62xx-evm:~# cat /sys/class/remoteproc/remoteproc3/firmware
    am62x-pru1-fw
    
    root@am62xx-evm:~# ls -al /lib/firmware/
    total 25460
    drwxr-xr-x  6 root root    4096 Mar  9  2018 .
    drwxr-xr-x 81 root root   61440 Mar  9  2018 ..
    -rw-r--r--  1 root root    2040 Mar  9  2018 LICENCE.ibt_firmware
    -rw-r--r--  1 root root    2046 Mar  9  2018 LICENCE.iwlwifi_firmware
    lrwxrwxrwx  1 root root      72 Mar  9  2018 am62-mcu-m4f0_0-fw -> /usr/lib/firmware/ti-ipc/am62xx/ipc_echo_test_mcu2_0_release_strip.xer5f
    lrwxrwxrwx  1 root root      79 Mar  9  2018 am62-mcu-m4f0_0-fw-sec -> /usr/lib/firmware/ti-ipc/am62xx/ipc_echo_test_mcu2_0_release_strip.xer5f.signed
    lrwxrwxrwx  1 root root      51 Mar  9  2018 am62x-pru0-fw -> /usr/lib/firmware/pru/PRU_RPMsg_Echo_Interrupt0.out
    lrwxrwxrwx  1 root root      51 Mar  9  2018 am62x-pru1-fw -> /usr/lib/firmware/pru/PRU_RPMsg_Echo_Interrupt1.out
    ..
    
    // start the PRU cores
    root@am62xx-evm:~# echo start > /sys/class/remoteproc/remoteproc2/state
    [ 4875.923209] remoteproc remoteproc2: powering up 30074000.pru
    [ 4875.926398] remoteproc remoteproc2: Booting fw image am62x-pru0-fw, size 81504
    [ 4875.945016] virtio_rpmsg_bus virtio2: rpmsg host is online
    [ 4875.945063] virtio_rpmsg_bus virtio2: creating channel rpmsg-pru addr 0x1e
    [ 4875.945337] rproc-virtio rproc-virtio.5.auto: registered virtio2 (type 7)
    [ 4875.945351] remoteproc remoteproc2: remote processor 30074000.pru is now up
    [ 4875.964989] rpmsg_pru virtio2.rpmsg-pru.-1.30: new rpmsg_pru device: /dev/rpmsg_pru30
    root@am62xx-evm:~# echo start > /sys/class/remoteproc/remoteproc3/state
    [ 4880.992188] remoteproc remoteproc3: powering up 30078000.pru
    [ 4880.995432] remoteproc remoteproc3: Booting fw image am62x-pru1-fw, size 81504
    [ 4881.014935] virtio_rpmsg_bus virtio3: rpmsg host is online
    [ 4881.014978] virtio_rpmsg_bus virtio3: creating channel rpmsg-pru addr 0x1f
    [ 4881.015195] rproc-virtio rproc-virtio.6.auto: registered virtio3 (type 7)
    [ 4881.015209] remoteproc remoteproc3: remote processor 30078000.pru is now up
    [ 4881.015821] rpmsg_pru virtio3.rpmsg-pru.-1.31: new rpmsg_pru device: /dev/rpmsg_pru31
    
    // run the test
    root@am62xx-evm:~# ls /dev/ | grep pru
    rpmsg_pru30
    rpmsg_pru31
    root@am62xx-evm:~# echo "test1" > /dev/rpmsg_pru30
    root@am62xx-evm:~# echo "test2" > /dev/rpmsg_pru31
    root@am62xx-evm:~# cat /dev/rpmsg_pru30
    test1
    ^C
    root@am62xx-evm:~# cat /dev/rpmsg_pru31
    test2
    ^C
    

    Regards,

    Nick

  • Hi Nick-san,

    Thank you for your reply. Sorry for the late reply.

    I understand that running the demo you showed requires firmware implementing RPMsg on each remote core.

    The documentation for RPMsg does not mention the PRU firmware for AM62.

    software-dl.ti.com/.../PRU-Hands-on-Labs.html

    software-dl.ti.com/.../RPMsg_Quick_Start_Guide.html

    software-dl.ti.com/.../RPMsg.html

    software-dl.ti.com/.../Foundational_Components_IPC62x.html

    Which the PRU firmware with RPMsg is used for the AM62? Is it already loaded by default at boot in PSDK Linux?

    Are there any resources for implementing RPMsg to PRU for AM62? Are the resources only provided for other devices now?

    Best regards.

    Daisuke

  • Hello Daisuke-san,

    Please take another look at the code block in my previous response. You will see where the prebuilt PRU_RPMsg_Echo_Interrupt binaries are in the default Linux filesystem that comes with the Linux SDK.

    Alternatively, you can find the source code in the PRU Software Support Package (PSSP) here:
    https://git.ti.com/cgit/pru-software-support-package/pru-software-support-package/tree/examples/am62x

    Regards,

    Nick

  • by "code block" I meant the text under "let's do the demo together".

  • Hi Nick-san,

    Thank you for your reply.

    I apologize for not carefully checking the "code block" you provided.

    We will be able to implement code on PRU and applications using PRU by using PSSP for AM62 and referencing the existing documentation.

    That said, I would expect official documentation for AM62x to be provided.

    Best regards.

    Daisuke