Most modern PCs no longer have physical COM ports. However, many hardware settings still use UART for logging, diagnostics, and application control. The alternative is to use a USB device, which is displayed as a COM port on the PC.
Virtual COM port (VCOM) is a technology used to replace the traditional COM port on modern PC. From the perspective of the host, there is no difference between the actual physical COM port and the virtual COM port. Virtual COM ports present and provide the same functionality in the same way. The function of virtual COM port is realized by USB protocol. J-link provides virtual com function. If the virtual COM port is enabled, j-link will be displayed as a composite device with multiple interfaces: j-link function and COM port interface, both of which can be used at the same time.
Enable VCOM
Generally, VCOM function of j-link can be disabled / enabled through j-link commander and j-link configurator.
Note that VCOM can only be used when debugging through 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 function.
1、 Through j-link Configurator
Connect j-link, start j-link configurator, and double-click the device to open the configuration interface as shown in the figure. Under virtual COM port, select enable, and then click OK. After that, you need to restart the device to make the VCOM work properly.
Figure: j-link Configurator
2、 Through j-link Commander
Connect j-link, start j-link commander, and then enter “VCOM enable”. After that, you need to restart the device to make the VCOM work properly.
3、 Check VCOM status
After enabling the VCOM function, you can check whether the VCOM is active by opening the device manager. As shown in the figure below, connected devices with VCOM function will be listed under “ports (COM and LPT)”.
Image: j-link VCOM
Test VCOM function and speed
After VCOM is enabled, you only need to connect TX pin and Rx pin to establish loopback in this way and start terminal application program to test VCOM function. The RX pin will receive the data sent, which means that the VCOM is active and working.
Loop back is established by connecting TX pin to RX pin.
Make sure that pins VTref and GND are connected to j-link. For the test, VTref = 3.3V is recommended.
Start a terminal application (such as hterm) and establish a connection to the COM port.
The signal sent through TX pin and Rx pin is visualized by oscilloscope.
Use the given terminal application to send data through VCOM. Use the letter “U” (binary 01010101) to create a regular square wave signal.
The oscilloscope will display the same signal sequence on the RX and TX pins to confirm the VCOM function. The speed of VCOM can also be determined by oscilloscope. By measuring the duration of a single high state.