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.

[参考译文] LP-AM243:无法调试 PRU 内核或 DMSC M3内核

Guru**** 2581625 points
Other Parts Discussed in Thread: LP-AM243, SYSCONFIG

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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1282925/lp-am243-unable-to-debug-pru-cores-nor-dmsc-m3-core

器件型号:LP-AM243
主题中讨论的其他器件: UNIFLASHSysConfig

我们当前正在 尝试一个简单的 LED 闪烁程序、它使用 PRU 中的 GPO;但是、我们无法连接到 PRU 内核、如下图所示。 内核卡在"Connecting: in Reset"状态。

根据 [FAQ] AM64x/AM24x:如何使用 Code Composer Studio (CCS)连接到 PRU_ICSSG?、连接到 DMSC 内核似乎对于连接到 PRU 内核很重要。 但是、当我们尝试启动目标配置并手动连接到该内核时、我们的 LP-AM243模型似乎难以连接到 DMSC_Cortex_M3_0内核。

DMSC_Cortex_M3_0: Error connecting to the target: (Error -1170 @ 0x0) Unable to access the DAP. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.13.0.00201) 
基于 LP-AM243:DAP 访问 Sitara 器件(am263x、amd243x)备用内核时出现 CCS 调试问题、我们似乎需要在连接内核之前初始化 SOC。 我们根据 SOC 初始化运行了 SOC 初始化脚本和闪存 SOC 初始化二进制指令。 我们能够从脚本本身成功地从 R5内核获得正确的日志、但没有从  DMSC_Cortex_M3_0获得正确的控制台窗口响应。

[MAIN_Cortex_R5_0_0] 
DMSC Firmware Version 9.0.7--v09.00.07 (Kool Koala)
DMSC Firmware revision 0x9
DMSC ABI revision 3.1

[SCICLIENT] ABI check PASSED 
[SCICLIENT] Board Configuration with Debug enabled ...
[SCICLIENT] Common Board Configuration PASSED 
[SCICLIENT] PM Board Configuration PASSED 
[SCICLIENT] RM Board Configuration PASSED 
[SCICLIENT] Security Board Configuration PASSED 

DMSC Firmware Version 9.0.7--v09.00.07 (Kool Koala)
DMSC Firmware revision 0x9
DMSC ABI revision 3.1

Starting SOC Initialization ...
Resetting self cluster ...
Initializing ... (Completed)

js:> loadJSFile "C:\ti\mcu_plus_sdk_am243x_09_00_00_35\tools\ccs_load\am243x\load_dmsc_hsfs.js"
Connecting to MCU Cortex_R5_0!
Writing While(1) for R5F
Running the board configuration initialization from R5!
Happy Debugging!!

js:> 

我们还确保按照说明刷写 SOC 初始化二进制文件、并获得了成功的结果。

C:\ti\mcu_plus_sdk_am243x_09_00_00_35\tools\boot>python uart_uniflash.py -p COM8 --cfg=sbl_prebuilt/am243x-lp/default_sbl_null.cfg

Parsing config file ...
Parsing config file ... SUCCESS. Found 2 command(s) !!!

Executing command 1 of 2 ...
Found flash writer ... sending sbl_prebuilt/am243x-lp/sbl_uart_uniflash.release.hs_fs.tiimage
Sent flashwriter sbl_prebuilt/am243x-lp/sbl_uart_uniflash.release.hs_fs.tiimage of size 296773 bytes in 26.59s.

Executing command 2 of 2 ...
Command arguments : --file=sbl_prebuilt/am243x-lp/sbl_null.release.hs_fs.tiimage --operation=flash --flash-offset=0x0
Sent sbl_prebuilt/am243x-lp/sbl_null.release.hs_fs.tiimage of size 260828 bytes in 24.68s.
[STATUS] SUCCESS !!!

All commands from config file are executed !!!

Starting NULL Bootloader ... 

DMSC Firmware Version 9.0.7--v09.00.07 (Kool Koala)
DMSC Firmware revision 0x9
DMSC ABI revision 3.1

INFO: Bootloader_runCpu:155: CPU r5f1-0  is initialized to 800000000 Hz !!!
INFO: Bootloader_runCpu:155: CPU r5f1-1 is initialized to 800000000 Hz !!!
INFO: Bootloader_runCpu:155: CPU m4f0-0 is initialized to 400000000 Hz !!!
INFO: Bootloader_loadSelfCpu:207: CPU r5f0-0 is initialized to 800000000 Hz !!!
INFO: Bootloader_loadSelfCpu:207: CPU r5f0-1 is initialized to 800000000 Hz !!!
INFO: Bootloader_runSelfCpu:217: All done, reseting self ...

同样、我们的主要目标是通过来自 PRU 的 GPO 使 LED 闪烁。 我们不知道这是软件问题还是硬件问题。 如果有任何帮助,我们将不胜感激!  

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

    您好、Niel:

    请参考此文档并告诉我它是否对您有效: https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1261762/lp-am243-am243x-hs-device---access-pru-cores-with-load_dmsc-js-script-not-possible

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

    尼尔

    我希望您不要运行 load_dmsc 脚本、SBL 为 NULL。 这不是必需的、因为两者都执行相同的操作。

    [quote userid="580831" url="~/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1282925/lp-am243-unable-to-debug-pru-cores-nor-dmsc-m3-core 我们目前正在 尝试从 PRU 获取一个可与 GPO 配合使用的简单 LED 闪烁程序;但是、我们无法连接到 PRU 内核、如下图所示。 内核卡在"正在连接:处于重置"状态。

    无法连接的原因是默认情况下不向 PRU-ICSSG 模块提供时钟。 如果您的 GPIO 示例有 R5F 应用、您可以从 CCS 中的 SysConfig 启用 PRU-ICSSG、这将为 PRU-ICSSG 启用时钟。 运行该 R5F 应用后、您将能够连接到使用 SysConfig 启用的 PRU-ICSSG 的 PRU 内核。

    此致
    达瓦尔

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

    如果 PRU 内核仅适用于具有正确设置的.syscfg 文件的工程、则最好的方法是使用正确设置的.syscfg 文件创建新工程。 我创建了一个空项目,并能够在遇到编译问题之前了解这一点。

    这是我编写的一些能编译的最低限度的可行代码。 它应该打开 一个引脚。

    #include <stdint.h>
    #include <pru_ctrl.h>
    volatile register uint32_t __R30;   // output register
    volatile register uint32_t __R31;   // input register
    #define PIN_SET(pin) (__R30 |=  (1 << pin))
    int main(void)
    {
        PIN_SET(0);
    }
    

    但是、在添加.sysconfig 文件后、我无法使代码编译。 出现了这些错误。  

    **** Build of configuration Debug for project blinky ****
    
    "C:\\ti\\ccs1230\\ccs\\ccs\\utils\\bin\\gmake" -k -j 8 all -O 
     
    Building file: "syscfg/ti_pinmux_config.c"
    Invoking: PRU Compiler
    "C:/ti/ccs1230/ccs/ccs/tools/compiler/ti-cgt-pru_2.3.3/bin/clpru" --include_path="C:/ti/ccs1230/ccs/ccs/ccs_base/pru/include" --include_path="C:/ti/mcu_plus_sdk_am243x_09_00_00_35/source/pru_io/firmware/common" --include_path="C:/ti/ccs1230/ccs/ccs/tools/compiler/ti-cgt-pru_2.3.3/include" --include_path="C:/ti/mcu_plus_sdk_am243x_09_00_00_35/source" --include_path="C:/ti/mcu_plus_sdk_am243x_09_00_00_35" --include_path="C:/ti/pru-software-support-package/include/am64x" --include_path="C:/Users/GuanNe083/workspace_v13/blinky" --include_path="C:/ti/ccs1230/ccs/ccs/tools/compiler/ti-cgt-pru_2.3.3/include" -g --diag_warning=225 --diag_wrap=off --display_error_number --endian=little --preproc_with_compile --preproc_dependency="syscfg/ti_pinmux_config.d_raw" --include_path="C:/Users/GuanNe083/workspace_v13/blinky/Debug/syscfg" --obj_directory="syscfg"  "syscfg/ti_pinmux_config.c"
     
    >> Compilation failure
    subdir_rules.mk:38: recipe for target 'syscfg/ti_pinmux_config.obj' failed
    "syscfg/ti_pinmux_config.c", line 39: error #20: identifier "Pinmux_PerCfg_t" is undefined
    "syscfg/ti_pinmux_config.c", line 41: error #20: identifier "PINMUX_END" is undefined
    "syscfg/ti_pinmux_config.c", line 44: error #20: identifier "Pinmux_PerCfg_t" is undefined
    "syscfg/ti_pinmux_config.c", line 54: warning #225-D: function "Pinmux_config" declared implicitly
    "syscfg/ti_pinmux_config.c", line 54: error #20: identifier "PINMUX_DOMAIN_ID_MAIN" is undefined
    "syscfg/ti_pinmux_config.c", line 55: error #20: identifier "PINMUX_DOMAIN_ID_MCU" is undefined
    5 errors detected in the compilation of "syscfg/ti_pinmux_config.c".
    gmake: *** [syscfg/ti_pinmux_config.obj] Error 1
    Building file: "syscfg/ti_drivers_config.c"
    Invoking: PRU Compiler
    "C:/ti/ccs1230/ccs/ccs/tools/compiler/ti-cgt-pru_2.3.3/bin/clpru" --include_path="C:/ti/ccs1230/ccs/ccs/ccs_base/pru/include" --include_path="C:/ti/mcu_plus_sdk_am243x_09_00_00_35/source/pru_io/firmware/common" --include_path="C:/ti/ccs1230/ccs/ccs/tools/compiler/ti-cgt-pru_2.3.3/include" --include_path="C:/ti/mcu_plus_sdk_am243x_09_00_00_35/source" --include_path="C:/ti/mcu_plus_sdk_am243x_09_00_00_35" --include_path="C:/ti/pru-software-support-package/include/am64x" --include_path="C:/Users/GuanNe083/workspace_v13/blinky" --include_path="C:/ti/ccs1230/ccs/ccs/tools/compiler/ti-cgt-pru_2.3.3/include" -g --diag_warning=225 --diag_wrap=off --display_error_number --endian=little --preproc_with_compile --preproc_dependency="syscfg/ti_drivers_config.d_raw" --include_path="C:/Users/GuanNe083/workspace_v13/blinky/Debug/syscfg" --obj_directory="syscfg"  "syscfg/ti_drivers_config.c"
     
    >> Compilation failure
    subdir_rules.mk:38: recipe for target 'syscfg/ti_drivers_config.obj' failed
    "syscfg/ti_drivers_config.c", line 43: error #20: identifier "PRUICSS_HwAttrs" is undefined
    "syscfg/ti_drivers_config.c", line 46: error #20: identifier "PRUICSS_Object" is undefined
    "syscfg/ti_drivers_config.c", line 48: error #20: identifier "PRUICSS_Config" is undefined
    "syscfg/ti_drivers_config.c", line 77: error #20: identifier "CSL_CORE_ID_R5FSS0_0" is undefined
    "syscfg/ti_drivers_config.c", line 83: warning #225-D: function "SOC_getSelfCpuClk" declared implicitly
    "syscfg/ti_drivers_config.c", line 90: warning #225-D: function "PRUICSS_init" declared implicitly
    "syscfg/ti_drivers_config.c", line 96: warning #225-D: function "PRUICSS_deinit" declared implicitly
    4 errors detected in the compilation of "syscfg/ti_drivers_config.c".
    gmake: *** [syscfg/ti_drivers_config.obj] Error 1
    Building file: "syscfg/ti_power_clock_config.c"
    Invoking: PRU Compiler
    "C:/ti/ccs1230/ccs/ccs/tools/compiler/ti-cgt-pru_2.3.3/bin/clpru" --include_path="C:/ti/ccs1230/ccs/ccs/ccs_base/pru/include" --include_path="C:/ti/mcu_plus_sdk_am243x_09_00_00_35/source/pru_io/firmware/common" --include_path="C:/ti/ccs1230/ccs/ccs/tools/compiler/ti-cgt-pru_2.3.3/include" --include_path="C:/ti/mcu_plus_sdk_am243x_09_00_00_35/source" --include_path="C:/ti/mcu_plus_sdk_am243x_09_00_00_35" --include_path="C:/ti/pru-software-support-package/include/am64x" --include_path="C:/Users/GuanNe083/workspace_v13/blinky" --include_path="C:/ti/ccs1230/ccs/ccs/tools/compiler/ti-cgt-pru_2.3.3/include" -g --diag_warning=225 --diag_wrap=off --display_error_number --endian=little --preproc_with_compile --preproc_dependency="syscfg/ti_power_clock_config.d_raw" --include_path="C:/Users/GuanNe083/workspace_v13/blinky/Debug/syscfg" --obj_directory="syscfg"  "syscfg/ti_power_clock_config.c"
     
    >> Compilation failure
    subdir_rules.mk:38: recipe for target 'syscfg/ti_power_clock_config.obj' failed
    "syscfg/ti_power_clock_config.c", line 49: error #20: identifier "TISCI_DEV_PRU_ICSSG0" is undefined
    "syscfg/ti_power_clock_config.c", line 55: error #20: identifier "TISCI_DEV_PRU_ICSSG0_CORE_CLK" is undefined
    "syscfg/ti_power_clock_config.c", line 56: error #20: identifier "TISCI_DEV_PRU_ICSSG0_UCLK_CLK" is undefined
    "syscfg/ti_power_clock_config.c", line 57: error #20: identifier "TISCI_DEV_PRU_ICSSG0_IEP_CLK" is undefined
    "syscfg/ti_power_clock_config.c", line 69: warning #225-D: function "SOC_moduleClockEnable" declared implicitly
    "syscfg/ti_power_clock_config.c", line 70: error #20: identifier "SystemP_SUCCESS" is undefined
    "syscfg/ti_power_clock_config.c", line 82: warning #225-D: function "SOC_moduleClockEnable" declared implicitly
    "syscfg/ti_power_clock_config.c", line 83: error #20: identifier "SystemP_SUCCESS" is undefined
    "syscfg/ti_power_clock_config.c", line 95: warning #225-D: function "SOC_moduleSetClockFrequency" declared implicitly
    "syscfg/ti_power_clock_config.c", line 100: error #20: identifier "SystemP_SUCCESS" is undefined
    7 errors detected in the compilation of "syscfg/ti_power_clock_config.c".
    gmake: *** [syscfg/ti_power_clock_config.obj] Error 1
    gmake: Target 'all' not remade because of errors.
    
    **** Build Finished ****
    

    您能否提供有关如何修复这些编译问题的任何见解、或者这是正确的方法吗?

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

    尼尔

    您是否具有适用于 R5F 内核的任何 CCS 项目? 或者您是否只有适用于 PRU 内核的 CCS 项目?

    SysConfig 仅适用于 R5F 工程。 我想您正在尝试将 SysConfig 添加到 PRU 项目、但这样不起作用。  

    此致
    达瓦尔

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

    感谢您的帮助! 是的、我在 syscfg 中使用了 empty_am243x-lp_r5fss0-0_freertos_ti-arm-clang 来启用 PRU 内核、并且我使用了该项目的目标配置来连接到器件。 为了使用正确的代码对 PRU 内核进行刷写、我们没有使用工具栏中的闪存按钮对其进行刷写、而是在启动目标配置后、我们在 run -> load -> project_name.out 下对其进行了刷写。 我们都是在 OSPI 模式下完成这一切的。 该过程在一定程度上遵循文档中的实验、尽管由于它不是专门为 AM243-LP 编写的、但有些步骤是不同的。  

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

    尼尔

    您能否在此处分享您的 CCS 项目? 这将使我更容易进一步提供帮助。

    此致
    达瓦尔