Serial port communication method and device, server, electronic equipment and storage medium
By receiving and comparing the serial port signals sent by the processor and the substrate management controller in complex programmable logic devices in the server, the problem of data parsing errors in the server serial port communication is solved, and the accuracy and reliability of communication is improved.
Patent Information
- Application Number
- CN202411166024.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-08-23
AI Technical Summary
In server serial communication, data parsing errors may occur due to the conversion of two formats of eSPI and UART, resulting in inaccurate and unreliable communication of server serial communication.
By receiving serial port signals sent by the processor and substrate management controller in complex programmable logic devices, and performing redundancy and comparison mechanisms, ensuring the correctness of the data. If inconsistent, add marks to distinguish the signal source and send directly through the external serial port to external devices.
It improves the accuracy and reliability of server serial port communication, avoids parsing errors in eSPI and UART format conversion, and ensures that the processor can transmit data to external devices normally when the substrate management controller is abnormal.
Smart Images

Figure CN118964270A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more specifically, to a serial communication method, device, server, electronic device and storage medium. Background Art
[0002] The current server industry is in a stage of rapid development. During the server system startup process, the boot loader log information can be output through the serial port to help administrators monitor the system startup status and diagnose startup problems. In addition, when the server encounters a fault during operation, the UART (Universal Asynchronous Receiver / Transmitter) serial port can also output error information, which is convenient for troubleshooting and system debugging.
[0003] In related technologies, the processor sends the data to be transmitted to the BMC (Baseboard Management Controller) through the eSPI (Enhanced Serial Peripheral Interface), and the BMC converts the data into serial port information and sends the serial port information to the CPLD (Complex Programmable Logic Device), which then sends the serial port information to the external device through the external serial port. It can be seen that the server converts the two formats of eSPI and UART, and data parsing errors may occur. When the BMC is abnormal, the server's serial port communication will be interrupted, and the processor cannot establish communication with the external device.
[0004] Therefore, how to improve the accuracy and reliability of server serial port communication is a technical problem that technical personnel in this field need to solve. Summary of the invention
[0005] The purpose of the present application is to provide a serial port communication method, device, server, electronic device and storage medium, which improve the accuracy and reliability of server serial port communication.
[0006] To achieve the above object, the present application provides a serial communication method, which is applied to a complex programmable logic device in a server, wherein the server includes a processor, a complex programmable logic device, a baseboard management controller and an external serial port, and the processor is connected to the complex programmable logic device through a first UART interface;
[0007] The method comprises:
[0008] receiving a first serial port signal including first target data from the processor, and receiving a second serial port signal including the first target data from the baseboard management controller;
[0009] Comparing whether the first serial port signal is consistent with the second serial port signal;
[0010] If they are consistent, sending the first serial port signal or the second serial port signal to the external device through the external serial port;
[0011] If they are inconsistent, add a first mark to the first serial port signal, add a second mark to the second serial port signal, and send the first serial port signal with the first mark and the second serial port signal with the second mark to the external device through the external serial port; wherein the first mark is used to mark that the first serial port signal originates from the processor, and the second mark is used to mark that the second serial port signal originates from the baseboard management controller.
[0012] Wherein, before receiving a first serial port signal including first target data from the processor and receiving a second serial port signal including the first target data from the baseboard management controller, the method further includes:
[0013] Determine the current serial port mode;
[0014] If the current serial port mode is the adaptive mode, the steps of receiving a first serial port signal including first target data from the processor and receiving a second serial port signal including the first target data from the baseboard management controller are performed.
[0015] Among them, determining the current serial port mode includes:
[0016] Determine the current serial port mode according to the jumper cap settings;
[0017] If the current serial port mode determined according to the setting of the jumper cap is the adaptive mode, a serial port mode modification command sent by the baseboard management controller is received, and the current serial port mode is re-determined according to the serial port mode modification command.
[0018] Wherein, if the current serial port mode is the adaptive mode, the method further includes:
[0019] Detecting whether the baseboard management controller is normal;
[0020] If yes, the steps of receiving a first serial port signal including first target data from the processor and receiving a second serial port signal including the first target data from the baseboard management controller are performed;
[0021] If not, the mode is switched to the processor mode to receive the first serial port signal including the first target data from the processor, and the first serial port signal is sent to the external device through the external serial port.
[0022] Wherein, the processor is connected to the baseboard management controller through a bus, the baseboard management controller is connected to the complex programmable logic device through a second UART interface, the complex programmable logic device is connected to the external serial port, and the server is connected to an external device through the external serial port;
[0023] After determining the current serial port mode, the method further includes:
[0024] If the current serial port mode is the processor mode, receiving a first serial port signal including the first target data from the processor through the first UART interface, and sending the first serial port signal to the external device through the external serial port;
[0025] If the current serial port mode is the baseboard management controller mode, a second serial port signal including the first target data is received from the baseboard management controller through the second UART interface, and the second serial port signal is sent to the external device through the external serial port; wherein the processor sends a first bus signal including the first target data to the baseboard management controller through a bus, and the baseboard management controller converts the first bus signal into the second serial port signal and sends it to the complex programmable logic device;
[0026] Correspondingly, if the current serial port mode is the adaptive mode, receiving a first serial port signal including first target data from the processor, and receiving a second serial port signal including the first target data from the baseboard management controller include:
[0027] The first serial port signal is received from the processor through the first UART interface, and the second serial port signal is received from the baseboard management controller through the second UART interface; wherein the processor sends a first bus signal containing the first target data to the baseboard management controller through a bus, and the baseboard management controller converts the first bus signal into the second serial port signal and sends it to the complex programmable logic device.
[0028] Among them, it also includes:
[0029] receiving, via the external serial port, a third serial port signal including second target data sent by the external device;
[0030] Sending the third serial port signal to the baseboard management controller through the second UART interface, so that the baseboard management controller converts the third serial port signal into a second bus signal and sends it to the processor;
[0031] The third serial port signal is sent to the processor through the first UART interface; wherein the processor selects the second target data to be received from the second bus signal and the third serial port signal according to preset configuration information.
[0032] To achieve the above object, the present application provides a serial communication device, which is applied to a complex programmable logic device in a server, wherein the server includes a processor, a complex programmable logic device, a baseboard management controller and an external serial port, and the processor is connected to the complex programmable logic device through a first UART interface;
[0033] The device comprises:
[0034] A first receiving module, configured to receive a first serial port signal including first target data from the processor, and receive a second serial port signal including the first target data from the baseboard management controller;
[0035] A comparison module, used for comparing whether the first serial port signal is consistent with the second serial port signal; if they are consistent, starting the work flow of the first sending module; if they are inconsistent, starting the work flow of the second sending module;
[0036] The first sending module is used to send the first serial port signal or the second serial port signal to an external device through the external serial port;
[0037] The second sending module is used to add a first mark to the first serial port signal, add a second mark to the second serial port signal, and send the first serial port signal with the first mark and the second serial port signal with the second mark to the external device through the external serial port; wherein the first mark is used to mark that the first serial port signal originates from the processor, and the second mark is used to mark that the second serial port signal originates from the baseboard management controller.
[0038] To achieve the above-mentioned object, the present application provides a server, including a processor, a complex programmable logic device, a baseboard management controller and an external serial port, wherein the processor is connected to the complex programmable logic device through a first UART interface, the processor is connected to the baseboard management controller through an eSPI bus, the baseboard management controller is connected to the complex programmable logic device through a second UART interface, the complex programmable logic device is connected to the external serial port, and the server is connected to an external device through the external serial port;
[0039] The processor is used to send a first serial port signal containing first target data to the complex programmable logic device and send a first bus signal containing the first target data to the baseboard management controller;
[0040] The baseboard management controller is used to convert the first bus signal into a second serial port signal and send it to the complex programmable logic device;
[0041] The complex programmable logic device is used to compare whether the first serial port signal is consistent with the second serial port signal; if they are consistent, the first serial port signal or the second serial port signal is sent to the external device through the external serial port; if they are inconsistent, a first mark is added to the first serial port signal, a second mark is added to the second serial port signal, and the first serial port signal with the first mark and the second serial port signal with the second mark are sent to the external device through the external serial port; wherein the first mark is used to mark that the first serial port signal originates from the processor, and the second mark is used to mark that the second serial port signal originates from the baseboard management controller.
[0042] To achieve the above objectives, the present application provides an electronic device, including:
[0043] Memory for storing computer programs;
[0044] A processor is used to implement the steps of the above-mentioned serial communication method when executing the computer program.
[0045] To achieve the above-mentioned purpose, the present application provides a non-volatile storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned serial communication method are implemented.
[0046] The serial port communication method provided in the present application transmits the first serial port signal directly output by the processor and the second serial port signal parsed by the baseboard management controller from the processor to the complex programmable logic device, and the complex programmable logic device ensures the correctness of the data transmitted to the external device through redundancy and comparison mechanisms. It can be seen that in the present application, the processor can directly transmit the first target data to the complex programmable logic device through the first serial port signal, without the need for eSPI and UART format conversion. When the baseboard management controller is abnormal, the processor can also transmit data to the external device, thereby improving the accuracy and reliability of the server serial port communication. The present application also discloses a serial port communication device, an electronic device, a non-volatile storage medium and a computer program product, which can also achieve the above-mentioned technical effects.
[0047] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. The drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific implementation methods, they are used to explain the present disclosure, but do not constitute a limitation to the present disclosure. In the drawings:
[0049] Figure 1 A structural diagram of a server in the related art;
[0050] Figure 2 is a structural diagram of a server according to an exemplary embodiment;
[0051] Figure 3 is a flow chart of a serial communication method according to an exemplary embodiment;
[0052] Figure 4 is a flow chart of another serial communication method according to an exemplary embodiment;
[0053] Figure 5 is a flow chart of another serial communication method according to an exemplary embodiment;
[0054] Figure 6 A flowchart of a CPLD receiving a serial port signal according to an exemplary embodiment is shown;
[0055] Figure 7 A flowchart of a CPU receiving a serial port signal according to an exemplary embodiment is shown;
[0056] Figure 8 is a structural diagram of a serial communication device according to an exemplary embodiment;
[0057] Fig. 9 The figure is a structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0058] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In addition, in the embodiments of the present application, "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0059] In the related art, the server serial port design is as follows Figure 1 As shown in the figure, the CPU (Central Processing Unit) exchanges the serial port information of the system with the main control chip BMC of the out-of-band management of the motherboard through the eSPI bus; the BMC extracts, parses and converts the serial port information received by the eSPI into the UART bus format to communicate with the CPLD, and converts the serial port information received from the CPLD into the eSPI format and passes it to the CPU; the CPLD connects the UART serial port of the BMC to the physical serial port interface; the external device (HOST) uses a cable to connect to the server UART serial port to realize UART communication with the CPU.
[0060] It can be seen that in the relevant technology, the server converts the two formats of eSPI and UART internally, and data parsing errors may occur. When the BMC is abnormal, the serial port communication of the server will be interrupted, and the processor cannot establish communication with the external device.
[0061] Therefore, in the present application, the first serial port signal directly output by the processor and the second serial port signal parsed by the baseboard management controller from the processor are transmitted to the complex programmable logic device, and the complex programmable logic device ensures the correctness of the data transmitted to the external device through redundancy and comparison mechanisms. It can be seen that in the present application, the processor can directly transmit the first target data to the complex programmable logic device through the first serial port signal, without the need for eSPI and UART format conversion. When the baseboard management controller is abnormal, the processor can also transmit data to the external device, which improves the accuracy and reliability of the server serial port communication.
[0062] This embodiment provides a server, such as Figure 2 As shown, it includes a processor, a complex programmable logic device, a baseboard management controller and an external serial port, the processor is connected to the complex programmable logic device through a first UART interface, the processor is connected to the baseboard management controller through an eSPI bus, the baseboard management controller is connected to the complex programmable logic device through a second UART interface, the complex programmable logic device is connected to the external serial port, and the server is connected to an external device through the external serial port;
[0063] In a specific implementation, the processor is connected to the complex programmable logic device through a first UART interface, the processor is connected to the baseboard management controller through an eSPI bus, the baseboard management controller is connected to the complex programmable logic device through a second UART interface, and the complex programmable logic device is connected to an external device through an external serial port.
[0064] The processor is used to send a first serial port signal containing first target data to the complex programmable logic device and send a first bus signal containing the first target data to the baseboard management controller;
[0065] The baseboard management controller is used to convert the first bus signal into a second serial port signal and send it to the complex programmable logic device;
[0066] The complex programmable logic device is used to compare whether the first serial port signal is consistent with the second serial port signal; if they are consistent, the first serial port signal or the second serial port signal is sent to the external device through the external serial port; if they are inconsistent, a first mark is added to the first serial port signal, a second mark is added to the second serial port signal, and the first serial port signal with the first mark and the second serial port signal with the second mark are sent to the external device through the external serial port; wherein the first mark is used to mark that the first serial port signal originates from the processor, and the second mark is used to mark that the second serial port signal originates from the baseboard management controller.
[0067] In a specific implementation, when the processor needs to transmit the first target data to the external device, the processor directly sends the first serial port signal containing the first target data to the complex programmable logic device through the first UART interface. At the same time, the processor sends the first bus signal containing the first target data to the baseboard management controller through the eSPI bus. The baseboard management controller parses it and converts it into a second serial port signal containing the first target data, and then sends it to the complex programmable logic device through the second UART interface. That is, the complex programmable logic device simultaneously receives the first serial port signal containing the first target data from the processor and the second serial port signal containing the first target data from the baseboard management controller.
[0068] The complex programmable logic device compares the first serial port signal and the second serial port signal to see if they are consistent. If they are consistent, it selects any serial port signal and sends it to the external device through the external serial port. If they are inconsistent, it records the corresponding log and adds source tags to different serial port signals respectively, and then sends them to the external device through the external serial port at the same time. After the external device receives different serial port signals, it determines which communication channel has a problem by comparison. In addition, if the complex programmable logic device detects that one channel has no output and the other channel supports output, it records the log of the abnormal serial port channel without output.
[0069] Furthermore, different serial port modes can be selected, including processor mode, baseboard management controller mode, and adaptive mode. In specific implementation, a jumper cap can be set on the CPLD to allow the CPLD to initially select which serial port signal is connected to the server's external serial port, that is, the serial port mode. In addition to the jumper cap setting, the CPLD serial port mode can also be implemented by sending I2C commands through the BMC. When the jumper cap is set in adaptive mode, the CPLD can receive I2C (Inter-Integrated Circuit) commands to modify the serial port mode. In the processor mode or baseboard management controller mode, it will be forced to lock in this mode. Other I2C or serial port commands cannot be changed, and it supports sending commands to the CPLD through an external serial port or I2C to obtain the current serial port mode.
[0070] If the current serial port mode is the processor mode, the first serial port signal sent directly from the processor to the complex programmable logic device is used as the serial port signal transmitted to the external device. If the current serial port mode is the baseboard management controller mode, the second serial port signal sent from the baseboard management controller to the complex programmable logic device is used as the serial port signal transmitted to the external device. If the current serial port mode is the adaptive mode, the complex programmable logic device simultaneously receives the first serial port signal containing the first target data from the processor and the second serial port signal containing the first target data from the baseboard management controller, and compares whether the first serial port signal and the second serial port signal are consistent. If they are consistent, any serial port signal is selected to be sent to the external device through the external serial port. If they are inconsistent, the corresponding log is recorded, and source tags are added to different serial port signals respectively, and then they are sent to the external device through the external serial port at the same time.
[0071] The server provided in the embodiment of the present application transmits the first serial port signal directly output by the processor and the second serial port signal parsed by the baseboard management controller from the processor to the complex programmable logic device, and the complex programmable logic device ensures the correctness of the data transmitted to the external device through redundancy and comparison mechanisms. It can be seen that in the embodiment of the present application, the processor can directly transmit the first target data to the complex programmable logic device through the first serial port signal, without the need for eSPI and UART format conversion, and the processor can also transmit data to the external device when the baseboard management controller is abnormal, thereby improving the accuracy and reliability of the server serial port communication.
[0072] The embodiment of the present application discloses a serial port communication method, which improves the accuracy and reliability of server serial port communication.
[0073] See also Figure 3 , a flowchart of a serial communication method according to an exemplary embodiment is shown, such as Figure 3 As shown, including:
[0074] S101: receiving a first serial port signal including first target data from a processor, and receiving a second serial port signal including the first target data from a baseboard management controller;
[0075] The processor sends a first bus signal containing first target data to the baseboard management controller, and the baseboard management controller converts the first bus signal into a second serial port signal and sends it to the complex programmable logic device;
[0076] The execution subject of this application is the complex programmable logic device in the above-mentioned server. In a specific implementation, when the processor needs to transmit the first target data to the external device, the processor directly sends the first serial port signal containing the first target data to the complex programmable logic device through the first UART interface. At the same time, the processor sends the first bus signal containing the first target data to the baseboard management controller through the eSPI bus. The baseboard management controller parses it and converts it into a second serial port signal containing the first target data, and then sends it to the complex programmable logic device through the second UART interface. That is, the complex programmable logic device simultaneously receives the first serial port signal containing the first target data from the processor and the second serial port signal containing the first target data from the baseboard management controller.
[0077] S102: Compare the first serial port signal and the second serial port signal to see if they are consistent; if they are consistent, proceed to S103; if they are inconsistent, proceed to S104;
[0078] S103: Sending the first serial port signal or the second serial port signal to an external device through an external serial port;
[0079] S104: Add a first mark to the first serial port signal, add a second mark to the second serial port signal, and send the first serial port signal with the first mark and the second serial port signal with the second mark to an external device through an external serial port; wherein the first mark is used to mark that the first serial port signal originates from the processor, and the second mark is used to mark that the second serial port signal originates from the baseboard management controller.
[0080] In a specific implementation, the complex programmable logic device compares the first serial port signal and the second serial port signal to see if they are consistent. If they are consistent, any serial port signal is selected to be sent to the external device through the external serial port. If they are inconsistent, the corresponding log is recorded, and source tags are added to different serial port signals respectively, and then they are sent to the external device through the external serial port at the same time. After the external device receives different serial port signals, it determines which communication channel has a problem by comparison. In addition, if the complex programmable logic device detects that one channel has no output and the other supports output, a log of the abnormality of the serial port channel without output is recorded.
[0081] The serial port communication method provided in the embodiment of the present application transmits the first serial port signal directly output by the processor and the second serial port signal parsed by the baseboard management controller from the processor to the complex programmable logic device, and the complex programmable logic device ensures the correctness of the data transmitted to the external device through redundancy and comparison mechanisms. It can be seen that in the embodiment of the present application, the processor can directly transmit the first target data to the complex programmable logic device through the first serial port signal, without the need for eSPI and UART format conversion, and the processor can also transmit data to the external device when the baseboard management controller is abnormal, thereby improving the accuracy and reliability of the server serial port communication.
[0082] The embodiment of the present application discloses a serial communication method. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically:
[0083] See also Figure 4 , a flowchart of another serial communication method according to an exemplary embodiment is shown, such as Figure 4 As shown, including:
[0084] S201: Determine the current serial port mode;
[0085] In this embodiment, different serial port modes may be selected, including processor mode, baseboard management controller mode, and adaptive mode.
[0086] As a feasible implementation method, determining the current serial port mode includes: determining the current serial port mode according to the setting of the jumper cap; if the current serial port mode determined according to the setting of the jumper cap is an adaptive mode, receiving a serial port mode modification command sent by the baseboard management controller, and re-determining the current serial port mode according to the serial port mode modification command.
[0087] In the specific implementation, a jumper cap can be set on the CPLD to be used by the CPLD to initially select which serial port signal is connected to the external serial port of the server, that is, the serial port mode. In addition to the jumper cap setting, the CPLD serial port mode can also be implemented by sending I2C commands through the BMC. When the jumper cap is set in adaptive mode, the CPLD can receive I2C commands to modify the serial port mode. In the processor mode or baseboard management controller mode, it will be forced to lock in this mode. Other I2C or serial port commands cannot be changed, and it supports sending commands to the CPLD through the external serial port or I2C to obtain the current serial port mode.
[0088] S202: If the current serial port mode is the processor mode, receiving a first serial port signal including first target data from the processor through the first UART interface, and sending the first serial port signal to an external device through the external serial port;
[0089] In a specific implementation, if the current serial port mode is the processor mode, the first serial port signal directly sent by the processor to the complex programmable logic device is used as the serial port signal transmitted to the external device.
[0090] S203: If the current serial port mode is the baseboard management controller mode, receiving a second serial port signal including the first target data from the baseboard management controller through the second UART interface, and sending the second serial port signal to the external device through the external serial port;
[0091] The processor sends a first bus signal containing first target data to the baseboard management controller through the eSPI bus, and the baseboard management controller converts the first bus signal into a second serial port signal and sends it to the complex programmable logic device;
[0092] In a specific implementation, if the current serial port mode is the baseboard management controller mode, the second serial port signal sent by the baseboard management controller to the complex programmable logic device is used as the serial port signal transmitted to the external device.
[0093] S204: If the current serial port mode is the adaptive mode, a first serial port signal is received from the processor through the first UART interface, and a second serial port signal is received from the baseboard management controller through the second UART interface; the first serial port signal is compared with the second serial port signal to see if they are consistent; if they are consistent, the first serial port signal or the second serial port signal is sent to the external device through the external serial port; if they are inconsistent, a first mark is added to the first serial port signal, a second mark is added to the second serial port signal, and the first serial port signal with the first mark and the second serial port signal with the second mark are sent to the external device through the external serial port;
[0094] The processor sends a first bus signal containing first target data to the baseboard management controller through the eSPI bus, and the baseboard management controller converts the first bus signal into a second serial port signal and sends it to the complex programmable logic device.
[0095] As a feasible implementation mode, if the current serial port mode is an adaptive mode, the method also includes: detecting whether the baseboard management controller is normal; if so, executing the steps of receiving a first serial port signal containing first target data from the processor, and receiving a second serial port signal containing the first target data from the baseboard management controller; if not, switching to the processor mode to receive the first serial port signal containing the first target data from the processor, and sending the first serial port signal to the external device through the external serial port.
[0096] In a specific implementation, the CPLD determines whether the BMC is normal by detecting the WDT (Watchdog Timer) signal of the BMC. If the BMC is abnormal, the CPLD switches to the processor mode. If the BMC is normal, the processing flow of the adaptive mode is executed normally. The processing flow of the adaptive mode has been described in detail in the previous embodiment and will not be repeated here.
[0097] It can be seen that in this embodiment, different serial port modes and different serial port communication methods are selected to enable the processor to transmit the first target data to the external device.
[0098] The present application embodiment discloses a serial communication method, specifically:
[0099] See also Figure 5 , a flowchart of another serial communication method according to an exemplary embodiment is shown, such as Figure 5 As shown, including:
[0100] S301: receiving a third serial port signal including second target data sent by an external device through an external serial port;
[0101] S302: Sending the third serial port signal to the baseboard management controller through the second UART interface, so that the baseboard management controller converts the third serial port signal into a second bus signal and sends it to the processor;
[0102] S303: Send the third serial port signal to the processor through the first UART interface; wherein the processor selects the second target data to be received from the second bus signal and the third serial port signal according to preset configuration information.
[0103] In a specific implementation, when an external device needs to transmit the second target data to the processor in the server, the external device sends a third serial port signal containing the second target data to the CPLD, and the CPLD sends the third serial port signal to the processor through the first UART interface, and at the same time sends it to the BMC through the second UART interface, and the BMC parses and converts it into a second bus signal containing the second target data, and sends it to the processor through the eSPI bus. The processor can choose which signal to process according to the preset configuration information of the BIOS (Basic Input / Output System), and the preset configuration information can be changed through the BIOS Setup setting or the command of the BMC.
[0104] As a preferred implementation, the CPLD can also distinguish the current serial port mode. If the current serial port mode is the processor mode, the CPLD sends the third serial port signal to the processor through the first UART interface, and the processor receives the second target data in the third serial port signal. If the current serial port mode is the baseboard management controller mode, the CPLD sends the third serial port signal to the BMC through the second UART interface, the BMC parses and converts it into a second bus signal containing the second target data, and sends it to the processor through the eSPI bus, and the processor receives the second target data in the second bus signal. If the current serial port mode is the adaptive mode, the CPLD sends the third serial port signal to the processor through the first UART interface, and sends it to the BMC through the second UART interface at the same time. The BMC parses and converts it into a second bus signal containing the second target data, and sends it to the processor through the eSPI bus. The processor selects which signal to process according to the preset configuration information.
[0105] An application example provided by the present application is described below. Figure 6 As shown, the process of CPLD receiving serial port signals includes the following steps:
[0106] Step 1. CPLD detects the UART mode set by the jumper cap, whether it is BMC UART, CPU UART or UART adaptive. When UART adaptive is detected, it is also necessary to detect whether the I2C or UART command is switched to other modes.
[0107] Step 2: When the serial port mode is BMC UART, the CPLD ignores the output data of the CPU UART, and other implementation schemes are the same as the prior art scheme;
[0108] Step 3: When the serial port mode is CPU UART, the CPLD ignores the output data of the BMC UART, parses the output data of the CPU UART and forwards it to the UART external serial port;
[0109] Step 4: When the serial port mode is UART adaptive, CPLD supports detecting the WDT signal of BMC. When the WDT signal is abnormal, CPLD only parses the UART data sent by CPU. When BMC WDT is normal, CPLD receives the UART information of BMC CPU at the same time and compares them. When the comparison results are consistent, CPLD directly forwards the data to the external serial port interface. When the data of the two are inconsistent, CPLD marks the inconsistent data and forwards them to the external interface for output.
[0110] like Figure 7 As shown, the process of CPU receiving serial port signals includes the following steps:
[0111] Step 1: When the HOST needs to send data to the CPU, the CPLD only needs to send the serial port data received by the external interface to the CPU UART and BMC UART respectively. The BMC receives the UART data from the CPLD, parses and packages it, and then feeds it back to the CPU through eSPI.
[0112] Step 2: The CPU selects the serial port source to be received, CPU UART or eSPI, through the BIOS settings or BMC commands.
[0113] A serial communication device provided in an embodiment of the present application is introduced below. The serial communication device described below and the serial communication method described above can be referenced to each other.
[0114] See also Figure 8 , a structural diagram of a serial communication device according to an exemplary embodiment, such as Figure 8 As shown, including:
[0115] The first receiving module 801 is used to receive a first serial port signal including first target data from a processor, and receive a second serial port signal including first target data from a baseboard management controller;
[0116] The comparison module 802 is used to compare whether the first serial port signal and the second serial port signal are consistent; if they are consistent, the work flow of the first sending module is started; if they are inconsistent, the work flow of the second sending module is started;
[0117] A first sending module 803, used to send the first serial port signal or the second serial port signal to an external device through an external serial port;
[0118] The second sending module 804 is used to add a first mark to the first serial port signal, add a second mark to the second serial port signal, and send the first serial port signal with the first mark and the second serial port signal with the second mark to an external device through an external serial port; wherein the first mark is used to mark that the first serial port signal originates from the processor, and the second mark is used to mark that the second serial port signal originates from the baseboard management controller.
[0119] The serial port communication device provided in the embodiment of the present application transmits the first serial port signal directly output by the processor and the second serial port signal parsed by the baseboard management controller from the processor to the complex programmable logic device, and the complex programmable logic device ensures the correctness of the data transmitted to the external device through redundancy and comparison mechanisms. It can be seen that in the embodiment of the present application, the processor can directly transmit the first target data to the complex programmable logic device through the first serial port signal, without the need for eSPI and UART format conversion, and the processor can also transmit data to the external device when the baseboard management controller is abnormal, thereby improving the accuracy and reliability of the server serial port communication.
[0120] Based on the above embodiment, as a preferred implementation, it also includes:
[0121] The determination module is used to determine the current serial port mode; if the current serial port mode is the adaptive mode, the working process of the first receiving module 801 is started.
[0122] Based on the above embodiments, as a preferred implementation mode, the determination module is specifically used to: determine the current serial port mode according to the setting of the jumper cap; if the current serial port mode determined according to the setting of the jumper cap is an adaptive mode, then receive the serial port mode modification command sent by the baseboard management controller, and redetermine the current serial port mode according to the serial port mode modification command.
[0123] Based on the above embodiment, as a preferred implementation, if the current serial port mode is the adaptive mode, it also includes:
[0124] A detection module is used to detect whether the baseboard management controller is normal; if so, the working process of the first receiving module 801 is started; if not, it is switched to the processor mode to receive the first serial port signal containing the first target data from the processor, and send the first serial port signal to the external device through the external serial port.
[0125] Based on the above embodiment, as a preferred implementation, if the current serial port mode is the processor mode, it also includes:
[0126] The second receiving module is used to receive a first serial port signal including the first target data from the processor through the first UART interface, and send the first serial port signal to the external device through the external serial port.
[0127] Based on the above embodiment, as a preferred implementation mode, the processor is connected to the baseboard management controller through the eSPI bus, the baseboard management controller is connected to the complex programmable logic device through the second UART interface, the complex programmable logic device is connected to the external serial port, and the server is connected to the external device through the external serial port;
[0128] If the current serial port mode is the baseboard management controller mode, the method further includes:
[0129] a third receiving module, configured to receive a second serial port signal containing the first target data from the baseboard management controller through the second UART interface, and send the second serial port signal to the external device through the external serial port; wherein the processor sends a first bus signal containing the first target data to the baseboard management controller through the eSPI bus, and the baseboard management controller converts the first bus signal into the second serial port signal and sends it to the complex programmable logic device.
[0130] Based on the above embodiments, as a preferred implementation mode, the first receiving module 801 is specifically used to: receive the first serial port signal from the processor through the first UART interface, and receive the second serial port signal from the baseboard management controller through the second UART interface; wherein the processor sends the first bus signal containing the first target data to the baseboard management controller through the eSPI bus, and the baseboard management controller converts the first bus signal into the second serial port signal and sends it to the complex programmable logic device.
[0131] Based on the above embodiment, as a preferred implementation, it also includes:
[0132] a fourth receiving module, configured to receive, through the external serial port, a third serial port signal including second target data and sent by the external device;
[0133] a third sending module, configured to send the third serial port signal to the baseboard management controller through the second UART interface, so that the baseboard management controller converts the third serial port signal into a second bus signal and sends it to the processor;
[0134] A fourth sending module is used to send the third serial port signal to the processor through the first UART interface; wherein the processor selects the second target data to be received from the second bus signal and the third serial port signal according to preset configuration information.
[0135] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0136] Based on the hardware implementation of the above program module, and in order to implement the method of the embodiment of the present application, the embodiment of the present application also provides an electronic device, Fig. 9 FIG. 1 is a structural diagram of an electronic device according to an exemplary embodiment. Fig. 9 As shown, the electronic equipment includes:
[0137] Communication interface 1, capable of exchanging information with other devices such as network devices;
[0138] The processor 2 is connected to the communication interface 1 to realize information exchange with other devices and is used to execute the serial communication method provided by one or more technical solutions when running a computer program. The computer program is stored in the memory 3.
[0139] Of course, in actual application, the various components in the electronic device are coupled together through the bus system 4. It can be understood that the bus system 4 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 4 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Fig. 9 Various buses are labeled as bus system 4 .
[0140] The memory 3 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program used to operate on the electronic device.
[0141] It can be understood that the memory 3 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAMbus random access memory (DRRAM, Direct Rambus Random Access Memory).The memory 3 described in the embodiments of the present application is intended to include but is not limited to these and any other suitable types of memories.
[0142] The method disclosed in the above embodiment of the present application can be applied to the processor 2, or implemented by the processor 2. The processor 2 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 2 or the instruction in the form of software. The above processor 2 may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 2 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in the memory 3, and the processor 2 reads the program in the memory 3 and completes the steps of the above method in combination with its hardware.
[0143] When the processor 2 executes the program, the corresponding processes in the various methods of the embodiments of the present application are implemented, which will not be repeated here for the sake of brevity.
[0144] In an exemplary embodiment, the embodiment of the present application further provides a non-volatile storage medium storing a computer program, which can be executed by the processor 2 to complete the steps of the aforementioned method.
[0145] In an exemplary embodiment, the present application also provides a computer program product, including a computer program, which is executed by the processor 2 to complete the steps of the aforementioned method.
[0146] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to computer program instructions, and the aforementioned computer program can be stored in a non-volatile storage medium. When the computer program is executed, it executes the steps of the above-mentioned method embodiment. Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or partly embodied in the form of a software product, which is stored in a non-volatile storage medium and includes a number of instructions for an electronic device (which can be a personal computer, a server, a network device, etc.) to execute all or part of the methods described in each embodiment of the present application.
[0147] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A serial communication method, It is characterized in that A complex programmable logic device applied to a server, the server comprising a processor, a complex programmable logic device, a baseboard management controller and an external serial port, the processor being connected to the complex programmable logic device via a first UART interface; The method comprises: receiving a first serial port signal including first target data from the processor, and receiving a second serial port signal including the first target data from the baseboard management controller; Comparing whether the first serial port signal is consistent with the second serial port signal; If they are consistent, sending the first serial port signal or the second serial port signal to the external device through the external serial port; If they are inconsistent, add a first mark to the first serial port signal, add a second mark to the second serial port signal, and send the first serial port signal with the first mark and the second serial port signal with the second mark to the external device through the external serial port; wherein the first mark is used to mark that the first serial port signal originates from the processor, and the second mark is used to mark that the second serial port signal originates from the baseboard management controller.
2. According to the serial communication method of claim 1, It is characterized in that Before receiving a first serial port signal including first target data from the processor and receiving a second serial port signal including the first target data from the baseboard management controller, the method further includes: Determine the current serial port mode; If the current serial port mode is the adaptive mode, the steps of receiving a first serial port signal including first target data from the processor and receiving a second serial port signal including the first target data from the baseboard management controller are performed.
3. According to the serial communication method of claim 2, It is characterized in that Determine the current serial port mode, including: Determine the current serial port mode according to the jumper cap settings; If the current serial port mode determined according to the setting of the jumper cap is the adaptive mode, a serial port mode modification command sent by the baseboard management controller is received, and the current serial port mode is re-determined according to the serial port mode modification command.
4. According to the serial communication method of claim 2, It is characterized in that If the current serial port mode is the adaptive mode, the method further includes: Detecting whether the baseboard management controller is normal; If yes, the steps of receiving a first serial port signal including first target data from the processor and receiving a second serial port signal including the first target data from the baseboard management controller are performed; If not, the mode is switched to the processor mode to receive the first serial port signal including the first target data from the processor, and the first serial port signal is sent to the external device through the external serial port.
5. According to the serial communication method of claim 2, It is characterized in that The processor is connected to the baseboard management controller via a bus, the baseboard management controller is connected to the complex programmable logic device via a second UART interface, the complex programmable logic device is connected to the external serial port, and the server is connected to an external device via the external serial port; After determining the current serial port mode, the method further includes: If the current serial port mode is the processor mode, receiving a first serial port signal including the first target data from the processor through the first UART interface, and sending the first serial port signal to the external device through the external serial port; If the current serial port mode is the baseboard management controller mode, a second serial port signal including the first target data is received from the baseboard management controller through the second UART interface, and the second serial port signal is sent to the external device through the external serial port; wherein the processor sends a first bus signal including the first target data to the baseboard management controller through a bus, and the baseboard management controller converts the first bus signal into the second serial port signal and sends it to the complex programmable logic device; Correspondingly, if the current serial port mode is the adaptive mode, receiving a first serial port signal including first target data from the processor, and receiving a second serial port signal including the first target data from the baseboard management controller include: The first serial port signal is received from the processor through the first UART interface, and the second serial port signal is received from the baseboard management controller through the second UART interface; wherein the processor sends a first bus signal containing the first target data to the baseboard management controller through a bus, and the baseboard management controller converts the first bus signal into the second serial port signal and sends it to the complex programmable logic device.
6. According to the serial communication method of claim 1, It is characterized in that Also includes: receiving, via the external serial port, a third serial port signal including second target data sent by the external device; Sending the third serial port signal to the baseboard management controller through the second UART interface, so that the baseboard management controller converts the third serial port signal into a second bus signal and sends it to the processor; The third serial port signal is sent to the processor through the first UART interface; wherein the processor selects the second target data to be received from the second bus signal and the third serial port signal according to preset configuration information.
7. A serial communication device, It is characterized in that A complex programmable logic device applied to a server, the server comprising a processor, a complex programmable logic device, a baseboard management controller and an external serial port, the processor being connected to the complex programmable logic device via a first UART interface; The device comprises: A first receiving module, configured to receive a first serial port signal including first target data from the processor, and receive a second serial port signal including the first target data from the baseboard management controller; A comparison module, used for comparing whether the first serial port signal is consistent with the second serial port signal; if they are consistent, starting the work flow of the first sending module; if they are inconsistent, starting the work flow of the second sending module; The first sending module is used to send the first serial port signal or the second serial port signal to an external device through the external serial port; The second sending module is used to add a first mark to the first serial port signal, add a second mark to the second serial port signal, and send the first serial port signal with the first mark and the second serial port signal with the second mark to the external device through the external serial port; wherein the first mark is used to mark that the first serial port signal originates from the processor, and the second mark is used to mark that the second serial port signal originates from the baseboard management controller.
8. A server, It is characterized in that It includes a processor, a complex programmable logic device, a baseboard management controller and an external serial port, wherein the processor is connected to the complex programmable logic device through a first UART interface, the processor is connected to the baseboard management controller through an eSPI bus, the baseboard management controller is connected to the complex programmable logic device through a second UART interface, the complex programmable logic device is connected to the external serial port, and the server is connected to an external device through the external serial port; The processor is used to send a first serial port signal containing first target data to the complex programmable logic device and send a first bus signal containing the first target data to the baseboard management controller; The baseboard management controller is used to convert the first bus signal into a second serial port signal and send it to the complex programmable logic device; The complex programmable logic device is used to compare whether the first serial port signal is consistent with the second serial port signal; if they are consistent, the first serial port signal or the second serial port signal is sent to the external device through the external serial port; if they are inconsistent, a first mark is added to the first serial port signal, a second mark is added to the second serial port signal, and the first serial port signal with the first mark and the second serial port signal with the second mark are sent to the external device through the external serial port; wherein the first mark is used to mark that the first serial port signal originates from the processor, and the second mark is used to mark that the second serial port signal originates from the baseboard management controller.
9. An electronic device, It is characterized in that include: Memory for storing computer programs; A processor, configured to implement the steps of the serial port communication method according to any one of claims 1 to 6 when executing the computer program.
10. A non-volatile storage medium, It is characterized in that The non-volatile storage medium stores a computer program, and when the computer program is executed, the steps of the serial communication method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Serial port debugging system and method
CN115878404A
UART serial port debugging method and device, management board card and medium
CN116048904A
Server security management module and server
CN116502594A
Server control method and device, terminal equipment and readable storage medium
CN117235004A
Data communication method and device, electronic equipment and nonvolatile storage medium
CN117687949A
Cited By
Electronic equipment, data transmission system and data transmission method
CN121210345A
Electronic device, data transmission system and data transmission method
CN121210345B
IC equipment control method and system
CN121681439A
I²C Equipment Control Methods and Systems
CN121681439B
