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.

[参考译文] 编译器/TDA4VM:输出通过 AppUtils_printf 重叠

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

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/952905/compiler-tda4vm-the-output-is-overlap-via-the-apputils_printf

器件型号:TDA4VM

工具/软件:TI C/C++编译器

尊敬的先生:

 我使用 的是 PSDK_RTOS_auto_J7_07_00_00_11。

 我发现一个问题、即函数(AppUtils_printf)的输出通过 UART 总线重叠。

 和我的代码:

  

void tsk_sample0_main (UArg a0、UArg A1)
{
AppUtils_printf (app_utils_print_MSG_normal、" Hello sample0000!\n");
}
void tsk_sample1_main (UArg0、UArg1)
{
AppUtils_printf (app_utils_print_MSG_normal、" Hello sample1111!\n");
}
int main (void)
{
Task_Params taskParams;

ERROR_Block EB;
ERROR_INIT (&EB);

Task_Params_init (&taskParams);
taskParams.priority = 2;
Task_create (tsk_sample0_main、_taskParams、&EB);
Task_create (tsk_sample1_main、_taskParams、&EB);

AppUtils_Init();

BIOS_start();/*不返回*/
返回(0);
} 

和输出:

  

你好,samplple1111!

你好,samplple1111! 

"Hello sample0000!" 未输出。

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

    您好!

    请提供以下详细信息:

    该代码在哪个内核上运行?

    2、这里使用的是哪一个 UART 实例?

    3. AppUtils_printf()是 PSDKRA 中许多组件使用的本地实用程序函数,您能告诉我在创建此示例时,您提到了哪些软件组件吗?

    此致、

    Karan

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

    尊敬的 Karan:

     感谢您的回复。

     >1. 此代码运行在哪个内核上?

        mcu1_0

     >2. 这里使用的是哪个 UART 实例?

        很抱歉,我不知道这个。

        以及如何检查它?

     >3.  AppUtils_printf()是 PSDKRA 中许多组件使用的本地实用程序函数,您能告诉我在创建此示例时,您提到了哪个软件组件吗?

        示例:CAN_PROFILE_APP。 我删除了有关 CAN 功能的一些组件、启用了 APP_UTIS 和 UTILS_PRF。  

        我不编译 PDK 在本示例中、本示例使用了一些 组件、包括 ti.csl.aer5f 和 sciclient.aer5f 和 ti.drv.uart.aer5f 和 ti.board.aer5f 和 ti.drv.i2c.aer5f 和 ti.osal.5aerf。

        我认为  除了 task_sample0_main 和 task_sample1_main 之外没有其他任务。

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

    尊敬的 Karan:

     为了保持相同的环境、我在 CAN_PROFILE_APP 示例中重复此问题。

     PDK:  PSDK_RTOS_auto_J7_07_00_00_11。

     我只修改一个源文件(参考 main_tirtos.c):

        mcusw/mcus_demos/profile/ca/main_tirtos.c

              >我只添加2个任务:Sample0_TaskFxn 和 Sample1_TaskFxn,它们同时调用 AppUtils_printf()。

     并构建:

      gmake CAN_profile_app Board=j721e_evm SOC=j721e build_profile=release core=mcu1_0 build_os_type=tirtos

     和输出 (参考 log.txt):

       示例 String-1111!!!

      示例 String-1111!!!

      同一个问题: "Sample String-0000!!!" 不输出。

    e2e.ti.com/.../6138.main_5F00_tirtos.c

    e2e.ti.com/.../5224.log.txt

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

    您好!

    我能够看到相同的行为、我添加了一个循环、而不是只打印一次。 我第一次看到打印错误,但后来发现了。

    通过查看 AppUtils_printf()的实现,我做了一个更改,然后它运行正常。 我仍然不确定这是否是一个错误、因此我会随时向您发布。

    同时、您可以进行与我相同的修改以解决该问题:

    diff -git a/mcal_drv/mcal/examples/utils/src/srapp_utils.c b/mcal_drv/mcal/examples/utils/src/app_utils.c
    index d084dd7..618a617 100755
    -- a/mcal_drv/mca/utils/utils/utils/utils/index+29mcr /intexamples/un/utils/prob_utils/prob_utils/mc_di_examples+4_dets/tids/tids/tids/tids/pros/prox_dig/index_dig/index_div_utils/tids/tids/pros/tids/pros/pros/pros/pros/tids/cs/pros/pros/prob_utils/prob_utils/prob_utils/prob_utils/pros/pros/pros/pros/prod/
    
    @@@@
    
    
    {
    - static char printBuffer[app_utils_print_MAX_STRING_SIZE];
    + char printBuffer[app_utils_print_MAX_STRING_SIZE];
    va_list 参数;
    
    /*开始变值处理。 * 

    此致、

    Karan

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

    尊敬的 Karan:

     感谢您的回答。

     它工作正常。

    此致、

    黄石。

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

    您好 、黄格尔、

    我保持这个线程处于打开状态、只是为了在这是一个错误时传达信息。

    此致、

    Karan