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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

994 Views
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 Kudos
Reply
2 Replies

815 Views
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 Kudos
Reply

815 Views
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 Kudos
Reply