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.

[参考译文] RTOS/CC1350:在 ROM 中使用 BIOS 时、CC13xx 是否支持 GateMutexPri

Guru**** 2589245 points
Other Parts Discussed in Thread: CC1350

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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/591801/rtos-cc1350-is-gatemutexpri-supported-on-cc13xx-when-using-bios-in-rom

器件型号:CC1350

工具/软件:TI-RTOS

在 ROM 中将 GateMutexPri 与 CC13xx 搭配使用时有没有任何限制。  我将 TI-RTOS 用于 CC13XX 和 CC26XX v2.21.0.06以及 CC1350。 我从下面的基本 CFG 文件中看到、当使用 ROM 中的 BIOS 时、不支持信标优先级、我想知道我是否存在与使用 GateMutexPri 类似的限制。  

/*========================= 信标配置=================== //
var semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
//
*启用对任务优先级挂起队列的全局支持。
*
*选择一个:
*- true (默认值)
* 这允许根据任务优先级为待处理的任务提供服务。
*- false
* 待处理任务是基于先入先出的服务。
*
*在 ROM 中使用 BIOS 时:
* 此选项必须设置为 false。 
//
//semaphore.supportsPriority = true;
semaphore.supportsPriority = false; 

-Ruben

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

    此设置不影响 GateMutexPri 的行为。

    下面是一个示例、其中有三个具有不同优先级的任务。 优先级3任务(任务3)首先运行并休眠。 然后、优先级2任务(任务2)将运行并睡眠。 最后、优先级为1的任务(任务1)将运行并进入逻辑门。 任务2唤醒后、它会尝试进入栅极、但会被阻止。 任务1的优先级将提高到2。 稍后、任务3唤醒并尝试进入栅极、但被阻止。 任务1的优先级现在将提高到3。

    在内部、由于任务3具有更高的优先级、因此不管 Semaphore.supportsPriority 设置如何、它都被放置在挂起队列的开头。

    一旦任务1离开 GATE、它的优先级被恢复为1、而任务3将进入 GATE。  

    这是三个任务

    空任务1Fxn (UARg arg0、UARg arg1)

      IArg 键;

      KEY = GateMutexPri_enter (gateHandle);

      System_printf ("栅极中的任务1");

      Task_sleep (15000);

      System_printf ("Task1离开栅极\n");

      GateMutexPri_leave (gateHandle、key);

      System_printf ("Task1 out\n");

    空任务2Fxn (UARg arg0、UARg arg1)

      IArg 键;

      Task_sleep (5000);

      KEY = GateMutexPri_enter (gateHandle);

      system_printf ("task2 in the gated\n");

      Task_sleep (5000);

      System_printf ("Task2离开栅极\n");

      GateMutexPri_leave (gateHandle、key);

      System_printf ("Task2 out\n");

    空任务3Fxn (UARg arg0、UARg arg1)

      IArg 键;

      Task_sleep (10000);

      KEY = GateMutexPri_enter (gateHandle);

      system_printf ("task3 in the gated\n");

      Task_sleep (5000);

      System_printf ("Task3离开栅极\n");

      GateMutexPri_leave (gateHandle、key);

      System_printf ("Task3 out\n");

    以下是所有任务退出后的输出:


    注意:在上面的输出中、任务3输出发生在"Task1 out"消息之前、因为现在任务1的优先级为1 (恢复到原始优先级是 GateMutexPri_leave 的一部分)、任务3运行是因为它具有更高的优先级。 如果您在任务3中的 GateMutexPri_enter 之后有一个断点、那么如果查看调用栈、任务1实际上仍将位于 GateMutexPri_leave 中。 让我们在 CCS 7.1中使用新的运行时对象视图(ROV2)来执行此操作!!


    Todd