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.

[参考译文] AM62P:使用窗口化看门狗计时器生成复位

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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1642815/am62p-using-windowed-watchdog-timer-to-generate-reset

部件号: AM62P

您好、

我想使用窗口化看门狗计时器通过不及时维护看门狗来生成复位。 我使用的示例是“mcu_plus_sdk_am62px_11_01_08/examples/sdl/RTI/uc1“中的“RTI_app_uc1“。 我通过如下修改代码将 WWD 反应配置为 GENERATE_RESET。

/* Configure RTI parameters */
    pConfig.SDL_RTI_dwwdPreloadVal = RTIGetPreloadValue(RTI_CLOCK_SOURCE_32KHZ, RTI_WDT_TIMEOUT);
    pConfig.SDL_RTI_dwwdWindowSize = RTI_DWWD_WINDOWSIZE_100_PERCENT;
    pConfig.SDL_RTI_dwwdReaction   = RTI_DWWD_REACTION_GENERATE_RESET;

我为 WWD 配置的时间间隔为 3s。 在启动 WWD 后、我实施一个 4s 延迟来生成 WWD 超时。 但我发现超时剂量不会触发 MCU 复位、因此代码可以继续运行。

我附上下面的相关代码和日志。

int32_t SDL_RTI_exampleTest(void)
{
    uint32_t rtiModuleBase;
	uint32_t closedWinStatus;
    int32_t  retVal = SDL_PASS;
    SDL_RTI_configParms     pConfig;
    SDL_RTI_staticRegs         pStaticRegs;

#if defined (SOC_AM62X)
#if defined (M4F_CORE)
    rtiModuleBase = SDL_MCU_RTI0_CFG_BASE;
#endif
#if defined (R5F_CORE)
    rtiModuleBase = SDL_WKUP_RTI0_CFG_BASE;
#endif
#endif
#if defined (SOC_AM62AX) || defined (SOC_AM62PX) || defined (SOC_AM62DX) || defined (SOC_J722S)
    rtiModuleBase = SDL_MCU_RTI0_CFG_BASE;
#endif
#if defined (SOC_AM275X)
    rtiModuleBase = SDL_WKUP_RTI0_CFG_BASE;
#endif
    DebugP_log("RTI Example code UC-1 started\r\n");

    /* Register Interrupt */
    isrFlag = RTI_NO_INTERRUPT;

    /* Configure RTI parameters */
    pConfig.SDL_RTI_dwwdPreloadVal = RTIGetPreloadValue(RTI_CLOCK_SOURCE_32KHZ, RTI_WDT_TIMEOUT);
    pConfig.SDL_RTI_dwwdWindowSize = RTI_DWWD_WINDOWSIZE_100_PERCENT;
    pConfig.SDL_RTI_dwwdReaction   = RTI_DWWD_REACTION_GENERATE_RESET;

    /* Select RTI module clock source */
    RTISetClockSource(rtiModuleBase, RTI_CLOCK_SOURCE_32KHZ);

#if defined (SOC_AM62X)
#if defined (M4F_CORE)
    retVal = SDL_RTI_config(SDL_INSTANCE_MCU_RTI0_CFG, &pConfig);
#endif
#if defined (R5F_CORE)
    retVal = SDL_RTI_config(SDL_INSTANCE_WKUP_RTI0, &pConfig);
#endif
#endif
#if defined (SOC_AM62AX) || defined (SOC_AM62PX) || defined (SOC_AM62DX) || defined (SOC_J722S)
    retVal = SDL_RTI_config(SDL_INSTANCE_MCU_RTI0_CFG, &pConfig);
#endif
#if defined (SOC_AM275X)
    retVal = SDL_RTI_config(SDL_INSTANCE_WKUP_RTI0, &pConfig);
#endif

    if (retVal == SDL_EFAIL)
    {
        DebugP_log("Error during Window configuration.\r\n");
    }

    /* Verify the config */
#if defined (SOC_AM62X)
#if defined (M4F_CORE)
    retVal = SDL_RTI_verifyConfig(SDL_INSTANCE_MCU_RTI0_CFG, &pConfig);
#endif
#if defined (R5F_CORE)
    retVal = SDL_RTI_verifyConfig(SDL_INSTANCE_WKUP_RTI0, &pConfig);
#endif
#endif
#if defined (SOC_AM62AX) || defined (SOC_AM62PX) || defined (SOC_AM62DX) || defined (SOC_J722S)
    retVal = SDL_RTI_verifyConfig(SDL_INSTANCE_MCU_RTI0_CFG, &pConfig);
#endif
#if defined (SOC_AM275X)
    retVal = SDL_RTI_verifyConfig(SDL_INSTANCE_WKUP_RTI0, &pConfig);
#endif

    if (retVal == SDL_EFAIL)
    {
        DebugP_log("Error during Window Verify configuration.\r\n");
    }

    if (retVal == SDL_PASS)
    {
#if defined (SOC_AM62X)
#if defined (M4F_CORE)
        SDL_RTI_readStaticRegs(SDL_INSTANCE_MCU_RTI0_CFG, &pStaticRegs);
#endif
#if defined (R5F_CORE)
        SDL_RTI_readStaticRegs(SDL_INSTANCE_WKUP_RTI0, &pStaticRegs);
#endif
#endif
#if defined (SOC_AM62AX) || defined (SOC_AM62PX) || defined (SOC_AM62DX) || defined (SOC_J722S)
        SDL_RTI_readStaticRegs(SDL_INSTANCE_MCU_RTI0_CFG, &pStaticRegs);
#endif
#if defined (SOC_AM275X)
        SDL_RTI_readStaticRegs(SDL_INSTANCE_WKUP_RTI0, &pStaticRegs);
#endif

        switch(pStaticRegs.RTI_WWDSIZECTRL)
        {
            case RTI_RTIDWWDSIZECTRL_DWWDSIZE_100_PERCENT:
                DebugP_log("   DWWD configured to 100 percent window size\r\n");
                break;
            case RTI_RTIDWWDSIZECTRL_DWWDSIZE_50_PERCENT:
                DebugP_log("   DWWD configured to 50 percent window size\r\n");
                break;
            case RTI_RTIDWWDSIZECTRL_DWWDSIZE_25_PERCENT:
                DebugP_log("   DWWD configured to 25 percent window size\r\n");
                break;
            case RTI_RTIDWWDSIZECTRL_DWWDSIZE_12_5_PERCENT:
                DebugP_log("   DWWD configured to 6.25 percent window size\r\n");
                break;
            case RTI_RTIDWWDSIZECTRL_DWWDSIZE_6_25_PERCENT:
                DebugP_log("   DWWD configured to 3.125 percent window size\r\n");
                break;
        }

        DebugP_log("   DWWD is configured for %u ms time-out \r\n", RTI_WDT_TIMEOUT);

         /* UC1: Configure RTI and servicing for some time */
        DebugP_log("\r\nRTI DWWD proper servicing test running. \r\n");
        DebugP_log("   Please wait for max %d ms. \r\n\r\n", RTI_WDT_TIMEOUT);

        isrFlag = RTI_NO_INTERRUPT;

SDL_RTI_start(SDL_INSTANCE_MCU_RTI0_CFG);

        /* Servicing DWWD before testing for window end */
        RTIDwwdIsClosedWindow(rtiModuleBase, &closedWinStatus);
        while (closedWinStatus == TRUE)
        {
            RTIDwwdIsClosedWindow(rtiModuleBase, &closedWinStatus);
            /* Keep checking till window is open. */
            SDL_DPL_delay(1U);
        }

DebugP_log("Not servicing the WWD on time... \r\n");
SDL_DPL_delay(4);
DebugP_log("whether could be here? \r\n");

// SDL_RTI_service(SDL_INSTANCE_MCU_RTI0_CFG);


        if (isrFlag != RTI_NO_INTERRUPT)
        {
            /* DWWD interrupt is generated when it is not expected to. */
            retVal = SDL_EFAIL;
        }
        if (retVal == SDL_PASS)
        {
            DebugP_log("RTI DWWD proper servicing test successful. \r\n\r\n");
        }
        else
        {
            DebugP_log("RTI DWWD proper servicing test failed. \r\n");
        }

		 /* UC1: RTI is configured to 100% window size and starting the DWWD but not servicing,
		    this will expire the window period and it will generate interrupt to ESM and
			thus result in permanant failure */

		DebugP_log("\r\nRTI permanent failure test running. \r\n");
        DebugP_log("   DWWD will generate interrupt after %d seconds\r\n", (RTI_WDT_TIMEOUT/1000));

screenshot-20260506-111138.png

BR、

Bomiao

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

    上面附加了所使用的 ESM 初始化配置。 我尝试为 WKUP_ESM0 启用 MCU_RTI0_INTR。 我使用的 MCU+SDK 为 11.01.08。 我想知道我的 ESM 配置是否正确?

    BR、

    Bomiao

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

    您好 Bomiao、

    请按照下面的常见问题解答配置结构参数。 只需配置启用位图和优先级位图字段。

    仅启用第 85 个中断、以将 MCU RTI 中断路由到 WKUP ESM。 所有其他位应配置为零。

    如果您遇到任何问题、请告诉我

     【常见问题解答】AM64X/AM62X:当 WDT 计时器在 AM64X 和 AM62X 到期时如何复位 SOC? 

    	.enableBitmap = {0x00000000u, 0x00000000u, 0x00200000u, 0x00000000u,
    					  0x00000000u, 0x00000000u,
    					 },
    	/**< All events enable: except timer and self test  events, */
    	/*    and Main ESM output.Configured based off esmErrorConfig to test high or low priorty events.*/
    	.priorityBitmap = {0x00000000u, 0x00000000u, 0x00200000u, 0x00000000u,
    						0x00000000u, 0x00000000u,
    					   },
    	/**< Configured based off esmErrorConfig to test high or low priorty events. */
    	.errorpinBitmap = {0x00000000u, 0x00000000u, 0x00200000u, 0x00000000u,
    						 0x00000000u, 0x00000000u,

    此致、

    Anil.

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

    尊敬的 Swargam:

    调整 ESM 中断使能映射后、我可以生成复位。 但是、我发现、无论 pConfig.SDL_RTI_dwwdReaction 设置为 RTI_RTIDWWDRXNCTRL_DWWDRXN_INTERRUPT 或 RTI_RTIDWWDRXNCTRL_DWWDRXN_RESET、WWDG 超时始终会触发主域复位。 这种现象是否正确? 我认为 主域复位只会 通过生成  

    pConfig.SDL_RTI_dwwdReaction   = RTI_DWWD_REACTION_GENERATE_RESET.


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

    您好 Bomiao、

    在上面的常见问题解答中、有一个 CTRL MMR 寄存器用于确定 WDT 到期后 SOC 是否接收到复位。
    如果设置了该位、则无论 pConfig.SDL_RTI_dwwdReaction 设置 (RTI_DWWD_REACTION_GENERATE_RESET 或如何
    RTI_DWWD_REACTION_GENERATE_INTERRUPT)、SOC 将始终复位。

    此致、
    Anil

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

    尊敬的 Anil:

    非常感谢您的解释和耐心。 该主题可能已关闭。

    此致、

    Bomiao