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 至 PRU RPMsg 通信

Guru**** 2394295 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1487606/processor-sdk-am62x-linux-arm-to-pru-rpmsg-communication

器件型号:PROCESSOR-SDK-AM62X

工具与软件:

AM62X 的链接
Linux ARM 到 PRU RPMsg 通信

AM62x 支持 Linux ARM 到 PRU RPMsg 通信。
software-dl.ti.com/.../RPMsg.html

有没有将 RPMsg 用于 PRU 的示例?

实践实验室是适用于 AM335x 而不是 AM62x 的示例。
software-dl.ti.com/.../PRU-Hands-on-Labs.html

AM62x Academy 不涵盖 PRU 开发。
dev.ti.com/.../welcome.html

我可以找到 PRU 方面的简单示例、但我不知道如何在 Linux 中使用它。
git.ti.com/.../am62x

此致、

大辅

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 Daisuke-San、

    现有文档的链接

    您可以在上一个主题中找到指向 PRU 入门实验室(不同于动手实验)的链接:
    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

    看起来我已经在今天早些时候的另一个主题中回答了您关于 PRU 学院的问题:
    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

    RPMsg 快速入门指南中适用于早期器件的概念也适用于 AM62x、但细节看起来是过时的:
    https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/10_01_10_04/exports/docs/linux/Foundational_Components PRU-ICSS301/ESS.html#booting-the-board-and-testing-rpmsg Msg_Quick_Start_Guide

    让我们一起进行演示  

    它可能会是最快的,我展示,而不是告诉。 下面我在最新的 AM62x RT Linux SDK 10.1上运行 RPMsg 演示

    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
    

    此致、

    Nick

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Nick San、

    感谢您的答复。 很抱歉这么晚才回复。

    我知道、要运行您展示的演示、固件需要在每个远程内核上实现 RPMsg。

    RPMsg 的文档未 提及 AM62的 PRU 固件。

    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

      AM62使用哪个带 RPMSg 的 PRU 固件? 它是否已在 PSDK Linux 引导时默认加载?

    是否有任何资源可用于为 AM62实现从 RPMSG 到 PRU 的过程? 资源现在是否仅提供给其他器件?

    此致。

    大辅

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 Daisuke-San、

    请再次查看我上一次响应中的代码块。 您将看到 预编译的 PRU_CLA 二进制文件在 Linux Msg_Echo_Interrupt 随附的默认 Linux 文件系统中的位置。

    或者、可在此处找到 PRU 软件支持包(PSSP)中的源代码:
    https://git.ti.com/cgit/pru-software-support-package/pru-software-support-package/tree/examples/am62x

    此致、

    Nick

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    "代码块"是指"让我们一起做演示"下面的文本。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Nick San、

    感谢您的答复。

    很抱歉没有仔细检查您提供的"代码块"。

    通过使用 AM62的 PSSP 和参考现有文档、我们将能够在 PRU 和使用 PRU 的应用中实现代码。

    尽管如此、我希望提供 AM62x 的官方文件。

    此致。

    大辅