Most modern PCs no longer have physical COM ports. However, many hardware setups still use UART for logging, diagnostics, and application control. The alternative is to use a USB device that appears as a COM port on the PC.
Virtual COM Port (VCOM) is a technology used to replace traditional COM ports on modern PCs. From the host's point of view, there is no difference between the actual physical COM port and the virtual COM port. Virtual COM ports are presented in the same way and provide the same functionality. Virtual COM port functionality is implemented through the USB protocol. J-Link provides virtual COM functionality. In the case of J-Link, if the virtual COM port is enabled, J-Link appears as a composite device with multiple interfaces: J-Link functionality and COM Port interface, both of which can be used at the same time.
Normally, the VCOM function of J-Link can be disabled/enabled via J-Link Commander and J-Link Configurator.
-
Note that VCOM can only be used when debugging via the SWD target interface. Pin5 = J-Link-Tx (out), Pin17 = J-Link-Rx (in).
-
Currently, only J-Link models with hardware version 9 or higher have VCOM functionality.
1. Through J-Link Configurator
Connect the J-Link, start the J-Link Configurator and open the configuration interface as shown by double-clicking the device. Under "Virtual COM-Port", select "Enable" and click "OK". After that, you need to restart the device for VCOM to work properly.
Figure: J-Link Configurator
2. Through J-Link Commander
Connect the J-Link, launch J-Link Commander, and type "vcom enable". After that, you need to reboot the device for VCOM to work properly.
3. Check VCOM status
After enabling the VCOM function, you can check whether VCOM is active by opening the Device Manager. As shown in the figure below, the connected device with VCOM function will be listed under "Ports (COM & LPT)".
Test VCOM functionality and speed
After enabling VCOM, you can test the VCOM functionality by simply connecting the Tx pin with the Rx pin, establishing a loopback this way -, launching the terminal application. The Rx pin will receive the transmitted data, which means that VCOM is active and working.
-
A loopback is established by connecting the Tx pin with the Rx pin.
-
Make sure pins VTref and GND are connected to the J-Link. For testing, VTref = 3.3V is recommended.
-
Start a terminal application (e.g. HTerm) and establish a connection to the COM port.
-
Use an oscilloscope to visualize the signal sent through the Tx pin and the Rx pin.
-
Use the given terminal application to send data over VCOM. Use the letter "U" (binary 01010101) to create a regular square wave signal.
An oscilloscope will show the same sequence of signals on both the Rx and Tx pins, confirming VCOM functionality. The speed of VCOM can also be determined with an oscilloscope by measuring the duration of a single high state.
Figure: Testing VCOM function and speed