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.

[参考译文] CC2652R7:SDK BDB 报告代码启动超时为 0 的事件计时器

Guru**** 2455360 points


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

https://e2e.ti.com/support/wireless-connectivity/zigbee-thread-group/zigbee-and-thread/f/zigbee-thread-forum/1547010/cc2652r7-sdk-bdb-reporting-code-starts-event-timer-with-timeout-of-0

器件型号:CC2652R7


工具/软件:

您好:

我们在我们的应用中的 syscfg 中启用 BIOS 置为有效、并在启动时立即置为有效。 断言来自 TI-RTOS 时钟模块 (KNL/Clock.c):

assert_isTrue(!((params->startFlag!= false)&&(timeout == 0U))、Clock_a_badTimeout);// Clock.c ln:651.

原因是 BDB 报告功能尝试启动超时为 0 的时钟。 违规代码位于此处、存在于样本和较早的 SDK 中:

//
// bdb_reporting.c
//
static void bdb_RepStartReporting( void )
{
  //Stop if reporting timer is active
  if( !OsalPortTimers_getTimerTimeout( bdb_TaskID, BDB_REPORT_TIMEOUT ) )
  {
    //timerElapsedTime is zero
    OsalPortTimers_stopTimer( bdb_TaskID, BDB_REPORT_TIMEOUT );
    bdb_reportingNextEventTimeout = 0;  // <== SET HERE
    bdb_reportingNextClusterEndpointIndex = BDBREPORTING_INVALIDINDEX;
    //Start Timer
    bdb_RepRestartNextEventTimer( );
  }
}

发生的情况是:

- bdb_reportingNextEventTimeout is set to 0, and then bdb_RepRestartNextEventTimer is called
- bdb_RepRestartNextEventTimer calls OsalPortTimers_startTimer( bdb_reportingNextEventTimeout )
- OsalPortTimers_startTimer (0)
  => createTimerEntry
     => Clock_P_create
        => Clock_create
           => Clock_construct
              => Clock_Instance_init
                 ASSERT

文档对是否允许 0 超时保持沉默、但考虑到断言、它显然不受支持、预期行为可能未定义。

我们将初始化格式 0 更改为 1、从而解决了断言问题。

您能否告知此修复程序没有任何不良后果?

此致、

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

    您好 Kenny、  

    感谢您提出此问题。  您建议的修复程序只是在比最初计划的时间晚一秒的情况下开始 BDB 报告、否则不会产生不良后果。   如果要使超时时间更短、可以更改 bdb_RepRestartNextEventTimer 和 bdb_reportingNextEventTimeout 的所有实例的单位。  我已经通知 Zigbee 研发团队、以便可以针对未来的版本改进 F2 SDK。

    此致、
    Ryan