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.

CCS5 中printf输出窗口 如何设置



原先程序中printf("hello !")在simulator中运行时能在输出窗口中产生,后来不知怎原因运行时看不到输出,而其它一切正常。

输出窗口只有:(1)CDT Global Build Console与(2)CDT Build Console(工程名)两个选项

 

  • 在程序中用printf可能会出很多问题,建议你使用BIOS的LOG_printf:

    Problems with printf()

    • It runs often for 1000s of cycles in order to do the string formatting (e.g. displaying an integer as ascii text).
    • It causes CCS to do a "silent halt". That is, there is a breakpoint that gets hit during calls to printf. CCS responds by reading out the printed message and then starting the DSP running again.

    These issues coupled together typically cause severe problems with real-time performance, but you can easily avoid these issues by using LOG_printf instead.

  • 添加flush()函数在printf之后,就能看到输出了。

  • Depending on which version of SYS/BIOS you are using, you may not see the System_printf's come out on the console due to how System is configured. If you want to have System_printf output go to the same place as printf, add the following three lines to your .cfg file and re-build:

    var System = xdc.useModule('xdc.runtime.System');
    var SysStd = xdc.useModule('xdc.runtime.SysStd');
    System.SupportProxy = SysStd;

    If you don't do this, the output will go to a circular buffer in memory. You can examine that buffer using the ROV tool (use the menu: Tools->ROV while in the debugger).

  • 谢谢大家:

    我所用的printf是在非操作系统环境下使用,经多次偿试发现:printf语句打印的内容。最后要加回车行,不然不能进行显示。可能这与C6000下的C库的实现方式有关。

    另外,不知哪里能下载到C6000的C语言API函数的详细说明文档,最好有类似于一般C语言均有一个chm文档,以便于查阅。