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.

[参考译文] CC1352R:在 BIM (引导加载程序)中启用 RTC 以测量总运行时间

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

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1178651/cc1352r-enable-rtc-in-bim-bootloader-to-measure-total-runtime

器件型号:CC1352R

您好!

我正在根据 SDK 版本4.40.04.04中的 OAD 示例之一为 CC1352R 开发应用。 我想跟踪自上次复位(即正常运行时间)以来的总运行时间、包括在引导加载程序/BIM 中花费的时间。

我希望AONRTCEnable我可以通过在引导加载程序中立即调用来启用 RTC、并且在启动应用程序映像时它会继续计数。 不幸的是,我对这种做法没有任何运气。 我可以在引导加载程序中启用 RTC、但一旦启动应用程序映像、我就会发现AONRTCActive在 BIOS 启动之前返回 false。

请告诉我:如何在引导加载程序中启动 RTC 并使其在应用程序中保持运行? 在从 BIM 跳转到应用程序期间、什么会导致 RTC 被禁用?

谢谢、
Peter

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

    尊敬的 Peter:

    RTC 在预主启动代码中复位。 请参见 SetupTrimDevice。 您可以尝试注释掉 RTC 重置、但我尚未对此进行测试、我不确定它是否会导致任何问题。 (我们的所有代码都基于 RTC 复位的假设。)

    谢谢、

    玛丽·H

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

    玛丽、

    我正在SetupTrimDevice查看中 simplelink_cc13x2_26x2_sdk_4_40_04_04/source/ti/devices/cc13x2_cc26x2/driverlib/setup.c的,但除了 #include "../inc/hw_aon_rtc.h"之外,我没有看到任何对“RTC”的引用。 我一定要错过它...

     请您向正确方向进一步指出我的看法吗?

    谢谢、
    Peter

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

    尊敬的 Peter:

    文件: C:\ti\simplelink_cc13xx_cc26xx_sdk_6_30_00_84\sources\ti\devices\cc13x2_cc26x2\driverlib\setup.c

    行:221 - 245

        // Reset the RTC
        AONRTCReset();
        // Configure the combined event
        IntPendClear(INT_AON_RTC_COMB);
        AONRTCCombinedEventConfig(AON_RTC_CH0 | AON_RTC_CH1 | AON_RTC_CH2);
        // Start the RTC
        AONRTCEnable();
    
        if (CCFGRead_SCLK_LF_OPTION() == CCFGREAD_SCLK_LF_OPTION_XOSC_LF)
        {
            /* Set SubSecInc to 31.250 kHz since we start up on RCOSC_HF_DLF. The
             * rom startup code leaves this at the default 32.768 kHz but that is
             * only accurate once we actually switch to XOSC_LF. Once the
             * oscillator combined interrupt triggers after we switch to the target
             * clock, we will configure SubSecInc back to 32.768 kHz.
             *
             * There is no need to update SubSecInc dynamically for other LF clock
             * sources.
             *  - RCOSC_LF starts on RCOSC_HF-derived but switches fast enough that
             *    we do not accumulate any real-time clock drift before switching.
             *  - External LF is correctly set and requires no switching.
             *  - XOSC_HF-derived does not change LF clock frequencies.
             */
            SetupSetAonRtcSubSecInc(SUBSECINC_31250_HZ);
        }

    谢谢、

    玛丽·H

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

    玛丽、

    有趣。 我们使用的 SDK 版本(4.40.04.04)中似乎不存在此代码。 我想知道它是添加还是从其他位置移动。

    谢谢、
    Peter

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

    尊敬的 Peter:

    我无法直接检查4.40.04.04、但我检查了4.40.00.44、我可以在具有相同功能的同一位置看到相同的文件、但我看不到复位调用。

    C:\ti\simplelink_cc13x2_26x2_sdk_4_40_00_44\source\ti\devices\cc13x2_cc26x2\driverlib\setup.c

    看起来 RTC 复位已经从 hal_rtc_wraper.c 中定义的 halInitRTC() API 中移动、但我找不到它被调用的位置。

    谢谢、

    玛丽·H