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.

[参考译文] CC2652R:TI-RTOS 线程示例(empty_MTD 或 CLI_MTD)中用于调试的 UART 打印输出

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

https://e2e.ti.com/support/wireless-connectivity/zigbee-thread-group/zigbee-and-thread/f/zigbee-thread-forum/1031066/cc2652r-uart-prints-for-debugging-in-ti-rtos-thread-examples-empty_mtd-or-cli_mtd

器件型号:CC2652R

大家好、

要创建我们自己的基于 Thread 的应用(器件是休眠端)、我应该从 empty-MTD 还是 CLI-MTD 开始? 如何通过 UART 设置典型的 display_printf()?

首先、我已使用 CLI-FTD 项目确认了我的 Thread 网络、并能够 通过 OTBR 对外部服务器执行 ping 操作。

然后,假设 empty-MTD 是我们的应用程序的起点,我花了几个小时,但我不知道如何使用 UART printf()。 empty-MTD 具有自定义的 TI CUI 菜单;CLI-MTD 具有 Thread CLI UART 接口。   

此外、使用 empty-MTD 项目:

  1. 我按照以下说明将 ENABLE_All_logs_TO_UART 设置为1: https://dev.ti.com/tirex/content/simplelink_cc13x2_26x2_sdk_5_20_00_52/docs/thread/html/thread-guide/debugging-index.html#controlling-log-output
  2. 然后将以下行添加到 empty.c 中:
    1. DISPUTILS_SERIALPRINTF (0、0、"已初始化空示例! 玩得开心!");
    2. otPlatLog (OT_LOG_LEVEL_DEBG、OT_LOG_REGION _API、"Hello world!");
  3. 构建并运行,但除了默认的 CUI 菜单之外,我看不到任何输出。  

感谢您的任何建议。  

将会

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

    您好!

    [引用 userid="443940" URL"~/support/wireless-connectivity/zigbee-thread-group/zigbee-and-thread/f/zigbee-thread-forum/1031066/cc2652r-uart-prints-for-debugging-in-ti-rtos-thread-examples-empty_mtd-or-cli_mtd ]要创建我们自己的基于 Thread 的应用(器件是休眠端)、我应该从 empty-MTD 或 CLI-MTD 开始吗? 如何通过 UART 设置典型的 display_printf ()?[/quot]

    我建议使用 empty-MTD、因为它更基于应用(与我们 的 temp_sensorm 示例类似的模型)。

    [引用 userid="443940" URL"~/support/wireless-connectivity/zigbee-thread-group/zigbee-and-thread/f/zigbee-thread-forum/1031066/cc2652r-uart-prints-for-debugging-in-ti-rtos-thread-examples-empty_mtd-or-cli_mtd。]然后,假设 empty-MTD 是我们的应用程序的起点,我花了几个小时,但我不知道如何使用 UART printf()。 empty-MTD 具有自定义的 TI CUI 菜单;CLI-MTD 具有 Thread CLI UART 接口。   [/报价]

    要启用传统的逐行串行日志(vs CUI)、请确保这些日志位于预定义的符号中:
    Board_display_use_uart=1
    TIOP_CUI=0

    我尝试过这种方法、并且能够看到"已初始化空示例! 玩得开心!" PPuTTY 中。

    您可以尝试一下吗?
    如果您遇到任何其他问题、请告知我们。

     

    感谢您使用 TI 器件进行开发、
    Toby

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

    尊敬的 Toby:

    建议有效。 谢谢!

    1.我们应如何/何时使用 TI CUI? 我看到有一个应用程序菜单、但子菜单为空。  TI CUI 的用途是什么?

    2. 如何启用同一 UART 终端的 Openthread 调试输出? 例如、  PlatformLog()输出。 根据本教程、此示 例应与 Thread CLI 示例一起使用、因此我认为也应适用于空示例。 我尝试了这里的指令(将 openthread-config-cc12x2_26x2-MTD.h 中的 ENABLE_All_logs_TO_UART 更改为1)、但看不到 OT 调试输出。  https://dev.ti.com/tirex/content/simplelink_cc13x2_26x2_sdk_5_20_00_52/docs/thread/html/thread-guide/debugging-index.html#controlling-log-output

    3.加快 empty_MTD 项目构建的任何提示? 我关闭了编译器优化、确保并行编译已开启、但仍需要~5分钟才能运行(右键点击工程、选择"编译")

    谢谢、

    将会

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    [引用 userid="443940" URL"~/support/wireless-connectivity/zigbee-thread-group/zigbee-and-thread/f/zigbee-thread-forum/1031066/cc2652r-uart-prints-for-debugging-in-ti-rtos-thread-examples-empty_mtd-or-cli_mtd/3812019 #3812019]1. 我们应该如何/何时使用 TI CUI? 我看到有一个应用程序菜单、但子菜单为空。  TI CUI 的用途是什么?[/quot]

    示例应用- SimpleLink CC13x2/CC26x2 SDK Thread 用户指南1.08.04.00文档

    它是另一个可在开发/调试阶段使用的工具。
    它提供了一种通过 UART 接口进行输入/输出的方法(例如、您可以使用键盘箭头键进行输入)。

    [引用 userid="443940" URL"~/support/wireless-connectivity/zigbee-thread-group/zigbee-and-thread/f/zigbee-thread-forum/1031066/cc2652r-uart-prints-for-debugging-in-ti-rtos-thread-examples-empty_mtd-or-cli_mtd/3812019 #3812019"]2.  如何启用到同一 UART 终端的 Openthread 调试输出? 例如、  PlatformLog()输出。 根据本教程、此示 例应与 Thread CLI 示例一起使用、因此我认为也应适用于空示例。 我尝试了这里的指令(将 openthread-config-cc12x2_26x2-MTD.h 中的 ENABLE_All_logs_TO_UART 更改为1)、但看不到 OT 调试输出。  https://dev.ti.com/tirex/content/simplelink_cc13x2_26x2_sdk_5_20_00_52/docs/thread/html/thread-guide/debugging-index.html#controlling-log-output

    在 disp_utils.c 中、尝试注释掉此行:"#if (OPENTHREAD_CONFIG_LOG_OUTPUT = OPENTHREAD_CONFIG_LOG_OUTPUT_APP)"

    我需要进一步调查、看看这对我有何帮助。

    [引用 userid="443940" URL"~/support/wireless-connectivity/zigbee-thread-group/zigbee-and-thread/f/zigbee-thread-forum/1031066/cc2652r-uart-prints-for-debugging-in-ti-rtos-thread-examples-empty_mtd-or-cli_mtd/3812019 #3812019"]3. 是否有加快 EMPT_MTD 项目构建的提示? 我关闭了编译器优化、确保并行编译已开启、但仍需要~5分钟才能运行(右键单击工程、选择"编译")

    我想您已经达到了这里的所有点。
    以下是另一个参考点: https://e2e.ti.com/support/wireless-connectivity/zigbee-thread-group/zigbee-and-thread/f/zigbee-thread-forum/1022477/launchxl-cc1352r1-cli_ftd-example-not-compiling-and-blocking-the-ccs

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

    谢谢你。 我很喜欢1号和3号。  

    关于#2:  

    在 empty_FTD/MTD 中、修改 disp_utils.c (如上所述)和 openthread-config-cc12x2_26x2-MTD/FTD.h 后、我最终可以看到 otLogger 输出(和传统 UART 显示 printf)。

    在 CLI_FTD/MTD 中、没有 disp_utils.c 文件。 我很好奇如何同时启用 CLI 和 otLogger 输出、如 https://dev.ti.com/tirex/content/simplelink_cc13x2_26x2_sdk_5_20_00_52/docs/thread/html/thread-guide/debugging-index.html#controlling-log-output 所示

    谢谢、

    将会

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

    要在 CLI 示例上启用 openthread 日志:

    在中 /openthread-config-cc13x2_26x2_gcc.h:

    1. 将 ENABLE_All_logs_TO_UART 更改为1
    2. 将 OPENTHREAD_CONFIG_LOG_OUTPUT 更改为 OPENTHREAD_CONFIG_LOG_OUTPUT

    我计划在 dev.ti.com/.../debugging-index.html 上添加此项内容