Own design board with MK20, how to be able to print debugging info on console

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

Own design board with MK20, how to be able to print debugging info on console

Jump to solution
805 Views
yarannan
Contributor III

As question above, I have own designed board with MK20 processor. I am using processor expert + MQX-Lite on KDS.

Currently, one side JLink-EDU is connected to JTAG on board and the other side is connected to usb port on computer.

I have a micro usb designed on the board.

What I would like to do is to print something on terminal window via connecting microusb. Is it doable and how would

I do it?

Thanks,

Yaran

1 Solution
448 Views
marek_neuzil
NXP Employee
NXP Employee

Hello,

The j-link support virtual COM port, you can find the description in the document http://www.segger.com/cms/admin/uploads/productDocs/UM08001_JLink.pdf, chapter 5.14 Virtual COM Port (VCOM).

In this case you need to have connected pins J-Link-Tx and J-Link-Rx to your MCU pins (to an UART device).

In the KDS project, you can add the fsl_debug_console component into your application, select the UART device that is connected to J-link port (J-Link-Tx and J-Link-Rx pins), select the baudrate and correct pins. Then you can use printf() function in your application. See below.

pastedImage_1.png

In this case you can use the virtual COM port on your computer - use the COM port by your Terminal to send and receive data (for example you can use TeraTerm terminal).

If your MK20 board design does not provide the connection of UART pins to j-link port you can use the Segger RTT (Real Time Terminal). You can find description in the document http://www.segger.com/cms/admin/uploads/productDocs/UM08001_JLink.pdf and on the page SEGGER - The Embedded Experts - Real Time Terminal (use this link to download the software). In this case you can use SEGGER_RTT_printf and other functions that are provided in the Segger RTT Implementation Pack.

Best Regards,

Marek Neuzil

View solution in original post

0 Kudos
2 Replies
449 Views
marek_neuzil
NXP Employee
NXP Employee

Hello,

The j-link support virtual COM port, you can find the description in the document http://www.segger.com/cms/admin/uploads/productDocs/UM08001_JLink.pdf, chapter 5.14 Virtual COM Port (VCOM).

In this case you need to have connected pins J-Link-Tx and J-Link-Rx to your MCU pins (to an UART device).

In the KDS project, you can add the fsl_debug_console component into your application, select the UART device that is connected to J-link port (J-Link-Tx and J-Link-Rx pins), select the baudrate and correct pins. Then you can use printf() function in your application. See below.

pastedImage_1.png

In this case you can use the virtual COM port on your computer - use the COM port by your Terminal to send and receive data (for example you can use TeraTerm terminal).

If your MK20 board design does not provide the connection of UART pins to j-link port you can use the Segger RTT (Real Time Terminal). You can find description in the document http://www.segger.com/cms/admin/uploads/productDocs/UM08001_JLink.pdf and on the page SEGGER - The Embedded Experts - Real Time Terminal (use this link to download the software). In this case you can use SEGGER_RTT_printf and other functions that are provided in the Segger RTT Implementation Pack.

Best Regards,

Marek Neuzil

0 Kudos
448 Views
yarannan
Contributor III

Hi Marek,

Thanks. That is really helpful.

Regards,

Yaran

0 Kudos