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/F28M36P63C2:任务阻止位置的运行时确定

Guru**** 2578945 points
Other Parts Discussed in Thread: SYSBIOS, F28M36P63C2

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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/649532/rtos-f28m36p63c2-runtime-determination-of-task-blocked-location

器件型号:F28M36P63C2
Thread 中讨论的其他器件:SYSBIOS

工具/软件:TI-RTOS

是否有办法确定在 RTOS 中运行时任务被阻止的对象?

我使用 Task_stat()调用来查询所有任务的状态,并将结果打印到我的控制台。

空 dumpTask (char*标题、Task_handle 任务)

   Task_Stat stat;
   Task_stat (task、&stat);

   uint32_t percent =(100UL * stat.used)/stat.stackSize;
#if defined (_TMS320C28XX__)
   DbgInfo ("[%s %d] 0x%lx:0x%4lx/0x%4lx (%3l%%)%p-%p |[%s]%p |%s"、
其他
   DbgInfo ("[%s %d] 0x%x:0x%4x/0x%4x (%3U%%)%p-%p |[%s]%p |%s"、
#endif
               标题、
               STAT.PRIORITY、
               任务、
               (uint32_t) stat.used、
               (uint32_t) stat.STACKSIZE、
               百分比、
               STAT.STACK、
               (uint32_t) stat.stack +(uint32_t) stat.stackSIZE、
               GetModeStr (stat.mode)、
               (uint32_t) stat.sp、
               Task_handle_name (task));

它在正常运行时产生以下输出:

12:48:10 PM 0099 FMS:[S task 0] b540:0x 6A/0x 100 (41%)@00008000-@00008100 |[就绪]@00008056 | ti.sysbios.KNL.Task.IdleTask
12:48:10 PM 0100 FMS:[D task 3] 0x83ac:0x taskef/0x 200 (46%)@000083d0-@000085d0 |[阻止]@0000842a | taskReadback
12:48:10 PM 0101 FMS:[D task 4] 0x85d4:0x D2/0x 200 (41%)@000085f8-@000087f8 |[阻止]@00008654 | taskPID
12:48:10 PM 0102 FMS:[D task 3] 0x87fc:0x E6/0x 200 (44%)@00008820-@00008a20 |[阻止]@000088a0 | taskRFProc
12:48:10 PM 0103 FMS:[D task 4] 0x8a24:0x 281/0x 400 (62%)@00008a48-@00008e48 |[就绪]@00008bbc | TFProtocol Loop
12:48:10 PM 0104 FMS:[D task 5] 0x8e4c:0x 127/0x 200 (57%)@00008e70-@00009070 |[正在运行]@00008ed6 | Smem Rx

我在我的应用程序代码中发现了一个错误、在这个错误中、我的所有线程都被阻止了、并且应用程序会冻结:

2017-12-12 11:16:38.8178   信息      [S task 0] b540:0x 6A/0x 100 (41%)@00008000-@00008100 |[就绪]@0000805e | ti.sysbios.KNL.Task.IdleTask
2017-12-12 11:16:38.8178   信息      [D task 3] 0x83ac:0x D7/0x 200 (41%)@000083d0-@000085d0 |[阻止]@00008474 | Readtaskback
2017-12-12 11:16:38.8178   信息      [D task 4] 0x85d4:0x D2/0x 200 (41%)@000085f8 -@000087f8 |[阻止]@0000868c | taskPID
2017-12-12 11:16:38.8178   信息      [D task 3] 0x87fc:0x E6/0x 200 (44%)@00008820-@00008a20 |[阻止]@000088a0 | taskRFProc
2017-12-12 11:16:38.8188   信息      [D 任务4] 0x8a24:0x 281/0x 400 (62%)@00008a48-@00008e48 |[阻塞]@00008be6 | TFProtocol Loop
2017-12-12 11:16:38.8188   信息      [D 任务5] 0x8e4c:0x 127/0x 200 (57%)@00008e70-@00009070 |[正在运行]@00008ed6 | Smem Rx

我想知道、从上面的示例中、'taskReadback '、'taskPID'、'taskRFProp'和'TFProtocol Loop ' 在哪里被阻断。

另外,我只在这些线程中使用 Task_sleep()和 GateMutex_enter/leave (),所以我想知道为什么它们都被无限期阻止。 我看到过以下帖子 :https://e2e.ti.com/support/embedded/tirtos/f/355/t/586830#pi317008=3 、但看起来我的 Compar_Margin 设置为12、因此我认为这不是同一个问题。

平台:ti.platforms.concertoC28:F28M36P63C2

RTOS:2.16.1.14

编译器:TI v16.9.3.LTS

XDCtools:3.32.0.06_core

此时无法使用 ROV。

Derek

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

    我们没有运行时方法来获取阻止任务的内容。 我们目前在内部任务对象中有一个 pendElem 字段。 ROV 使用此函数以及 GateMutex、信标等列表来确定阻止了哪个任务。 我们没有展示此字段的 API (我们始终保留更改内部数据结构的权利)。

    Todd