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-AM62P-LP:通过运行 Linux (使用和不使用 IPC)的 A53加载 R5

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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1425613/sk-am62p-lp-r5-load-from-the-a53-running-linux-with-and-with-out-ipc

器件型号:SK-AM62P-LP

工具与软件:

尊敬的 TI:

我们要在/lib/firmware 中刷写 hello_world 示例、但它会显示错误。

root@am62pxx-evm:/lib/firmware cat /sys/class/remoteproc/remoteproc0/state
该维护周期
root@am62pxx-evm:/lib/firmware echo start >/sys/class/remoteproc/remoteproc0/state
-bash:回显:写入错误:参数无效


root@am62pxx-evm:/lib/firmware# ls -l
total 548
lrwxrwxrwx 1 root root     88 Oct 15 12:04 am62p-mcu-r5f0_0-fw -> /lib/firmware/svayacode/hello_world_cpp_am62px-sk_mcu-r5fss0-0_freertos_ti-arm-clang.out
lrwxrwxrwx 1 root root     16 May 25 17:02 am62x-pru0-fw -> pru/PRU_Halt.out
lrwxrwxrwx 1 root root     16 May 25 17:02 am62x-pru1-fw -> pru/PRU_Halt.out
drwxr-xr-x 2 root root   4096 Aug  4 20:21 cnm
drwxr-xr-x 2 root root   4096 Aug  4 20:24 pru
-rw-r--r-- 1 root root 143360 Jul  1 16:39 rgx.fw.36.53.104.796
-rw-r--r-- 1 root root 383128 Jul  1 16:39 rgx.sh.36.53.104.796
drwxr-xr-x 2 root root   4096 Oct 15 12:03 svayacode
drwxr-xr-x 2 root root   4096 Sep 30 09:12 ti-connectivity
drwxr-xr-x 2 root root   4096 Aug  4 20:21 ti-ipc



此致、
去巴希

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


    尊敬的专家:
    1->当我使用 IPC 做同样的事情时、您能告诉我原因吗?


    我们又遇到了1个问题、我们阅读了 IPC 文档、他们告诉我们在 linker.cmd 停止工作后、在它中做一些内存映射。
    https://software-dl.ti.com/mcu-plus-sdk/esd/AM62PX/10_00_00_14/exports/docs/api_guide_am62px/IPC_GUIDE.html

    这是我们在阅读该文档后更新的内容。

    Update linker command file
    
        When IPC RP Message is enabled, a shared memory is used to exchange packet buffers between different CPUs. This shared memory MUST be mapped to the same address across all CPUs.
        This is done via the linker command file as shown in below snippet taken from IPC RP Message Echo example
    
    /* specify the memory segment */
    MEMORY
    {
        ...
     
        /* shared memories that are used by RTOS/NORTOS cores */
        /* On R5F,
        * - make sure there is a MPU entry which maps below regions as non-cache
        */
        USER_SHM_MEM            : ORIGIN = 0x701D0000, LENGTH = 0x00004000
        LOG_SHM_MEM             : ORIGIN = 0x701D4000, LENGTH = 0x00004000
        RTOS_NORTOS_IPC_SHM_MEM : ORIGIN = 0x701D8000, LENGTH = 0x00008000
    }
     
     
    /* map the shared memory section to the memory segment */
    SECTION
    {
        ...
     
        /* General purpose user shared memory, used in some examples */
        .bss.user_shared_mem (NOLOAD) : {} > USER_SHM_MEM
        /* this is used when Debug log's to shared memory are enabled, else this is not used */
        .bss.log_shared_mem  (NOLOAD) : {} > LOG_SHM_MEM
        /* this is used only when IPC RPMessage is enabled, else this is not used */
        .bss.ipc_vring_mem   (NOLOAD) : {} > RTOS_NORTOS_IPC_SHM_MEM
    }
    

    我们看到 linker.cmd 在默认情况下已经设定的

    /* this is used only when IPC RPMessage is enabled, else this is not used */
        .bss.ipc_vring_mem   (NOLOAD) : {} > DDR_IPC_VRING_RTOS
        GROUP {
            /* This is the resource table used by linux to know where the IPC "VRINGs" are located */
            .resource_table: {} palign(1024)
        } > DDR_IPC_RESOURCE_TABLE_LINUX



    此致、
    去巴希

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

    Debashis、您好!

    首先、请参阅此 AM62Px Academy 页面、了解如何引导远程内核:
    https://dev.ti.com/tirex/explore/node?node=A__ASTUPTn5xbFkK9F0gRlUSw__AM62P-ACADEMY__fp5YxRM__LATEST 

    此外、它还将指导您如何检查与哪个远程内核关联的 remoteprocX 实例。 请记住、即使 remoteproc0与一个引导中的特定内核关联、它也可能在下次重新启动处理器时与另一个内核关联!

    接下来、请参阅 AM62Px Academy 的多核模块、了解如何开发与 Linux 一起运行的 R5F 应用:  

    https://dev.ti.com/tirex/explore/node?node=A__AW0cwnZVbDqRS5d4OiCx6A__AM62P-ACADEMY__fp5YxRM__LATEST

    请注意、除非添加资源表、否则 hello_world 示例将无法从 Linux 正确加载。 有关更多信息、请参考"远程内核上的应用开发"部分。

    有任何问题或反馈吗? 请告诉我  

    我是写了所有这些学院文件的人。 如果您对我有任何反馈、或者您有任何后续问题、请告诉我、我可以帮助您解决。

    此致、

    Nick

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

    您好、Nick。
    听得不错。 让我浏览一下这些链接、我会很快告诉您。

    请记住、即使 remoteproc0在一次启动时与特定内核关联、下次重新启动处理器时它也可能与其他内核关联!

    但我不会这么做。 因为根据我的理解、remoteproc0用于 R5、remoteproc1用于 wakeupR5。




    此致、
    去巴希

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

    Debashis、您好!

    您的理解是错误的。 确保与正确内核通信的唯一方法是检查 remoteproc*/name 值。

    remoteproc#和远程内核之间的关联可以为每个引导更改。 Remoteproc#未静态分配给特定内核。 而是按照 Linux 知道内核的顺序分配这些数字、这并不是确定性的。

    在具有大量内核的处理器上、这意味着您往往会看到一般模式(例如、在 AM64x 上、M4F 通常是 remoteproc0-1、R5F 内核通常是 remoteproc0-4、PRU 子系统内核通常是更高的数字)、但确切的数字仍会更改每个启动。

    此致、

    Nick

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

    您好、Nick。
    在执行某些操作之前检查名称是正确的。

    root@am62pxx-evm:~# head /sys/class/remoteproc/remoteproc *
    =>/sys/class/remoteproc/remoteproc0/name <=
    79000000.r5f

    =>/sys/class/remoteproc/remoteproc1/name <=
    78000000.r5f

    当我引用这个 https://software-dl.ti.com/mcu-plus-sdk/esd/AM62PX/10_00_00_14/exports/docs/api_guide_am62px/IPC_GUIDE.html 时、我有一件事要讨论的是文档

    "更新链接器命令文件"有一些不一定是必需的、在 MCU+SDK 工程示例中已经采取不同的做法。 因此、我使用它时、可能是因为资源表不匹配、Linux 无法引导 MCU 内核。


    此致
    去巴希

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

    Debashis、您好!

    请花更多时间浏览  多内核模块的"远程内核上的应用开发"部分。

    此处介绍的2个概念(以及一系列其他概念):
    https://dev.ti.com/tirex/explore/node?node=A__AWp5ySyLZuhSwoIuT2efPQ__AM62P-ACADEMY__fp5YxRM__LATEST

    1) 1)将资源表放置在 Linux devicetree 文件中的哪个位置、以匹配 MCU+ SDK 位置?

    2) 2)如何确保 Linux 不会覆盖远程内核使用的 DDR 和 SRAM 存储器位置?

    此致、

    Nick