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.

[参考译文] CC1354R10:在 TI-RTOS7 中启用仅调试代码 (CC1354R10/CCS)

Guru**** 2693225 points

Other Parts Discussed in Thread: CC1354R10

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

https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/1597280/cc1354r10-enabling-debug-only-code-in-ti-rtos7-cc1354r10-ccs

器件型号: CC1354R10

尊敬的 TI 社区:

使用时、请告知是否可以 TI-RTOS7 Code Composer Studio 、以启用只应在中运行的代码段 调试模式

例如、我希望使用以下代码有条件地运行某些代码块:

#ifdef DEBUG
    // Debug-only code
#endif

请注意、我不是指名为 Debug 的构建配置、而是指使用调试器进行调试并通过断点单步执行代码。

提前感谢您的指导。

Brenton

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

    您好 Brenton、  

    您可以制作一个检查 JTAG 电源域是否打开的宏:  

    此致、

    Arthur

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

    您好 Arthur;感谢您的建议。

    根据:
    https://software-dl.ti.com/simplelink/esd/simplelink_cc13xx_cc26xx_sdk/8.31.00.11/exports/docs/drivers/doxygen/html/_power_c_c26_x_x_8h.html#acaed4f189f650d485596cd173016ca1b

    PowerCC26XX_JTAG_PD_TURND_ON 似乎 它只能 通过事件通知在代码中读取、并且仅  CC2640R2 支持此功能。 我当前使用的是 CC1354R10。

    我尝试设置事件通知、似乎从未运行回调。 可能是我出错了;您以前是否通过代码读取过此寄存器?


    此致

    Brenton

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

    您好 Brenton、

    在这种情况下、无需通过回调来读取寄存器、因为您可以使用 driverlib:dev.ti.com/.../group__aonpmctl__api.html

    我制作了这个示例代码供您试用:

    #include <unistd.h>
    #include <stdint.h>
    #include <stddef.h>
    
    /* Driver Header files */
    #include <ti/drivers/GPIO.h>
    
    /* Driver configuration */
    #include "ti_drivers_config.h"
    #include <ti/devices/cc13x4_cc26x4/driverlib/aon_pmctl.h>
    
    /*
     *  ======== mainThread ========
     */
    void *mainThread(void *arg0)
    {
        /* 1 second delay */
        uint32_t time = 1;
    
        /* Call driver init functions */
        GPIO_init();
    
        while (1)
        {
            sleep(time);
            volatile uint32_t jtag_pd_on = AONPMCTLPowerStatusGet();
    
            if (jtag_pd_on & AONPMCTL_JTAG_POWER_ON)
            {
                GPIO_write(CONFIG_GPIO_LED_0, 1);
            }
            else
            {
                GPIO_write(CONFIG_GPIO_LED_0, 0);
            }
    
        }
    }

    如果调试探针处于活动状态、它将点亮 LED。 如果在没有运行调试会话的情况下复位器件、您将发现 LED 确实不会亮起。

    此致、

    Arthur

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

    感谢您发送编修。

    这个解决方案对我来说非常完美。

    此致、

    Brenton