Using the printf in MQX OS

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

Using the printf in MQX OS

632 Views
jtpark
Contributor IV

Compiler is IAR. I would like to monitor printf message through serial port. Please advise how to build a system.

(borate, serial port(port number), schematic, etc.)

Current system,

device : MK60FN1M0VLQ12

MQX board connects to PC program through serial port 5.

The customer needs other serial port or other port for communication debugging between PC program and MQX board.

  1. Communication is fine between PC program and MQX board
  2. Cannot modify PC program. (It is certified program.)

I have to modify MQX code, so they want to use printf for verification.

0 Kudos
1 Reply

343 Views
soledad
NXP Employee
NXP Employee

Hello,

Are you using the TWR-K60F120M BSP?

The default Console for the TWR-K60F120M  is UART5 OSJTAG-USB mini connector (mapped to ttyf: device in the MQX RTOS)

If you need to change the default configuration you need to follow the below steps:

1.  Ensure that the serial channel (UART0- ttya, UART1 -ttyb, UART2 -ttyc, UART3 -ttyd, UART4 -ttye,UART5 -ttyf ) is in enabled in user_config.h file as follows,

For example:

#define BSPCFG_ENABLE_TTYC 1

2. In addition, user_config.h file defines the default IO channel, so it is necessary to modify this definition according the channel you need, for example:

#define BSP_DEFAULT_IO_CHANNEL "ittyc:"   

    

3. clean all libraries, and rebuild again.

Please let me know if this helps.


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos