Detection and diagnosis method and device for MCU integrated circuit board

Through the operation instruction set and simplified communication protocol for the basic modules inside the MCU, the problems of protocol complexity and resource waste in the detection and diagnosis of MCU integrated circuit boards are solved, and efficient and low-cost detection and diagnosis are achieved.

CN120670274APending Publication Date: 2025-09-19慧翰微电子股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510739511.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-04
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

The detection and diagnosis protocols of traditional MCU integrated circuit boards need to be frequently updated, and the protocol structure is complex, resulting in waste of communication bandwidth resources and high software management costs.

Method used

It adopts an operating instruction set for the basic modules inside the MCU, sends detection and diagnosis requests to the MCU through a preset communication protocol, uses ASCII plain text characters for communication, simplifies the data structure, uses the receive wait timeout to determine the data packet boundary, and lowers the operation threshold.

Benefits of technology

It improves the flexibility and scalability of the communication protocol, reduces the number of MCU software changes and management costs, simplifies the communication load, and improves detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120670274A_ABST
    Figure CN120670274A_ABST
Patent Text Reader

Abstract

The invention provides a detection and diagnosis method and device for an MCU integrated circuit board, and relates to the technical field of micro-control units. The method comprises the following steps: sending a detection and diagnosis request to an MCU based on a preset communication protocol, wherein the detection and diagnosis request carries an MCU operation instruction; receiving a detection and diagnosis result which is returned by the MCU and responds to the detection and diagnosis request; the preset communication protocol comprises an operation instruction set oriented to an internal basic module of the MCU. The communication protocol is easy to understand and use, and human resource consumption of MCU software research and development when the production line technological process is changed can be reduced. Meanwhile, the flexibility and the expandability of the communication protocol can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of microcontroller units, and in particular to a detection and diagnosis method, device, electronic device and storage medium for MCU integrated circuit boards. Background Art

[0002] Traditional microcontroller unit (MCU) communication protocols are typically designed for external devices. Changes to external circuits or device models require MCU software updates to accommodate these changes. Furthermore, these protocols often use a binary format, which is difficult to read and requires specialized tools for parsing and communication. Furthermore, traditional protocols contain structures such as frame headers, footers, and checksums, which waste communication bandwidth for scenarios like MCU integrated circuit board testing and diagnosis. Summary of the Invention

[0003] The purpose of this application is to provide a detection and diagnosis method and device for MCU integrated circuit boards.

[0004] In a first aspect, an embodiment of the present application provides a detection and diagnosis method for an MCU integrated circuit board, comprising:

[0005] Sending a detection and diagnosis request to the MCU based on a preset communication protocol, wherein the detection and diagnosis request carries an MCU operation instruction;

[0006] receiving a detection and diagnosis result returned by the MCU in response to the detection and diagnosis request;

[0007] The preset communication protocol includes: an operation instruction set for the basic modules inside the MCU.

[0008] In one possible implementation, the operation instruction set for the basic modules within the MCU includes at least one of the following:

[0009] System instruction set, used to obtain basic information about the MCU and control the behavior of the MCU;

[0010] GPIO operation instruction set, used to control and detect the status of GPIO pins;

[0011] ADC operation instruction set, used to control the working state of ADC and obtain ADC sampling value;

[0012] IIC operation instruction set, used to realize communication with devices on the IIC bus;

[0013] UART operation instruction set, used to realize the communication function of the serial port;

[0014] CAN operation instruction set, used to realize the communication function of CAN bus;

[0015] LIN operation instruction set, used to realize the communication function of LIN bus;

[0016] SPI operation instruction set, used to realize the communication function of SPI bus;

[0017] Storage access instruction set, used to access the memory space of the MCU.

[0018] In a possible implementation, the system instruction set includes: an instruction for obtaining an MCU software version number, an instruction for obtaining instruction help instructions, and an instruction for switching on and off system logs.

[0019] In a possible implementation, the GPIO operation instruction set includes: an instruction to initialize a GPIO pin, an instruction to set a GPIO pin level, and an instruction to read a GPIO pin level.

[0020] In a possible implementation, the ADC operation instruction set includes: an ADC on instruction, an ADC off instruction, and an ADC value obtainment instruction.

[0021] In a possible implementation, the IIC operation instruction set includes: an IIC opening instruction, an IIC closing instruction, an IIC writing instruction, and an IIC bus reading instruction.

[0022] In a possible implementation, the UART operation instruction set includes: an open serial port instruction, a close serial port instruction, and a send data instruction.

[0023] In a possible implementation, the CAN operation instruction set includes: a broadcast reporting instruction.

[0024] In a possible implementation, the SPI operation instruction set includes: an SPI enable instruction, an SPI disable instruction, a data write instruction, and a data read instruction.

[0025] In a possible implementation, the preset communication protocol further includes:

[0026] Use ASCII plain text characters for communication;

[0027] There is no frame header, frame trailer, or checksum in the data communication structure, and the receiving wait timeout is used to determine the boundary of the data packet.

[0028] In a second aspect, an embodiment of the present application provides a detection and diagnosis device for an MCU integrated circuit board, comprising:

[0029] A sending request module is used to send a detection and diagnosis request to the MCU based on a preset communication protocol, wherein the detection and diagnosis request carries an MCU operation instruction;

[0030] A result receiving module, configured to receive the detection and diagnosis result returned by the MCU in response to the detection and diagnosis request;

[0031] The preset communication protocol includes: an operation instruction set for the basic modules inside the MCU.

[0032] Compared with the existing technology, the detection and diagnosis method for MCU integrated circuit boards provided in the present application sends a detection and diagnosis request to the MCU based on a preset communication protocol, wherein the detection and diagnosis request carries MCU operation instructions; and receives the detection and diagnosis results returned by the MCU in response to the detection and diagnosis request; the preset communication protocol of the present application includes an operation instruction set for the basic modules inside the MCU, which can cope with the ever-changing external devices of the MCU through flexible and intuitive parameter changes and instruction combinations, thereby reducing the number of changes to the MCU software and the software management cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present application. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:

[0034] Figure 1 A flow chart of a detection and diagnosis method for an MCU integrated circuit board provided in an embodiment of the present application is shown;

[0035] Figure 2 A schematic structural diagram of a detection and diagnosis device for an MCU integrated circuit board provided in an embodiment of the present application is shown;

[0036] Figure 3 A schematic diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0037] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments described herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0038] It should be noted that, unless otherwise specified, other technical terms or scientific terms used in this application should have the common meanings understood by technicians in the field to which this application belongs.

[0039] In addition, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements, but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.

[0040] The present application provides a detection and diagnosis method, device, electronic device and storage medium for an MCU integrated circuit board, which are described in detail below with reference to the accompanying drawings.

[0041] Please refer to Figure 1 , Figure 1 This is a flow chart of a detection and diagnosis method for an MCU integrated circuit board provided in an embodiment of the present application, comprising the following steps S101 to S102:

[0042] S101: Sending a detection and diagnosis request to the MCU based on a preset communication protocol, wherein the detection and diagnosis request carries an MCU operation instruction;

[0043] S102, receiving a detection and diagnosis result returned by the MCU in response to the detection and diagnosis request;

[0044] The execution subject of the embodiment of the present application can be an MCU detection device. The MCU detection device communicates with the MCU based on a preset communication protocol. When the MCU receives the MCU operation instruction sent by the MCU detection device, it performs corresponding operations according to the instruction to complete the detection and diagnosis of the MCU status. The MCU returns the detection and diagnosis results to the MCU detection device. The MCU operation instruction is an operation instruction selected from the preset communication protocol. The user can select a variety of combinations according to needs to form a variety of MCU detection and diagnosis schemes to perform detection and diagnosis of various functions of the MCU.

[0045] The preset communication protocols include:

[0046] This pre-set communication protocol is designed for the basic modules within the MCU. The protocol's main communication conventions are for modules such as GPIO (General-Purpose Input / Output), ADC (Analog-to-Digital Converter), IIC (Inter-Integrated Circuit), UART (Universal Synchronous / Asynchronous Receiver / Transmitter), CAN (Controller Area Network), LIN (Local Interconnect Network), SPI (Serial Peripheral Interface), and RAM (Random Access Memory). Through flexible and intuitive parameter changes and command combinations, the protocol can accommodate the ever-changing nature of external MCU devices, reducing the number of MCU software changes and management costs.

[0047] Using ASCII plain text characters for communication can improve the readability of the communication protocol and lower the operational threshold.Using universal serial port tools for communication, there is no need to write a dedicated protocol communication tool.

[0048] The data communication structure lacks a header, trailer, or checksum, and instead uses a "receive wait timeout" mechanism to determine packet boundaries. This default communication protocol uses this mechanism to determine packet boundaries, simplifying the communication structure and reducing communication overhead.

[0049] The preset communication protocol of this application improves communication efficiency, reduces communication costs, and enhances the flexibility and scalability of the communication protocol. At the same time, this protocol is easy to understand and use, which helps reduce the human resources consumed in MCU software development when changing production lines.

[0050] Specifically, the operation instruction set for the basic modules inside the MCU in the preset communication protocol includes at least one of the following:

[0051] System instruction set, GPIO operation instruction set, ADC operation instruction set, IIC operation instruction set, UART operation instruction set, CAN operation instruction set, LIN operation instruction set, SPI operation instruction set.

[0052] The functions of the above instruction sets are as follows:

[0053] The system instruction set is used to obtain basic information about the MCU and control the behavior of the MCU. Specifically, the system instruction set includes: instructions for obtaining the MCU software version number (sw-ver), instructions for obtaining instruction help instructions (help), and instructions for switching the system log (logswitch). Log is a log recorded by the system. In the software development process, log records are very important and can help developers quickly troubleshoot problems. The switch refers to the switch that controls the log recording. When the switch is turned on, the system will record various logs such as operation data and error information. Conversely, when the switch is turned off, the system will not record any log information. Therefore, the log switch can help developers locate problems more accurately during the development and debugging process by controlling its on and off.

[0054] The GPIO operation instruction set is used to control and detect the status of the GPIO pins; specifically, the GPIO operation instruction set includes: initializing the GPIO pin instruction (gpio-init), setting the GPIO pin level instruction (gpio-set), and reading the GPIO pin level instruction (gpio-get).

[0055] The ADC operation instruction set is used to control the working state of the ADC and obtain the sampling value of the ADC; specifically, the ADC operation instruction set includes: an ADC opening instruction (adc-opn), an ADC closing instruction (adc-cls), and an ADC value obtaining instruction (adc-get).

[0056] The IIC operation instruction set is used to implement communication with devices on the IIC bus. Specifically, the IIC operation instruction set includes: an IIC open instruction (iic-opn), an IIC close instruction (iic-cls), a data write to IIC bus instruction (iic-tx), and a data read from IIC bus instruction (iic-rx).

[0057] The UART operation instruction set is used to realize the communication function of the serial port; specifically, the UART operation instruction set includes: open serial port instruction (uart-opn), close serial port instruction (uart-cls), and send data instruction (uart-tx).

[0058] The CAN operation instruction set is used to implement the communication function of the CAN bus; specifically, the CAN operation instruction set includes: a broadcast data instruction (can-bdct).

[0059] LIN operation instruction set, used to implement the communication function of the LIN bus.

[0060] The SPI operation instruction set is used to implement the communication function of the SPI bus; specifically, the SPI operation instruction set includes: open SPI instruction (spi-opn), close SPI instruction (spi-cls), write data instruction (spi-wr), and read data instruction (spi-rd).

[0061] The storage access instruction set is used to access the MCU's RAM memory space, including the read memory data instruction (mem-rd) and the write memory data instruction (mem-wr).

[0062] The detection and diagnosis method for MCU integrated circuit boards provided in the embodiments of the present application has the following beneficial effects:

[0063] The detection and diagnosis method for MCU integrated circuit boards provided in the present application sends a detection and diagnosis request to the MCU based on a preset communication protocol, wherein the detection and diagnosis request carries MCU operation instructions; and receives the detection and diagnosis results returned by the MCU in response to the detection and diagnosis request; the preset communication protocol of the present application includes an operation instruction set for the basic modules inside the MCU, which can cope with the ever-changing MCU external devices through flexible and intuitive parameter changes and instruction combinations, thereby reducing the number of changes to the MCU software and the software management cost; using ASCII plain text characters for communication can improve the readability of the communication protocol, lower the operation threshold, and use universal serial port tools for communication without the need to write dedicated protocol communication tools; data communication adopts low-speed communication (less than 38400 baud rate), without frame headers, frame trailers and check areas, but uses the "receive wait timeout" mechanism to determine the packet boundary, thereby simplifying the data communication structure and reducing the communication load in scenarios such as detection and diagnosis of MCU integrated circuit boards.

[0064] In the above embodiment, a detection and diagnosis method for an MCU integrated circuit board is provided. Correspondingly, the present application also provides a detection and diagnosis device for an MCU integrated circuit board. The detection and diagnosis device for an MCU integrated circuit board provided in the embodiment of the present application can implement the above detection and diagnosis method for an MCU integrated circuit board. The detection and diagnosis device for an MCU integrated circuit board can be implemented by software, hardware, or a combination of software and hardware. For example, the detection and diagnosis device for an MCU integrated circuit board may include integrated or separate functional modules or units to perform the corresponding steps in the above methods. Please refer to Figure 2 As shown, the detection and diagnosis device 10 for the MCU integrated circuit board includes:

[0065] A request sending module 101 is configured to send a detection and diagnosis request to the MCU based on a preset communication protocol, wherein the detection and diagnosis request carries an MCU operation instruction;

[0066] A result receiving module 102 is configured to receive a detection and diagnosis result returned by the MCU in response to the detection and diagnosis request;

[0067] The preset communication protocols include:

[0068] Operation instruction set for basic modules inside MCU;

[0069] Use ASCII plain text characters for communication;

[0070] There is no frame header, frame trailer, or checksum in the data communication structure, and a receive wait timeout mechanism is used to determine the boundaries of data packets.

[0071] In one possible implementation, the operation instruction set for the basic modules within the MCU includes at least one of the following:

[0072] System instruction set, used to obtain basic information about the MCU and control the behavior of the MCU;

[0073] GPIO operation instruction set, used to control and detect the status of GPIO pins;

[0074] ADC operation instruction set, used to control the working state of ADC and obtain ADC sampling value;

[0075] IIC operation instruction set, used to realize communication with devices on the IIC bus;

[0076] UART operation instruction set, used to realize the communication function of the serial port;

[0077] CAN operation instruction set, used to realize the communication function of CAN bus;

[0078] LIN operation instruction set, used to realize the communication function of LIN bus;

[0079] SPI operation instruction set, used to implement the communication function of the SPI bus.

[0080] In a possible implementation, the system instruction set includes: an instruction for obtaining an MCU software version number, an instruction for obtaining instruction help instructions, and an instruction for switching on and off system logs.

[0081] In a possible implementation, the GPIO operation instruction set includes: an instruction to initialize a GPIO pin, an instruction to set a GPIO pin level, and an instruction to read a GPIO pin level.

[0082] In a possible implementation, the ADC operation instruction set includes: an ADC on instruction, an ADC off instruction, and an ADC value obtainment instruction.

[0083] In a possible implementation, the IIC operation instruction set includes: an IIC opening instruction, an IIC closing instruction, an IIC writing instruction, and an IIC bus reading instruction.

[0084] In a possible implementation, the UART operation instruction set includes: an open serial port instruction, a close serial port instruction, and a send data instruction.

[0085] In a possible implementation, the CAN operation instruction set includes: a broadcast reporting instruction.

[0086] In a possible implementation, the SPI operation instruction set includes: an SPI enable instruction, an SPI disable instruction, a data write instruction, and a data read instruction.

[0087] The detection and diagnosis device for the MCU integrated circuit board provided in the embodiment of the present application and the detection and diagnosis method for the MCU integrated circuit board provided in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, operated or implemented by them.

[0088] An embodiment of the present application also provides an electronic device corresponding to the method provided in the aforementioned embodiment, and the electronic device can be an electronic device for a client, such as a mobile phone, a laptop computer, a tablet computer, a desktop computer, etc., to execute the above-mentioned detection and diagnosis method for the MCU integrated circuit board.

[0089] Please refer to Figure 3 , which shows a schematic diagram of an electronic device provided by some embodiments of the present application. Figure 3 As shown, the electronic device 20 includes: a processor 200, a memory 201, a bus 202 and a communication interface 203, and the processor 200, the communication interface 203 and the memory 201 are connected via the bus 202; the memory 201 stores a computer program that can be run on the processor 200, and when the processor 200 runs the computer program, it executes the detection and diagnosis method for the MCU integrated circuit board provided in any of the aforementioned embodiments of the present application.

[0090] The memory 201 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage. The system network element communicates with at least one other network element via at least one communication interface 203 (which may be wired or wireless), and may utilize the Internet, a wide area network, a local area network, a metropolitan area network, or the like.

[0091] The bus 202 may be an ISA bus, a PCI bus, or an EISA bus. The bus may be divided into an address bus, a data bus, a control bus, and the like. The memory 201 is used to store programs, and the processor 200 executes the programs upon receiving execution instructions. The detection and diagnosis method for an MCU integrated circuit board disclosed in any of the aforementioned embodiments of the present application may be applied to or implemented by the processor 200.

[0092] The processor 200 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits in the processor 200 or by software instructions. The above processor 200 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in conjunction with the embodiments of this application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory 201 , and the processor 200 reads the information in the memory 201 and completes the steps of the above method in combination with its hardware.

[0093] The electronic device provided in the embodiment of the present application and the detection and diagnosis method for the MCU integrated circuit board provided in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, operated or implemented by them.

[0094] An embodiment of the present application also provides a computer-readable storage medium corresponding to the detection and diagnosis method for the MCU integrated circuit board provided in the aforementioned embodiment, on which a computer program (i.e., a program product) is stored. When the computer program is run by the processor, it will execute the detection and diagnosis method for the MCU integrated circuit board provided in any of the aforementioned embodiments.

[0095] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical or magnetic storage media, which are not listed here one by one.

[0096] The computer-readable storage medium provided in the above-mentioned embodiments of the present application and the detection and diagnosis method for the MCU integrated circuit board provided in the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.

[0097] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application, and they should all be included in the scope of the claims and description of the present application.

Claims

1. A detection and diagnosis method for MCU integrated circuit board, characterized in that: include: Sending a detection and diagnosis request to the MCU based on a preset communication protocol, wherein the detection and diagnosis request carries an MCU operation instruction; receiving a detection and diagnosis result returned by the MCU in response to the detection and diagnosis request; The preset communication protocol includes: an operation instruction set for the basic modules inside the MCU.

2. The method according to claim 1, characterized in that The operation instruction set for the basic modules inside the MCU includes at least one of the following: System instruction set, used to obtain basic information about the MCU and control the behavior of the MCU; GPIO operation instruction set, used to control and detect the status of GPIO pins; ADC operation instruction set, used to control the working state of ADC and obtain ADC sampling value; IIC operation instruction set, used to realize communication with devices on the IIC bus; UART operation instruction set, used to realize the communication function of the serial port; CAN operation instruction set, used to realize the communication function of CAN bus; LIN operation instruction set, used to realize the communication function of LIN bus; SPI operation instruction set, used to realize the communication function of SPI bus; Storage access instruction set, used to access the memory space of the MCU.

3. The method according to claim 2, characterized in that The system instruction set includes: an instruction for obtaining the MCU software version number, an instruction for obtaining instruction help instructions, and an instruction for switching system logs.

4. The method according to claim 2, characterized in that The GPIO operation instruction set includes: initializing GPIO pin instruction, setting GPIO pin level instruction, and reading GPIO pin level instruction.

5. The method according to claim 1, wherein The preset communication protocol also includes: Use ASCII plain text characters for communication; There is no frame header, frame trailer, or checksum in the data communication structure, and the receiving wait timeout is used to determine the boundary of the data packet.

6. A detection and diagnosis device for MCU integrated circuit board, characterized in that: include: A sending request module is used to send a detection and diagnosis request to the MCU based on a preset communication protocol, wherein the detection and diagnosis request carries an MCU operation instruction; A result receiving module, configured to receive the detection and diagnosis result returned by the MCU in response to the detection and diagnosis request; The preset communication protocol includes: an operation instruction set for the basic modules inside the MCU.