Other Parts Discussed in Thread: AM62P
器件型号: SK-AM62-LP
主题: AM62P 中讨论的其他器件
如何使用 mcupsdk 从 R5 MCU 发出自复位命令? 我尝试了驱动程序和示例中的几种方法、但它要么不执行任何操作、冻结 MCU、要么还会复位 MPU。 我只需要自行复位 R5(工程要求)。
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.
Other Parts Discussed in Thread: AM62P
器件型号: SK-AM62-LP
主题: AM62P 中讨论的其他器件
如何使用 mcupsdk 从 R5 MCU 发出自复位命令? 我尝试了驱动程序和示例中的几种方法、但它要么不执行任何操作、冻结 MCU、要么还会复位 MPU。 我只需要自行复位 R5(工程要求)。
您好、
您可以使用 Sciclient_pmSetModuleState API 来执行此操作、请参阅 Bootloader_soccpuPowerOnResetR5f 作为参考、SBL 使用该参考来向 soc R5 内核发出上电复位: https://github.com/TexasInstruments/mcupsdk-core-k3/blob/k3_main/source/drivers/bootloader/mcu/am62px/bootloader_soc.c#L634
请注意、一旦您为内核发出复位命令、也需要重新配置 MPU。
我尝试了驱动程序和示例中的几种方法、但它要么不起作用、要么冻结 MCU、要么重置 MPU。
您能告诉我您尝试使用哪些 API、并提供有关用例和您面临问题的更多详细信息吗?
此致、
会面。
usease 是我们在产品中提供的一个 RESET 命令、而且 assert() 函数必须重置。
以下是我尝试过的 API 及其结果进行了注释:
// Freezes R5: Sciclient_pmSetModuleRst_flags(TISCI_DEV_MCU_R5FSS0_CORE0, 1, 0, SystemP_WAIT_FOREVER); Sciclient_pmSetModuleRst_flags(TISCI_DEV_MCU_R5FSS0_CORE0, 0, 0, SystemP_WAIT_FOREVER); // Freezes R5: Sciclient_pmSetModuleRst(TISCI_DEV_MCU_R5FSS0_CORE0, 1, SystemP_WAIT_FOREVER); Sciclient_pmSetModuleRst(TISCI_DEV_MCU_R5FSS0_CORE0, 0, SystemP_WAIT_FOREVER); // Resets entire SoC: Sciclient_pmDeviceReset(SystemP_WAIT_FOREVER);
根据您的建议、我实现了类似的复位功能:
Sciclient_pmSetModuleState(TISCI_DEV_MCU_R5FSS0_CORE0, TISCI_MSG_VALUE_DEVICE_SW_STATE_AUTO_OFF, TISCI_MSG_FLAG_AOP, SystemP_WAIT_FOREVER); Sciclient_pmSetModuleState(TISCI_DEV_MCU_R5FSS0_CORE0, TISCI_MSG_VALUE_DEVICE_SW_STATE_ON, TISCI_MSG_FLAG_AOP, SystemP_WAIT_FOREVER);
但随后什么也没有发生。 这里有什么遗漏的吗?
尊敬的 Anderson:
抱歉、如果您尝试从 WKUP R5 等任何其他内核复位 MCU R5、那么应该使用之前的 API、我知道您的要求是从 MCU R5 本身上运行的应用程序触发 MCU R5 的复位。 为此、请尝试按以下顺序操作、并告诉我这样做是否有效:
int32_t SelfReset_mcuR5Reset(void)
{
int32_t status = SystemP_SUCCESS;
uint32_t sciclientCpuProcIdCore0;
uint32_t sciclientCpuDevIdCore0;
/* Get processor and device IDs for MCU R5FSS0 Core 0 */
sciclientCpuProcIdCore0 = SCICLIENT_PROC_ID_MCU_R5FSS0_CORE0;
sciclientCpuDevIdCore0 = TISCI_DEV_MCU_R5FSS0_CORE0;
/*
* SYSFW will block until a WFI is issued, thus allowing the following commands
* to be queued so this cluster may be reset by SYSFW (queue length is defined in
* "source/drivers/sciclient/include/tisci/{soc}/tisci_sec_proxy.h". If these commands
* were to be issued and executed prior to WFI, the cluster would enter reset and
* the core would not be able to tell SYSFW to take itself out of reset.
*/
status = Sciclient_procBootWaitProcessorState(sciclientCpuProcIdCore0,
1, 1, 0, 3, 0, 0, 0, SystemP_WAIT_FOREVER);
if (status != SystemP_SUCCESS)
{
return status;
}
/* Assert module reset */
if (status == SystemP_SUCCESS)
{
status = Sciclient_pmSetModuleRst_flags(sciclientCpuDevIdCore0, 1, 0,
SystemP_WAIT_FOREVER);
}
/* Release the processor control */
if (status == SystemP_SUCCESS)
{
status = Sciclient_procBootReleaseProcessor(sciclientCpuProcIdCore0, 0,
SystemP_WAIT_FOREVER);
}
/* De-assert module reset */
if (status == SystemP_SUCCESS)
{
status = Sciclient_pmSetModuleRst_flags(sciclientCpuDevIdCore0, 0, 0,
SystemP_WAIT_FOREVER);
}
if (status == SystemP_SUCCESS)
{
/* Disable interrupts if enabled */
HwiP_disable();
/* Flush all caches to ensure data coherency */
CacheP_wbInvAll(CacheP_TYPE_ALL);
/* Execute WFI - SYSFW will now execute the above commands and reset the core */
__asm__ __volatile__ ("wfi" "\n\t": : : "memory");
}
return status;
}
此致、
会面。
您好,感谢您的答复。
遗憾的是、这种方法不起作用。 MCU 仍然冻结。 调试时、我可以验证:
我还能或应该研究些什么?
此致、
Anderson
冻结表示内核停止运行、不会重新启动应用程序。
我不使用 CCS、我使用一组 Makefile 来编译代码。 但是、如果我在发出自复位命令后尝试将调试器连接到 MCU、OpenOCD 会显示此错误:
INFO:在 TCP/50006 上接受'gdb'连接
信息:am62p.cpu.mcu0_r5.0:硬件有 8 个断点和 8 个观察点
错误:等待 DSCR 位更改超时
错误:等待暂停时出错
错误:[am62p.cpu.mcu0_r5.0]事件 gdb-attach 执行失败:
信息:新 GDB 连接:1、目标 am62p.cpu.mcu0_r5.0、状态:正在运行
警告:[am62p.cpu.mcu0_r5.0] GDB 连接 1 未停止
错误:寄存器映射尚不可用、目标未完全初始化
请注意、当应用程序正常运行时、调试是有效的。