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

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

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

跳至解决方案
1,429 次查看
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 解答
1,072 次查看
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 项奖励
回复
2 回复数
1,073 次查看
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 项奖励
回复
1,072 次查看
yarannan
Contributor III

Hi Marek,

Thanks. That is really helpful.

Regards,

Yaran

0 项奖励
回复