Serial port switching device and debugging system

The serial port adapter enables voltage and signal format adaptation between the computer and the embedded system, solving the problem of direct connection between the computer and the embedded system and improving the efficiency and accuracy of debugging and upgrading.

CN223728236UActive Publication Date: 2025-12-26ENJOY MOVE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202520161182.4
Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-12-26
Estimated Expiration
2035-01-23

AI Technical Summary

Technical Problem

In existing technologies, the ports of computers and embedded systems cannot be directly connected, leading to communication failures.

Method used

A serial port adapter device was designed to enable compatibility between a computer and an embedded system. This device solves a technical problem that existing technologies cannot address, specifically through serial port application technology. It achieves compatibility between the computer and the embedded system, overcoming technical challenges or problems that existing technologies cannot effectively solve. The serial port adapter device facilitates debugging and upgrading of both the computer and the embedded system.

Benefits of technology

It achieves voltage and signal format adaptation between computers and embedded systems, improving the efficiency and accuracy of debugging and upgrades, and reducing the probability of human error.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN223728236U_ABST
    Figure CN223728236U_ABST
Patent Text Reader

Abstract

The embodiment of the utility model discloses a serial port switching device and a debugging system. The device comprises a voltage detection unit, a first interface connector and n first serial port switching modules, wherein the first interface connector is connected with the embedded system; the first interface connector comprises n first communication ends, and each first communication end is in communication connection with the first level conversion unit of the corresponding serial port switching module, the first serial port conversion unit and the second interface connector connected with the debugging device in sequence through a first branch; the voltage detection unit detects the port voltage of the first communication end so as to configure the output voltage of the first voltage stabilization unit; the output voltage of the first voltage stabilizing unit is the same as the port voltage; the first level conversion unit performs voltage conversion according to the output voltage; and the first serial port conversion unit performs signal format conversion. According to the embodiment of the invention, signal and voltage adaptation of the debugging device and the embedded system is realized, so that debugging and upgrading of the embedded system are completed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of serial communication, and particularly relates to a serial port switching device and an on-chip debugging system. BACKGROUND

[0002] An embedded system often needs to be debugged and upgraded, which requires a computer for debugging and upgrading to be connected with ports of chips of the embedded system to transmit signals for debugging and upgrading. The chips of the embedded system usually include SOC (System on Chip) chips and MCU (Microcontroller Unit) chips.

[0003] However, the ports on the computer are generally USB (Universal Serial Bus) ports, and the embedded system can include various types of ports, such as UART serial ports (Universal Asynchronous Receiver / Transmitter, also referred to as serial ports), USB ports and the like. The signal formats adapted by the USB ports of the computer and the UART serial ports of the embedded system are different, and the sizes of the voltages adapted are also different. For example, the USB port is adapted to 5V voltage, and the UART serial port can be adapted to 3.3V or 1.8V voltage.

[0004] Therefore, how to realize the adaptation of the computer and the embedded system to perform debugging and upgrading of the embedded system by the computer is a problem to be solved at present. CONTENT OF THE INVENTION

[0005] The present application aims to at least solve one of the technical problems in the prior art. To this end, the present application provides a serial port switching device and an on-chip debugging system to realize the adaptation of the computer and the on-chip system, so as to perform debugging and upgrading of the on-chip system by the computer.

[0006] In a first aspect, the present application provides a serial port switching device, comprising a voltage detection unit, a first interface connector for connecting an embedded system, and n first serial port switching modules; n is greater than or equal to 1;

[0007] Each first serial port switching module comprises a first voltage stabilizing unit, a first level conversion unit, a first serial port conversion unit, and a second interface connector for connecting a debugging device of the embedded system;

[0008] The first interface connector comprises n first communication ports, the n first communication ports correspond to n first serial port conversion modules one by one, each first communication port is sequentially connected in communication with the first level conversion unit, the first serial port conversion unit in the corresponding first serial port conversion module and the second interface connector through a first branch, so as to mutually transmit communication signals between the first communication port and the second interface connector.

[0009] The voltage detection unit is connected with the first communication port and the first voltage stabilizing unit respectively, and is configured to detect the port voltage of the first communication port and configure the output voltage of the first voltage stabilizing unit according to the port voltage of the first communication port; the output voltage of the first voltage stabilizing unit is the same as the port voltage; the first level conversion unit is connected with the first communication port and the first voltage stabilizing unit respectively, and is configured to convert the voltage of the communication signal received from the signal sending end into the first target voltage adapted by the signal receiving end according to the output voltage of the first voltage stabilizing unit; wherein the signal sending end is one of the first communication port and the second interface connector, and the signal receiving end is the other one of the first communication port and the second interface connector.

[0010] The first serial port conversion unit is configured to convert the communication signal received from the signal sending end into the signal format corresponding to the signal receiving end.

[0011] In one embodiment of the serial port conversion device described above,

[0012] The second interface connector is also configured to supply power to each device in the serial port conversion device. Specifically, the second interface connector supplies power to each interface connector and chip in the serial port conversion device, wherein the interface connectors and chips include the first interface connector, the first level conversion unit, the first serial port conversion unit, the voltage detection unit and the first voltage stabilizing unit.

[0013] In one embodiment of the serial port conversion device described above,

[0014] Each first communication port is sequentially connected in communication with the first serial port conversion unit in the corresponding first serial port conversion module and the second interface connector through a second branch, so as to mutually transmit communication signals between the first communication port and the second interface connector, the first serial port conversion unit is connected with the first voltage stabilizing unit, and is also configured to convert the voltage of the communication signal received from the signal sending end into the second target voltage adapted by the signal receiving end according to the output voltage of the first voltage stabilizing unit; the voltage conversion range supported by the first serial port conversion unit is smaller than the voltage conversion range supported by the first level conversion unit.

[0015] In the present application, a second branch for signal transmission is provided, and a first serial port conversion unit with signal conversion function is provided to support small-range voltage adjustment, so as to adjust the voltage of the communication signal directly sent to the first serial port conversion unit through the second branch, thereby eliminating the need for the first level conversion unit in the first branch.

[0016] In an embodiment of the serial port switching device described above,

[0017] The first interface connector further comprises m second communication ends, and the device further comprises m second serial port switching modules, the m second communication ends corresponding to the m second serial port switching modules one by one; each second serial port switching module comprises a third interface connector, and each second communication end is in communication connection with the third interface connector of the corresponding second serial port switching module; m is greater than or equal to 1.

[0018] The serial port switching device provided in the above manner not only has the functions of signal conversion and voltage adjustment, but also enables the signal format and voltage of the embedded system and the debugging device port to be adapted to the situation of being directly connected through the second communication end (connected with the embedded system) of the first interface connector and the third interface connector (connected with the debugging device) for debugging and upgrading without conversion through the first branch and the second branch, so that efficient debugging and upgrading of multiple types of ports of the embedded system can be realized.

[0019] In an embodiment of the serial port switching device described above,

[0020] The second interface connector and / or the third interface connector are used to supply power to the devices in the device. Compared with the formula that all devices are powered through one interface connector, distributed power supply can provide more stable voltage due to the reduction of corresponding powered devices, and can choose wiring nearby to reduce the complexity of the line.

[0021] In an embodiment of the serial port switching device described above, the n second interface connectors and the m third interface connectors are integrally arranged in the same hub. Integrating the interfaces facing the debugging device into one through the hub can reduce the debugging wiring harness, reduce the wiring requirements, and directly plug in to reduce the debugging failure caused by connection.

[0022] In an embodiment of the serial port switching device described above,

[0023] The first interface connector is a TypeC connector, and the second interface connector and / or the third interface connector are standard USB connectors.

[0024] In an embodiment of the serial port switching device described above,

[0025] The hub has a USB interface externally.

[0026] In a second aspect, the application provides an on-chip debugging system, the on-chip debugging system comprising:

[0027] an embedded system;

[0028] a debugging device;

[0029] and a serial port adapter as above connected between the embedded system and the debugging device; wherein,

[0030] the embedded system has at least one port connected with the first communication end;

[0031] the second interface connector is connected with the debugging device, and the serial port adapter is used for mutual transmission of communication signals between the port and the debugging device and adjustment of voltage of the communication signals.

[0032] In an embodiment of the serial port adapter above,

[0033] the port comprises a first UART port of the SOC and a second UART port of the MCU, and the adaptive voltage of the first UART port is different from the adaptive voltage of the second UART port.

[0034] The one or more technical solutions of the application have at least one or more of the following effects:

[0035] In the technical solution of the application, the voltage adaptation problem between different ports of the embedded system and the debugging device is solved by the voltage conversion function of the first level conversion unit, and the signal format adaptation problem between different ports of the embedded system and the debugging device is solved by the signal format conversion function of the first serial port conversion unit, so that the signal transmission between the debugging device and the embedded system can be realized to achieve debugging and upgrading.

[0036] Moreover, in the technical solution of the application, the port voltage identification function is realized by setting the voltage detection unit, so that the output voltage of the voltage stabilizing unit can be better configured, and the first level conversion unit takes the output voltage of the voltage stabilizing unit as the reference voltage to determine the voltage conversion value. When the embedded system has multiple possible port voltages, this kind of mode realizes adaptive voltage conversion, improves the voltage conversion efficiency, and reduces the probability of human error compared with manually determining the voltage conversion value.

[0037] Additional aspects and advantages of the application will be in part apparent and in part pointed out hereinafter. BRIEF DESCRIPTION OF DRAWINGS

[0038] The disclosure of the present application will become more apparent from the following description with reference to the attached drawings. As those skilled in the art will understand, the drawings are for illustrative purposes only and are not intended to limit the scope of protection of the present application. In addition, similar numerals are used to denote similar components in the drawings, in which:

[0039] Figure 1 is a schematic diagram of the principle structure of a serial port adapter according to an embodiment of the present application;

[0040] Figure 2 is a schematic diagram of the specific structure of a serial port adapter according to an embodiment of the present application;

[0041] Figure 3 is a schematic diagram of the specific structure of a serial port adapter capable of two-way debugging according to an embodiment of the present application;

[0042] Figure 4 is a schematic diagram of the specific structure of a serial port adapter capable of multi-way debugging according to an embodiment of the present application;

[0043] Figure 5 is a schematic diagram of the principle structure of an on-chip debugging system according to an embodiment of the present application. DETAILED DESCRIPTION

[0044] Some embodiments of the present application will be described below with reference to the accompanying drawings. Those skilled in the art will understand that these embodiments are only used to explain the technical principles of the present application and are not intended to limit the scope of protection of the present application.

[0045] As described in the background, there is a problem of non-adaptation of port voltage and signal format between a computer (i.e., one of the debugging devices described later) and an embedded system, which makes it difficult to upgrade the debugging of the embedded system by the computer. Therefore, the present application creatively proposes a serial port adapter to convert the voltage between the ports of the computer and the embedded system to achieve adaptation, and to convert the signal format between the ports of the computer and the embedded system to achieve adaptation, thereby realizing the communication between the computer and the embedded system.

[0046] Further, the applicant finds that the current embedded system can have multiple chips, and the same chip can also have multiple ports. The corresponding voltages between the ports of different chips and the ports of the same chip can be different. Therefore, it is necessary to determine which voltage conversion strategy to use for which port, and to complete the voltage conversion of the specific port according to the determined strategy. For example, when the embedded system includes a SOC chip and an MCU chip, the SOC chip has a USB port and a UART first serial port (also referred to as a serial port), and the MCU chip has a UART second serial port. The USB port and the UART first serial port are adapted to 5V and 1.8V ports, respectively, and the UART second serial port is adapted to a 3.3V voltage. When a computer needs to debug and upgrade the embedded system, it is necessary to first determine which target port to debug and upgrade, and then determine whether to perform 5V-1.8V or 5V-3.3V conversion according to the voltage 5V of the computer port and the corresponding voltage of the target port of the embedded system. However, the manual determination process is inefficient and prone to errors. Therefore, the present application further innovatively proposes that the port voltage of the embedded system is identified by the serial port adapter, so as to adaptively convert the voltage according to the identified port voltage. For example, when the port voltage of the embedded system to be debugged and upgraded is 1.8V, 5V-1.8V conversion is performed.

[0047] Referring to the accompanying Figure 1 , Figure 1 is a structural principle schematic diagram of a serial port adapter according to an embodiment of the present application. As shown in Figure 1 , the serial port adapter in the embodiment of the present application includes a voltage detection unit, a first interface connector for connecting an embedded system, and n first serial port adapter modules; n is greater than or equal to 1.

[0048] Each first serial port adapter module includes a first voltage stabilizing unit, a first level conversion unit, a first serial port conversion unit, and a second interface connector for connecting a debugging device of an embedded system. The debugging device can be a computer or the like.

[0049] The first interface connector includes n first communication ends, and the n first communication ends correspond one-to-one to the n first serial port adapter modules. Each first communication end and the first level conversion unit, the first serial port conversion unit, and the second interface connector in the corresponding first serial port adapter module are sequentially connected in communication through a first branch to mutually transmit communication signals between the first communication end and the second interface connector.

[0050] The voltage detection unit is connected with the first communication end and the first voltage stabilizing unit respectively, and is configured to detect the port voltage of the first communication end and configure the output voltage of the first voltage stabilizing unit according to the port voltage of the first communication end. The output voltage has the same magnitude as the detected port voltage of the first communication end. It should be noted that the first interface connector is connected with the embedded system, and thus the port voltage of the first communication end of the first interface connector represents the voltage of the corresponding port of the embedded system.

[0051] The first level conversion unit is connected with the first communication end and the first voltage stabilizing unit respectively, and is configured to convert the voltage of the communication signal received from the signal sending end into the first target voltage adapted by the signal receiving end according to the output voltage of the first voltage stabilizing unit. The signal sending end is one of the first communication end and the second interface connector, and the signal receiving end is the other one of the first communication end and the second interface connector. The second interface connector is connected with the debugging device, and the voltage of the second interface connector represents the voltage adapted by the debugging device.

[0052] The first serial port conversion unit is configured to convert the communication signal received from the signal sending end into the signal format corresponding to the signal receiving end.

[0053] As described in the background, to realize the debugging of the embedded system, the conversion of the communication signal voltage and the communication signal format needs to be performed between the corresponding port of the embedded system and the debugging device, that is, the conversion of the communication signal voltage and the communication signal format needs to be performed between the first communication end of the first interface connector connected with the embedded system and the second interface connector connected with the debugging device.

[0054] Correspondingly, in the present application, the first level conversion unit is configured to perform the conversion of the communication signal voltage, and the first serial port conversion unit is configured to perform the conversion of the signal format. The first serial port conversion unit can perform the conversion of the signal format based on the prior art. To perform the conversion of the voltage, the first level conversion unit needs to determine the voltage adapted by the signal sending end and the signal receiving end respectively, and then perform the conversion based on the determined voltage conversion value. The signal sending end and the signal receiving end are one of the first communication end and the second interface connector, and the voltage adapted by the second interface connector is the voltage adapted by the debugging device. The voltage is a determined value, generally 5V, which can be known by the first level conversion unit in advance. The voltage at the first communication end is different according to different ports of the corresponding embedded system, and the first level conversion unit does not know the voltage at the first communication end in the current communication.

[0055] To this end, the voltage detection unit is arranged in the application to detect the port voltage of the first communication end to feed back to the first level conversion unit. However, the voltage detection unit is generally formed by a control chip, which cannot output a higher voltage value, otherwise the chip will be damaged. The port voltage of the first communication end is generally higher for the control chip, such as 1.8V. Therefore, the voltage detection unit cannot directly feed back the port voltage of the first communication end to the first level conversion unit. To this end, the first voltage stabilizing unit is arranged in the application to transfer the voltage feedback between the voltage detection unit and the first level conversion unit. The first voltage stabilizing unit is generally formed by a power supply chip, which can output a higher voltage. After the voltage detection unit detects the port voltage of the first communication end, a smaller voltage value is first fed back to the first voltage stabilizing unit according to the port voltage, which is generally in a certain coefficient relationship with the port voltage, such as 0.2 or 0.5, etc. The first voltage stabilizing unit determines its output voltage according to the smaller voltage value and the coefficient relationship, and feeds back the output voltage to the first level conversion unit. The output voltage is the same as the port voltage of the first communication end. In this way, the first level conversion unit can know the port voltage of the first communication end, so as to determine the voltage conversion according to the port voltage and the voltage adapted by the second interface connector (a fixed value, generally 5V) to perform voltage conversion.

[0056] Specifically, when the communication signal is sent from the first communication end (signal sending end) to the second interface connector (signal receiving end), the first level conversion unit converts the port voltage (such as 1.8V) to the voltage adapted by the second interface connector, such as 5V; when the communication signal is sent from the second interface connector (signal sending end) to the first communication end (signal receiving end), the first level conversion unit converts the voltage adapted by the second interface connector, such as 5V, to the port voltage (such as 1.8V).

[0057] In some embodiments of the application, the first voltage stabilizing unit can exist independently of the voltage detection unit and the first level conversion unit; in alternative embodiments, the first voltage stabilizing unit can be integrated with the voltage detection unit, or the first voltage stabilizing unit can be integrated with the first level conversion unit, which is not specifically limited in the application.

[0058] An optional working process of the serial port switching device is as follows: the first interface connector receives a communication signal from a port of the external embedded system through the first communication end and transmits the communication signal to the first level conversion unit of one of the n first serial port switching modules, wherein the communication signal can be a UART signal, the voltage detection unit simultaneously measures the port voltage of the first communication end, and the output voltage of the first voltage stabilizing unit is configured according to the port voltage. For example, the first communication end is connected to the UART port of the embedded system, the voltage detection unit detects that the port voltage of the first communication end is 1.8V, and according to the coefficient 0.2, the voltage of 0.36V is fed back to the first voltage stabilizing unit, and the first voltage stabilizing unit determines that the output voltage thereof is 1.8V according to the coefficient 0.2 and 0.36V. The output voltage of the first voltage stabilizing unit is fed back to the first level conversion unit as the reference voltage of the first level conversion unit, and the first level conversion unit determines that the voltage of the signal sending end (i.e., the first communication end) is 1.8V, and the first level conversion unit converts the voltage of the UART signal passing therethrough to the voltage adapted by the second interface connector, such as 5V. After the UART signal is converted into a USB format UART signal by the first serial port switching module, the USB format UART signal is transmitted to the debugging device, such as a computer, through the second interface connector. As described above, the voltage adapted by the computer is the same as the voltage adapted by the second interface connector.

[0059] It should be understood that, for the convenience of description, Figure 1 Only one of the first serial port switching modules is connected to the first interface connector, but this is not a limitation on the number of the first serial port switching modules of the present application. The first interface connector can be connected to n first serial port switching modules, such as 2, 3 or even more. The first level conversion unit in each first serial port switching module is connected to one of the n first communication ends of the first interface connector in a one-to-one correspondence, and the voltage detection unit is connected to the n first communication ends and the first voltage stabilizing units of the n first serial port switching modules, respectively.

[0060] The present application realizes the conversion of voltage and the format conversion of signal through the first level conversion unit and the first serial port switching module, and further realizes the automatic identification of the voltage of different ports of the embedded system through the voltage detection unit, so that the voltage of the port identified by the voltage detection unit is fed back to the first level conversion unit through the voltage stabilizing unit, and the first level conversion unit determines the conversion voltage value according to the port voltage and the voltage adapted by the corresponding second interface connector to perform voltage conversion. Compared with the prior art, manual determination of the port voltage and then conversion are not required, and the voltage adaptive conversion function between the embedded system and the debugging device during the debugging and upgrading process is realized, and human errors during the debugging process are reduced.

[0061] Further, by setting n greater than 1, i.e. setting multiple first serial port adapter modules, voltage conversion of different communication signals of multiple ports can be adapted, so that multi-channel serial port debugging can be performed, and more debugging requirements can be met.

[0062] In one embodiment, the voltage detection unit can adopt an MCU (not the same as the MCU in the embedded system), which has an Analog to Digital Converter (ADC) input pin and a Digital to Analog Converter (DAC) output pin. The analog / digital conversion circuit inside the MCU can sample and identify the voltage signal. Therefore, the port voltage of the first interface connector can be collected through the ADC input pin, and the reference voltage output by the first voltage stabilizing unit can be connected to the DAC output pin to adjust the output voltage of the first voltage stabilizing unit. The voltage detection unit and the function of adjusting the output voltage of the first voltage stabilizing unit (which can specifically adopt an LDO, low dropout regulator) can be realized based on hardware and physical connection of hardware, and no change in the internal program of the MCU module is involved.

[0063] In one embodiment, as Figure 2As shown, taking a first serial port adapter module as an example, the first interface connector is a TypeC connector; the first level conversion unit adopts a Level shift chip (Level shift1); the first serial port conversion unit adopts a USB to TTL serial port chip (USB to TTL1), specifically, a chip CP2102N can be adopted; the second interface connector is a standard USB connector (USB1), and the external computer end is a standard USB interface, which can be a USB-A standard interface; using a standard USB interface can optimize the convenience and ease of use of debugging; the first voltage stabilizing unit adopts an LDO chip (LDO1), which realizes outputting different and stable voltages according to the voltage detection unit (MCU) configuration through the LDO chip; specifically, the first communication end TX1 / RX1 of the TypeC connector is connected with the signal end A1 / A2 of the Level shift1, the signal end B1 / B2 of the Level shift1 is connected with the signal end TX1 / RX1 of the USB to TTL1, and the signal end D+ / D- of the USB to TTL1 is connected with the signal end D+ / D- of the USB1, thereby forming a first communication link; the serial port signal, for example, the UART signal, input from the first communication end TX1 / RX1 of the TypeC connector is converted into a USB format UART signal by the USB to TTL1 and output to the computer end through the signal end D+ / D- of the USB1, the USB format communication signal input by the computer end through the signal end D+ / D- of the USB1 is converted into a serial port format of the device to be debugged connected with the communication end TX1 / RX1 of the TypeC connector by the USB to TTL1 and output to the connected device to be debugged through the communication end TX1 / RX1 of the TypeC connector; the voltage detection unit (specifically, the MCU) collects the port voltage of the communication end TX1 / RX1 of the TypeC connector, and configures the output voltage of the LDO1 according to the port voltage, the voltage output end of the LDO1 is connected to the VCCA power supply end of the Levelshift1, and the output voltage of the LDO1 is used as the reference voltage of the Level shift1, so that the voltage of the communication signal passing through the Levelshift1 is converted into a level voltage that meets the signal output end, for example, if the port voltage of the communication end TX1 / RX1 of the TypeC connector is 3.3V, then if the voltage of the communication signal input from the TypeC connector is 3.3V, it is converted into a 5V voltage that meets the USB1 or the USB to TTL1 by the Levelshift1, and if the communication signal input from the USB1 is converted into a 3.3V voltage that meets the communication end TX1 / RX1 of the TypeC connector by the Levelshift1, the port voltage of the device to be debugged (i.e., the embedded system to be debugged) is judged by the MCU, the voltage level of the serial port communication is automatically adjusted, and potential risks caused by human errors are avoided.

[0064] In a possible implementation, referring to Figure 2 The serial port conversion device is powered through a VBUS port of the USB1, and after connecting the power supply ports of various devices, the USB to TTL1, the LDO1, the MCU, the Level shift1 and the TypeC connector can be powered, and the power required for the operation of various chips is provided.

[0065] In a possible implementation, referring to Figure 1 The link in which each first communication end is sequentially connected with the first level conversion unit, the first serial port conversion unit of the corresponding serial port conversion module and the second interface connector connected with the debugging device is a first branch, the first branch is a solid line connection part, and when the communication signal is communicated through the first branch, the first voltage stabilizing unit configures the voltage of the first level conversion unit, that is, the first voltage stabilizing unit and the first level conversion unit are connected in the solid line connection part in Figure 1 Further, each first communication end and the first serial port conversion unit and the second interface connector in the corresponding serial port conversion module can be sequentially connected in communication through a second branch to mutually transmit the communication signal between the first communication end and the second interface connector, Figure 1 The dashed line part in the second branch is a part of the second branch, when the second branch communicates, the first interface connector is connected without the first level conversion unit, the first voltage stabilizing unit directly configures the voltage of the first serial port conversion unit, and the first serial port conversion unit converts the voltage of the communication signal received from the signal sending end into a second target voltage adapted to the signal receiving end according to the output voltage of the first voltage stabilizing unit. The first serial port conversion unit is only used to support voltage conversion in a small range, that is, in the present application, the difference between the second target voltage and the voltage of the signal sending end is less than the difference between the first target voltage and the voltage of the signal sending end.

[0066] When the communication signal voltage needs to be adjusted in a large range (such as 5V to 1.8V), the second branch cannot realize such conversion, and the first branch needs to be selected to communicate at this time; when the communication signal voltage needs to be adjusted in a small range, the first branch and the second branch can both realize such conversion, for example, the voltage to be converted is converted from 5.5V to 3.3V, and one of the branches can be selected to communicate according to a setting rule or at random.

[0067] Specifically, referring to Figure 2, USB to TTL1 has an adjustable power supply terminal VIO, that is, USB to TTL1 has a voltage switching function, LDO1 can directly realize voltage conversion of the passing communication signal by configuring the adjustable power supply terminal VIO of USB to TTL1, and realize small-range amplitude voltage conversion. Therefore, the communication end TX1 / RX1 of the TypeC connector is directly connected to the signal end TX1 / RX1 of USB to TTL1 through the second branch, the MCU detects the port voltage of the communication end TX1 / RX1 of the TypeC connector, configures the output voltage of LDO1 according to the port voltage, and the output voltage of LDO1 is used as the input voltage of the adjustable power supply terminal VIO of USB to TTL1, which supports a range of 3.3V-5V. For example, when the port voltage of the communication end TX1 / RX1 of the TypeC connector is 3.3V, the output voltage of LDO1 is 3.3V, and USB to TTL1 can support the transmission of 3.3V voltage serial port signals.

[0068] In one embodiment, the serial port switching device includes at least two first serial port switching modules, and the first communication end also includes at least two one-to-one corresponding first communication ends. According to this embodiment, another optional working process of the serial port switching device of the embodiment of the application is that the first interface connector can simultaneously perform two-way communication signal debugging through the at least two first communication ends. The first communication process is described above, and the repeated part will not be described again. Specifically, the second communication process is that the first interface connector receives the communication signal from the embedded system through another first communication end and transmits the communication signal to the first level conversion unit on the second communication link. The communication signal can be a UART signal. The voltage detection unit simultaneously measures the port voltages of the two first communication ends, configures the output voltage of the corresponding first voltage stabilizing unit according to the corresponding port voltage, for example, the port voltage of the first communication end is 2.5V, and the output voltage of the first voltage stabilizing unit is 2.5V. The output voltage of the first voltage stabilizing unit is used as the reference voltage of the first level conversion unit to convert the voltage of the passing UART signal to the voltage supported by the first serial port conversion unit, for example, 5V. After the UART signal is converted to a USB format UART signal by the first serial port conversion unit, it is transmitted to the debugging end, such as a computer end, through the corresponding second interface connector. By setting at least two first serial port conversion modules, at least two serial port debugging can be performed, and the voltage conversion of at least two different communication signals can be adapted to meet more debugging requirements. In one possible embodiment, as shown in Figure 3As shown, in the two first serial port conversion modules, the first level conversion units all adopt Level shift chips, one of which is Level shift1 and the other is Level shift2; the two first serial port conversion units adopt USB to TTL serial port chips, which are USB to TTL1 and USB to TTL2 respectively, and specifically, both can adopt chip CP2102N; the second interface connector includes USB1 connector and USB2 connector, and the external computer end is a standard USB interface, which can be a USB-A standard interface, and the use of a standard USB interface can optimize the convenience and ease of use of debugging; the two first voltage stabilizing units adopt LDO chips, which are LDO1 and LDO2 respectively, and through the LDO chip, different and stable voltages are configured according to the voltage detection unit (MCU); specifically, the specific connection mode and working process of Level shift1, USB to TTL1 and LDO1 are shown in the above-mentioned one first serial port conversion module example, the other first communication end TX2 / RX2 of the TypeC connector is connected with the signal end A1 / A2 of Level shift2, the signal end B1 / B2 of Level shift2 is connected with the signal end TX2 / RX2 of USB to TTL2, the signal end D+ / D- of USB to TTL2 is connected with the signal end D+ / D- of USB2, thereby forming a second communication link, the serial port signal input from the first communication end TX2 / RX2 of the TypeC connector, such as UART signal, is converted into USB format UART signal by USB to TTL2 and output to the computer end through the signal end D+ / D- of USB2, and the USB format communication signal input by the computer end through the signal end D+ / D- of USB2 is converted into the serial port format of the device to be debugged connected with the communication end TX2 / RX2 of the TypeC connector by USB to TTL2 and output to the connected embedded system through the communication end TX2 / RX2 of the TypeC connector; the voltage detection unit (MCU) collects the port voltage of the communication end TX2 / RX2 of the TypeC connector, and configures the output voltage of LDO2 according to the port voltage, the voltage output end of LDO2 is connected to the VCCA power end of Level shift2, and the output voltage of LDO2 is used as the reference voltage of Levelshift2, so that the voltage of the communication signal passing through Level shift2 is converted into the voltage of the signal output end, for example, if the port voltage of the communication end TX2 / RX2 of the TypeC connector is 1.8V, then if the voltage of the communication signal input from the TypeC connector is 1.8V, converted into 5V voltage conforming to USB2 or USB to TTL2 by Level shift2, if the communication signal input from USB2 is converted into 1.8V voltage conforming to the communication end TX2 / RX2 of TypeC connector by Level shift2, through the design of two-way communication link, the MCU can detect the port voltage of the two communication ports of TypeC connector at the same time, configure the corresponding LDO chip to convert the serial port signal, meet the multi-way debugging demand coverage of embedded system MCU+SOC.

[0069] In one possible implementation, referring to Figure 3 The serial port switching device can also be powered through the VBUS port of USB2. After connecting the power supply ports of various devices, power supply is performed. The VBUS port of USB2 can supply power to all devices in the device, or can be combined with USB1 for power supply, that is, the device can supply power to USB to TTL1 and LDO1 through the VBUS port of USB1, supply power to USB to TTL2, LDO2, Level shift2, MCU, Level shift1 and TypeC connector through the VBUS port of USB2, and supply power respectively, which is conducive to providing more stable working voltage. Figure 3 In one possible implementation, referring to

[0070] In one embodiment, the first interface connector further includes m second communication ends, and the serial port switching device further includes m second serial port switching modules, the m second communication ends correspond to the m second serial port switching modules one by one, each second serial port switching module includes a third interface connector, and the second communication end is in communication connection with the corresponding third interface connector. Specifically, referring to Figure 4, the third interface connector is a USB connector (USB3), the external computer end is a standard USB interface, which can be a USB-A standard interface; the signal end D+ / D- of the USB3 is connected with the second communication end D+ / D- of the TypeC connector, to form a third communication link, the communication link can directly communicate the USB serial port signal, the communication end D+ / D- of the TypeC connector can be directly connected with the USB end of the SOC for debugging, without the need for format and voltage level conversion, and the device has three links at the same time, which can realize three-way serial port debugging at the same time, cover the debugging needs of 1.8V-5V commonly used systems, and meet more debugging needs. It should be understood that Figure 4 The communication connection between the third interface connector and the second communication end is only an example, and the specific number of the second communication end and the third interface connector is not shown, and can be set according to actual needs.

[0071] In one possible implementation, referring to Figure 4 The serial port adapter device can also be powered through the VBUS port of the USB3, and the power supply ports of various devices are connected for power supply. The VBUS port of the USB3 can supply power to all devices in the device, or can be combined with the USB1 and the USB2 for power supply, that is, the device can supply power to the USB to TTL1 and the LDO1 through the VBUS port of the USB1, supply power to the USB to TTL2 and the LDO2 through the VBUS port of the USB2, and supply power to the TypeC connector, the Level shift1, the Level shift2 and the MCU through the VBUS port of the USB3, respectively, which is conducive to providing more stable working voltage and short-distance power supply according to the principle of proximity, and can avoid complex wiring.

[0072] In one possible implementation, the n second interface connectors and the m third interface connectors are centrally arranged in the same hub (HUB) (see Figure 5(As shown by the dotted line) The hub has an external USB interface, where USB1, USB2, and USB3 are replaced by a HUB, integrating the three computer-facing USB ports into a single standard USB interface. This standard USB interface is used for debugging and can cover the serial port functions of the MCU and SOC. Since performing SOC serial port functions and USB debugging simultaneously requires two USB ports on the computer, and if MCU serial port debugging is added, a total of three USB ports are required. This results in complex debugging wiring, numerous connection cables when connecting multiple devices, and increased setup time and risk, making it prone to human error or poor wiring causing link communication failures. There are also requirements for the number of external USB ports on the computer, i.e., computer configuration. Usually, a docking station is used to solve this problem, but this adds debugging equipment. Without adding debugging equipment, the integrated function of the HUB reduces the number of debugging cables and the use of debugging USB ports, lowers the requirements for wiring, and allows for direct plug-and-play connections, reducing debugging failures caused by connectivity issues, further optimizing the debugging environment, and improving work efficiency.

[0073] Furthermore, this application provides an on-chip debugging system, which includes an embedded system, a debugging device, and a serial port adapter as described above;

[0074] The embedded system connects to the serial port adapter via the first interface connector;

[0075] The debugging device is connected to the serial port adapter via the second interface connector.

[0076] In one implementation, such as Figure 5 As shown, the embedded system specifically includes an MCU and a SOC. The MCU uses UART for communication, while the SOC supports both USB and UART communication. Both the MCU and SOC of the embedded system communicate with external devices via their own Type-C connectors. The debugging device can be a computer. The first communication terminal connects to the UART pins of the embedded system's SOC and / or MCU, and the second communication terminal connects to the USB pins of the embedded system's SOC. Specifically, when embedded system debugging is required, the Type-C connector of the serial port adapter is connected to the Type-C connector of the embedded system. The computer connects to the serial port adapter via USB1, USB2, and USB3. Three-way serial port debugging can be performed simultaneously through the serial port adapter, i.e., simultaneous SoC serial port function, USB debugging, and embedded system MCU serial port debugging. Specific communication signal format and voltage conversions are detailed in the implementation method of the serial port adapter described above; repeated details will not be repeated.

[0077] In the description of the specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the description of the specification, the illustrative description of the above terms does not necessarily mean the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0078] In addition, the terms "first", "second" are only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features defined with "first", "second" can explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "a plurality of" is at least two, for example, two, three, etc., unless otherwise explicitly specified and limited.

[0079] In the present application, unless otherwise explicitly specified and limited, the terms "mounting", "connection", "connection", "fixing" and other terms should be understood in a broad sense, for example, can be fixedly connected, can also be detachably connected, or integrated; can be mechanically connected, can also be electrically connected; can be directly connected, can also be indirectly connected through an intermediate medium, can be the internal communication of two elements or the interaction relationship between two elements, unless otherwise explicitly limited. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.

[0080] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application.

Claims

1. A serial port switching device, characterized by The serial port adapter device comprises a voltage detection unit, a first interface connector for connecting an embedded system, and n first serial port adapter modules; n is greater than or equal to 1; Each of the first serial port adapter modules comprises a first voltage stabilizing unit, a first level conversion unit, a first serial port conversion unit, and a second interface connector for connecting a debugging device of the embedded system; The first interface connector comprises n first communication ends, the n first communication ends correspond to the n first serial port adapter modules one by one, each of the first communication ends is sequentially connected with the first level conversion unit, the first serial port conversion unit, and the second interface connector in the corresponding first serial port adapter module through a first branch, so as to mutually transmit communication signals between the first communication end and the second interface connector; The voltage detection unit is connected with the first communication end and the first voltage stabilizing unit respectively, and is used for detecting a port voltage of the first communication end and configuring an output voltage of the first voltage stabilizing unit according to the port voltage of the first communication end; the output voltage of the first voltage stabilizing unit is the same as the port voltage; The first level conversion unit is connected with the first communication end and the first voltage stabilizing unit respectively, and is used for converting a voltage of the communication signal received from a signal sending end into a first target voltage adapted by a signal receiving end according to the output voltage of the first voltage stabilizing unit; wherein the signal sending end is one of the first communication end and the second interface connector, and the signal receiving end is the other one of the first communication end and the second interface connector; The first serial port conversion unit is used for converting the communication signal received from the signal sending end into a signal format corresponding to the signal receiving end.

2. The serial port switching device of claim 1, wherein, The second interface connector is also used for supplying power to each device in the serial port adapter device.

3. The serial port switching apparatus according to claim 1, wherein Each of the first communication ends is sequentially connected with the first serial port conversion unit and the second interface connector in the corresponding first serial port adapter module through a second branch, so as to mutually transmit communication signals between the first communication end and the second interface connector, the first serial port conversion unit is connected with the first voltage stabilizing unit, and the first serial port conversion unit is also used for converting a voltage of the communication signal received from the signal sending end into a second target voltage adapted by the signal receiving end according to the output voltage of the first voltage stabilizing unit; the voltage conversion amplitude supported by the first serial port conversion unit is smaller than the voltage conversion amplitude supported by the first level conversion unit.

4. The serial port switching apparatus of claim 1, wherein The first interface connector further comprises m second communication ends, and the device further comprises m second serial port adapter modules, the m second communication ends correspond to the m second serial port adapter modules one by one; each of the second serial port adapter modules comprises a third interface connector, and each of the second communication ends is connected with the third interface connector of the corresponding second serial port adapter module; m is greater than or equal to 1.

5. The serial port switching apparatus according to claim 4, wherein The second interface connector and / or the third interface connector are used for supplying power to devices in the device.

6. The serial port switching apparatus of claim 4, wherein n second interface connectors and m third interface connectors are integrated in the same hub.

7. The serial port switching apparatus of claim 4, wherein The first interface connector is a Type C connector, and the second interface connector and / or the third interface connector is a standard USB connector.

8. The serial port switching apparatus of claim 6, wherein The hub has a USB interface externally.

9. A system for debugging, characterized by The debugging system comprises: an embedded system; a debugging device; and a serial port switching device as claimed in any one of claims 1-8 connected between the embedded system and the debugging device; wherein, the embedded system has at least one port connected with the first communication end; the second interface connector is connected with the debugging device, and the serial port switching device is used for mutually transmitting communication signals between the port and the debugging device and adjusting the voltage of the communication signals.

10. The commissioning system of claim 9, wherein, The port comprises a first UART port of an SOC and / or a second UART port of an MCU.