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.

[FAQ] [参考译文] [常见问题解答] PROCESSOR-SDK-AM64X:从 PRU-ICSSG 访问 DDR

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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1236795/faq-processor-sdk-am64x-accessing-ddr-from-pru-icssg

器件型号:PROCESSOR-SDK-AM64X
主题中讨论的其他器件:SysConfig

您好!

您能帮助我从 PRU 内核访问 DDR 吗?

此常见问题解答中的信息适用于所有具有 PRU_ICSSG 的 Sitara 处理器:AM24x、AM64x、AM65x。 在 AM64x 上测试了该示例。

此常见问题解答的基本概念也适用于采用其他类型 PRU 子系统的 Sitara 处理器:

AM335x、AM437x、AM57x:
有关如何从 CCS 或 Linux 内核初始化 PRU 内核的信息、请参阅 PRU 入门实验。 这些较旧的 PRU-ICSS 器件需要先启用 OCP 端口、然后再允许在 PRU 子系统之外进行读取和写入。 有关启用 OCP 端口的示例、请参考相关器件的 RPMsg_Echo_Interrupt 固件: https://git.ti.com/cgit/pru-software-support-package/pru-software-support-package/tree/examples/am335x/PRU_RPMsg_Echo_Interrupt0/main.c 

AM62x: 有关如何从 CCS 或 Linux 内核初始化 PRU 内核的信息、请参阅 PRU 入门实验

有关多核主题的更多信息、请参阅  Sitara 多核开发和文档常见问题解答

有关 PRU 的"入门"信息、包括如何从 CCS 或 Linux 内核初始化 PRU 内核、请参阅 PRU 入门实验。

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

    此示例将使用 IEP 计时器对存储器访问进行时间戳记。 但是、PRU_CYCLE 寄存器也可用于计算存储器访问占用的时钟周期数。 有关使用 PRU_CYCLE 寄存器的详细信息、请参考 这篇文章。  

    前提条件:

    1. 遵循入门步骤(请参阅 https://software-dl.ti.com/mcu-plus-sdk/esd/AM64X/08_05_00_24/exports/docs/api_guide_am64x/GETTING_STARTED.html)
    2. 导入和构建 Hello World 示例(请参见 https://software-dl.ti.com/mcu-plus-sdk/esd/AM64X/latest/exports/docs/api_guide_am64x/GETTING_STARTED_BUILD.html)
      1. 如下所示更新 hello_world.c 文件(添加 while (1);)
      2. Fullscreen
        1
        2
        3
        4
        5
        6
        7
        8
        9
        10
        11
        12
        13
        14
        15
        16
        17
        18
        19
        20
        21
        /*
        * Copyright (C) 2018-2021 Texas Instruments Incorporated
        *
        * Redistribution and use in source and binary forms, with or without
        * modification, are permitted provided that the following conditions
        * are met:
        *
        * Redistributions of source code must retain the above copyright
        * notice, this list of conditions and the following disclaimer.
        *
        * Redistributions in binary form must reproduce the above copyright
        * notice, this list of conditions and the following disclaimer in the
        * documentation and/or other materials provided with the
        * distribution.
        *
        * Neither the name of Texas Instruments Incorporated nor the names of
        * its contributors may be used to endorse or promote products derived
        * from this software without specific prior written permission.
        *
        * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
        * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    3. 更改了 example.sysconfig
      1. 添加 PRU 实例
      2. 将 IEP clk 值更新为500MHz 以获取价格时间戳  
    4. 重新构建
    5. 导入和编译 CCS 工程(C:\MCU_PLUS_SDK\examples\PRU_IO\empty\firmware\am64x-evm)  
    6. 如下所示更新 main.asm 文件()
      1. 请参阅 TRM 第6.4.12节 PRU_ICSSG_IEP 了解 IEP 时间戳

      2. main.asm 文件如下所示
      3. Fullscreen
        1
        2
        3
        4
        5
        6
        7
        8
        9
        10
        11
        12
        13
        14
        15
        16
        17
        18
        19
        20
        21
        ; Copyright (C) 2022 Texas Instruments Incorporated - http://www.ti.com/
        ;
        ; Redistribution and use in source and binary forms, with or without
        ; modification, are permitted provided that the following conditions
        ; are met:
        ;
        ; Redistributions of source code must retain the above copyright
        ; notice, this list of conditions and the following disclaimer.
        ;
        ; Redistributions in binary form must reproduce the above copyright
        ; notice, this list of conditions and the following disclaimer in the
        ; documentation and/or other materials provided with the
        ; distribution.
        ;
        ; Neither the name of Texas Instruments Incorporated nor the names of
        ; its contributors may be used to endorse or promote products derived
        ; from this software without specific prior written permission.
        ;
        ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
        ; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
        ; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      4. 重新构建
    7. 假设遵循 OSPI 加载方法(因为该方法将负责 DDR 的初始化)  
      1. 请参阅https://software-dl.ti.com/mcu-plus-sdk/esd/AM64X/latest/exports/docs/api_guide_am64x/EVM_SETUP_PAGE.html"的"Flash SOC 初始化二进制"部分
    8. 连接 R5F_0_0
    9. 加载 二进制
    10. 运行它
    11. 现在、连接 PRU_0或 PRU_1并将其作为
    12. 加载 二进制
    13. 添加断点
    14. 运行它
    15. 将达到断点
    16. 然后、转到菜单栏=> View => Registers
    17. 检查所选 PRU 的 R2和 R4寄存器的内容
      1. 应为0x00000004  

    此致