Redirecting console output

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Redirecting console output

957 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Underling on Fri Jan 20 05:42:13 MST 2012
Hi all,

I'd like to dump the console output produced by my target (using semihosting) to a file.

If I use fprintf() to log the data directly to a file, the data appears not to be committed until the file is closed. I've tried repeated opening/closing of a log file on the host machine, and it's very slow. Also, it's useful to see the data on the screen as it appears.

So, is there a simple way to copy or redirect console output to a file, other than copy and paste?

Thanks!
0 项奖励
回复
3 回复数

940 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Underling on Wed Jan 25 08:40:02 MST 2012
OK, thanks for your help.
0 项奖励
回复

940 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Sun Jan 22 05:42:06 MST 2012
I am afraid that there is currently no way of automatically logging the output in the console view out to file, other than copy'n'pasting it.

With regards to the speed of fprintf output, I suggest you take a look at this FAQ:

http://support.code-red-tech.com/CodeRedWiki/WhatIsSemiHosting


Regards,
CodeRedSupport
0 项奖励
回复

940 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dragilla on Fri Jan 20 05:50:18 MST 2012
Don't know about redirecting console, but you can try using f_sync instead of closing and opening the file. It's there just for that.
0 项奖励
回复