Can I redirect the MQX shell to the Segger J-Link RTT Viewer?

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

Can I redirect the MQX shell to the Segger J-Link RTT Viewer?

972 次查看
marcohaddad
Contributor III

I have this working board with kinetis K24 where there is a MQX shell running on UART4. I want to use this board to send a lot of binary data through that UART, but I need to keep the shell and one easy solution, if possible, would be to redirect stout and stdin to the JTAG and use the RTT Viewer, like what can be done with printf().

Thanks for any help.

0 项奖励
回复
2 回复数

793 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi Marco Haddad:

Many shell functions use printf() to print output to stdout. Thus, you would need to redirect printf() to some other file. This can be done by _io_set_handle(IO_STDOUT, fh_ptr);

Please check this io demo in the MQX installation folder

C:\Freescale\Freescale_MQX_4_2\mqx\examples\io

This demo accomplishes the following jobs.

Print out a message to the default serial port using printf() function.

open another serial port and assign the standard output stream to this serial channel.

print out another message to the new serial port.

I hope it helps.

Regards

Daniel

0 项奖励
回复

793 次查看
marcohaddad
Contributor III

Hi Daniel,

Thanks for your reply.

Unfortunately I'm using the MQX that comes within the KSDK 1.3, and it does not contain that example. I'll try to get it somehow...

Anyway I think I won't be able to use the Segger RTT as a stream to assign it to stdout. Some sort of device driver will be required...

Best regards,

Marco Haddad

0 项奖励
回复