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.

[参考译文] CC1312R:TI-RTOS7中的 GateAll

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

https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/1129858/cc1312r-gateall-in-ti-rtos7

器件型号:CC1312R
Thread 中讨论的其他器件:SysBIOSSysConfig

您好!

我升级到 TIRTOS7并得到 IAR 错误

错误[Pe020]:标识符"GateAll_Params"未定义 C:\GitHub_Enterprise\int-visonic-PG-CC13xx-Platform\_source\common\eventQ\eventQ_private.h 102
错误[Pe020]:标识符"GateAll_Struct"未定义 C:\GitHub_Enterprise\int-visonic-PG-CC13xx-Platform\_source\common\eventQ\eventQ_private.h 103
错误[Pe020]:标识符"GateAll_Handle"未定义 C:\GitHub_Enterprise\int-visonic-PG-CC13xx-Platform\_SOURCE \common\eventQ\eventQ_private.h 104
ERROR[Pe020]:标识符"Error_Block"未定义 C:\GitHub_Enterprise\int-visonic-PG-CC13xx-Platform\_SOURCE \common\eventQ\eventQ.c 31

我添加 include of: #include

并获得:  

致命错误[Pe1696]:无法打开源文件"ti/sysbios/gates/GateAll.h" C:\gitHub_Enterprise\int-visonic-pg-CC13xx-Platform\_source\application\Ecosystem \_projectSys_sip\includTi_h_files.h 4.
搜索:"C:\GitHub_Enterprise\int-visonic-PG-CC13xx-Platform\_source\application\Ecosystem \_projectEcoSys_SIP\"
搜索:"C:/ti/simplelink_cc13xx_cc26xx_sdk_6_20_00_29/source\"
搜索:"C:/ti/simplelink_cc13xx_cc26xx_sdk_6_20_00_29/kernel/tirtos7/packages/"

文件不在文件夹中。

我的 SysConfig 定义:  

我可以在其中找到以下定义:  

静态 GateAll_Params gateParams;
静态 GateAll_StructgateStruct;
静态 GateAll_Handle gateHandle;

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

    你好、Yaki、

    TI-RTOS7上不存在 GateAll。 您是否考虑使用 GateHwi?

    此致、
    尼古拉伊

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

    您好,

    感谢您的重播。

    您是否有迁移说明(文档,链接)?   

    Tnx

    照烧  

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

    你好、Yaki、

    我们提供了以下迁移指南: https://dev.ti.com/tirex/content/simplelink_cc13xx_cc26xx_sdk_6_20_00_29/docs/ble5stack/ble_user_guide/html/tirtos/bios7_migration.html 

    但遗憾的是、它没有提及 TI-RTOS7中不支持的 GateAll 相关内容。

    此致、
    尼古拉伊

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

    那么?

    您能获得这些信息吗?

    谢谢

    照烧   

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

    您正在请求哪些具体信息?

    TI-RTOS7中不支持 GateAll、因此您必须使用其他某个门。 GateHwi 可能是一个很好的替代器件、但您必须评估它是否是适合您特定用例的良好解决方案。

    此致、
    尼古拉伊

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

    我们使用此代码来保护关键段:  

    init_function

          GateAll_Params_init (&params);
          GateAll_construct( gateStruct, params );
          GATE = GateAll_Handle (&gateStructt);

    USER_FUNCTION ()

        //输入临界区
        UINT gateKey = GateAll_enter (gate);

       //关键段代码  

       ///退出临界区
       GateAll_leave (gate、gateKey);

    您建议用什么方法替换此代码?

    提前感谢  

    照烧  

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

    这来自 GateAll 的文档

    GateAll 使用禁用和启用中断、Swi 和任务来锁定资源机制

    这来自 GateHwi 的文档

    GateHwi 使用禁用和启用中断作为资源锁定机制。

    我不知道是否需要在您的应用中禁用/启用 Swi 和任务、或者它是否足以仅禁用/启用中断。 如果你确定使用 GateHwi 是足够的、那么你基本上可以在你的代码中将 GateAll 替换为 GateHwi。

    此致、
    尼古拉伊

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

    感谢您的阅读,

    TI 对 GateAll 的等效操作(包括 Swi 和任务)有何建议?

    谢谢  

    照烧  

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

    下面是  GateAll_enter 和 GateAll_Leave 的实现(在 TI-RTOS6中)

    /*
     *  ======== GateAll_enter ========
     */
    IArg GateAll_enter(GateAll_Object *gate)
    {
        if (gate->entered == TRUE) {
            return (1);
        }
        else {
            gate->hwiKey = Hwi_disable();
            gate->swiKey = Swi_disable();
            gate->entered = TRUE;
            return (0);
        }
    }
    
    /*
     *  ======== GateAll_leave ========
     */
    Void GateAll_leave(GateAll_Object *gate, IArg key)
    {
        if (key == 0) {
            gate->entered = FALSE;
            Swi_restore(gate->swiKey);
            Hwi_restore(gate->hwiKey);
        }
    }

     

    为了实现相同的目标、您可以在方案中执行以下操作:

    user_function ()
    {
        //enter critical section
        intptr_t hwiKey = Hwi_disable();
        intptr_t swiKey = Swi_disable();
    
        //critical section code 
    
    
        //exit critical section
        Swi_restore(swiKey);
        Hwi_restore(hwiKey);
    
    }

    此致、
    尼古拉伊