ccs用C语言进行printf时,ccs5在simulator的时候,Sys_printf无输出

以下是TI的论坛截取下来的:

问题1:

1、What can be the reason for not getting System_printf output on the Console (SYS/BIOS 6.32.3.43)?

2、What is the full version number of CCS that you are using? Also note

that you will not see the System_printf output right away. It will only

appear when the buffer is flushed (BIOS_exit)

3、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).注意:需要把系统配置的System.SupportProxy = SysMin;语句屏蔽掉

问题2:

4、I am running the exampling "Hello"

in CCS v5, in which the function "System_printf" should have print a

"hello world" in the console, but it didn't.

When I use the  function "printf"

instead of  "System_printf", it successfully prints "hello world" in

the console, so i am wondering why the function "System_printf" didn't.

5、System_printf buffers until an event such as the buffer becoming

full or the program terminating. I believe printf is actually

implemented as a trick on the emulators to momentarily halt execution

and print the message.  Since most developers don't normally put printf

statements in the middle of a high performance kernel, any fluctuation

in timing shouldn't be important.

Summary: System_printf actually writes to a buffer that doesn't get

printed immediately. printf outputs immediately, but may only work on

an emulator (it might get compiled into System_printf in other

scenerios, but I do not know that much)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值