Method, device and system for recovering fault of integrated circuit bus

By sending detection information in the high-level state of SDA of the integrated circuit bus, the problem of complex and unreliable fault recovery in the existing technology is solved, efficient and reliable fault handling of the integrated circuit bus is realized, and the stability of communication recovery is ensured.

CN118643002AActive Publication Date: 2024-09-13KUNSHAN HUANAN ELECTRONIC TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411128528.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2024-09-13
Estimated Expiration
2044-08-16

AI Technical Summary

Technical Problem

In the existing technology, during the integrated circuit bus communication process, the fault recovery method is complicated and unreliable, and the fault condition under the high level of SDA cannot be effectively identified, resulting in communication failure.

Method used

By sending detection information, including the start signal, the device address of the target slave device and the read or write command in the high-level state of SDA, the level state of SDA is judged until it decreases to confirm the recovery of the integrated circuit bus and avoid incomplete The communication slave device is stuck.

Benefits of technology

A simple and reliable integrated circuit bus fault recovery method is provided, which improves fault handling efficiency, ensures the reliability of communication recovery, and avoids long-term faults and misjudgments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118643002A
    Figure CN118643002A
Patent Text Reader

Abstract

The invention provides a method, device and system for recovering a fault of an integrated circuit bus, and the method comprises the steps: judging a first level state of a serial data line SDA under the condition that the fault of the integrated circuit bus is confirmed; under the condition that the first level state of the SDA is in a high level, detection information is sent on the SDA, and the detection information comprises a starting signal, an equipment address of target slave equipment in the at least one slave equipment and a read instruction or a write instruction; after the detection information is sent, the second level state of the SDA is judged; when the second level state of the SDA is in a high level, after a pulse is sent on the SCL, the detection information is repeatedly sent on the SDA, and the second level state of the SDA is judged until the second level state of the SDA is in a low level, or when the second level state of the SDA is in a low level, recovery of the integrated circuit bus is confirmed, so that the fault is efficiently and reliably processed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device and system for recovering a fault of an integrated circuit bus. Background Art

[0002] During the IC bus communication process, if the master device restarts abnormally, the slave device pulls the bus to a dead end, or multiple tasks operate the IC bus at the same time, bus failures may occur, resulting in communication failures. There are currently two commonly used fault recovery methods. The first is to locate the faulty slave device and reset the slave device through the slave device's power switch. The second is when the serial data line (SerialData, SDA) is pulled to a low level by the slave device, the slave device is released from the IC bus through 9 consecutive serial clock line (serial clock line, SCL) pulses. When the SDA high level is detected, the IC bus communication is considered to be restored. However, under the current methods, method 1 requires locating the device address of the slave device, which is more complicated; method 2 recovery is unreliable and cannot identify fault conditions under the SDA high level.

[0003] Therefore, how to provide a simple and reliable integrated circuit bus recovery method becomes an urgent problem to be solved. Summary of the invention

[0004] The present application provides a method, device and system for recovering an integrated circuit bus fault, which can efficiently and reliably recover the integrated circuit bus fault.

[0005] In a first aspect, a method for recovering an integrated circuit bus fault is provided, the method being applied to a master device, the master device being connected to the integrated circuit bus, the integrated circuit bus comprising a serial data line SDA and a serial clock line SCL, the master device being used to communicate with at least one slave device via the integrated circuit bus, the serial data line SDA comprising two level states, a high level and a low level, the method comprising: in the case of confirming an integrated circuit bus fault, judging a first level state of SDA; in the case of the first level state of SDA being at a high level, sending detection information on SDA, the detection information comprising a start signal, a device address of a target slave device in at least one slave device, and a read instruction or a write instruction; after sending the detection information, judging a second level state of SDA; in the case of the second level state of SDA being at a high level, after sending a pulse on SCL, repeatedly sending the detection information on SDA and judging the second level state of SDA until the second level state of SDA is at a low level; in the case of the second level state of SDA being at a low level, confirming that the integrated circuit bus has been recovered.

[0006] Since there may still be a situation where a slave device controls the integrated circuit bus when SDA is at a high level, when an integrated circuit bus fault occurs in which SDA is pulled to death, only judging that SDA has recovered to a high level cannot reliably judge that the integrated circuit bus communication has recovered. A more reliable recovery method is needed. The embodiment of the present application uses a method of sending detection information when SDA is at a high level to determine the recovery of the integrated circuit, which can solve the problem of the slave device being pulled to death when the communication is not completed, thereby improving the efficiency of fault handling.

[0007] Exemplarily, when the unfinished data of the slave device is consistent with the first few bits of the device address of the slave device in the detection information, it can be considered that there is no fault, and communication can be directly performed after the slave device feeds back ACK, thereby improving fault handling efficiency.

[0008] In combination with the first aspect, in certain implementations of the first aspect, the integrated circuit bus also includes a serial clock line SCL, and the method also includes: when the first level state of SDA is at a low level, after sending a pulse on the serial clock line SCL, judging the first level state of SDA until the first level state is at a high level.

[0009] In combination with the first aspect, in certain implementations of the first aspect, in the detection information, the device address of the target slave device includes: the device address of the slave device with the smallest device address among at least one slave device, and the slave device with the smallest device address has the highest priority in communicating with the master device.

[0010] In the embodiment of the present application, according to the competition mechanism of the integrated circuit bus, when the master device detects that SDA is pulled low when it sends data corresponding to a high level, the master device will give up the control of the integrated circuit bus, and the master device will definitely not fail to send detection information. The slave device with the smallest device address has the highest priority in communicating with the master device, thereby avoiding misjudgment of faults caused by collisions with other master devices.

[0011] In combination with the first aspect, in some implementations of the first aspect, determining the first level state of SDA includes: determining the first level state of SDA according to a level value of a general input / output port GPIO of the master device.

[0012] In combination with the first aspect, in some implementations of the first aspect, at least one slave device is normally powered.

[0013] Since the slave device may not have an independent power switch and cannot release the integrated circuit bus by restarting the slave device, restoring the integrated circuit bus by the embodiment of the present application can avoid long-term failure of the integrated circuit bus.

[0014] In combination with the first aspect, in certain implementations of the first aspect, a plurality of master devices are connected to the integrated circuit bus, and the method further includes: when sending the detection information, the plurality of master devices perform clock synchronization through the detection information.

[0015] In combination with the first aspect, in certain implementations of the first aspect, confirming an integrated circuit bus failure includes at least one of the following situations: an abnormal restart of the master device, a non-confirmation NACK response from the slave device during the communication process, and the level state of SDA remains unchanged within a preset time period.

[0016] In a second aspect, a device for recovering an integrated circuit bus failure is provided, the device is connected to the integrated circuit bus, the integrated circuit bus includes an SDA and a serial clock line SCL, SDA includes two level states, a high level and a low level, the device is used to communicate with at least one slave device through the integrated circuit bus, the device includes: a processor, a memory, the memory stores a computer program; the processor is used to control the device to execute a method such as any implementation method of the first aspect when reading the computer program.

[0017] According to a third aspect, a system for communicating via an integrated circuit bus is provided, the system comprising: an integrated circuit bus, an apparatus according to the second aspect connected to the integrated circuit bus, and at least one slave device.

[0018] In a fourth aspect, the present application provides a processing circuit (or processor) for executing the method provided in any one of the implementations of the first aspect above.

[0019] In a fifth aspect, a computer-readable storage medium is provided, which stores a program code for execution by a device, wherein the program code includes a method for executing any one of the implementations of the first aspect.

[0020] In a sixth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the method provided in any one of the implementation modes in the above-mentioned first aspect.

[0021] In a seventh aspect, a chip is provided, the chip comprising a processing circuit and a communication interface, the processing circuit reads instructions stored in a memory through the communication interface, and executes a method provided by any one of the implementation modes of the above-mentioned first aspect.

[0022] Optionally, as an implementation method, the chip also includes a memory, in which a computer program or instructions are stored, and the processing circuit is used to execute the computer program or instructions stored in the memory. When the computer program or instructions are executed, the processing circuit is used to execute the method provided in any implementation method of the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 It is a schematic diagram of an integrated circuit bus device applicable to an embodiment of the present application.

[0024] Figure 2 It is a schematic diagram of the integrated circuit bus communication process applicable to the embodiment of the present application.

[0025] Figure 3 It is a schematic flow chart of a method for recovering an integrated circuit bus fault provided by an embodiment of the present application.

[0026] Figure 4 Schematic diagram of a device for recovering from an integrated circuit bus failure provided in one embodiment of the present application. DETAILED DESCRIPTION

[0027] The technical solution in this application will be described below in conjunction with the accompanying drawings.

[0028] The terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one, two or more. The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.

[0029] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear at different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0030] In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can represent A or B; In the embodiments of the present application, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two, and "at least one" and "one or more" mean one, two or more. The singular expressions "one", "a kind", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear indication to the contrary in the context.

[0031] In the description of the embodiments of the present application, the positions of components are only schematic. It should be understood that the positions of these components are relative, and do not refer to specific positions that the components must have. They may change accordingly according to changes in the orientations of the components in the drawings, and therefore should not be understood as limitations on the present application.

[0032] The “connection” in the embodiments of the present application may be a direct circuit connection or a connection through other circuits and electrical components, which is not limited in the embodiments of the present application.

[0033] Combine the following Figure 1 and Figure 2 The following describes the principles applicable to the embodiments of the present application. Figure 1 It is a schematic diagram of an integrated circuit bus device applicable to an embodiment of the present application. Figure 2 It is a schematic diagram of the integrated circuit bus communication process applicable to the embodiment of the present application.

[0034] like Figure 1 As shown, the integrated circuit bus allows multiple "slave" chips to communicate with one or more "master" chips, that is, the integrated circuit bus can be used for master devices (such as Figure 1 master device 1) and at least one slave device (e.g. Figure 1 The integrated circuit bus may include a serial data line SDA and a serial clock line SCL.

[0035] The power supply is connected to SDA and SCL through pull-up resistors. The power supply can also be connected to the master device and the slave device to power the master device and the slave device. The circuit for powering the slave device can be set with a power switch. When the slave device fails, the slave device can be restarted by the power switch to recover from the failure.

[0036] In order to avoid confusion of bus signals, idle devices are pulled to a high-impedance state during communication, which can be regarded as an open circuit. Therefore, the entire integrated circuit bus can communicate normally without being affected by idle devices.

[0037] like Figure 2 In the IC bus communication process shown in the figure, when the IC bus is idle, SDA and SCL are both at high level, and the master device can control SCL in the IC bus. When the master device decides to start communication, it needs to send a start signal. According to the rules of the IC bus protocol, when sending data, the level state of SDA can only change when SCL is at a low level, and when SCL is at a high level, the change of the SDA level state from a high level to a low level is defined as a start signal.

[0038] After the master device sends a start signal, the slave device waits to receive the device address. The several bits following the start signal are address bits. The device address can be 7 bits or 10 bits. The embodiment of the present application takes the device address of 7 bits as an example. The slave device receives and identifies whether the device address is its own device address.

[0039] After sending the device address, a read / write instruction bit follows. For example, "0" can be used to represent a read instruction, "1" can be used to represent a write instruction, or "0" can be used to represent a write instruction, and "1" can be used to represent a read instruction. The slave device with a matching device address will feedback an acknowledgement (ACK). Specifically, the slave device pulls SDA down to a low level as a feedback ACK. After receiving the ACK, the master device starts to send or read data.

[0040] In the process of sending or reading data, 8 bits of data are sent each time. The data sending process is controlled by SCL. The level state of SDA can change when SCL is at a low level. The level state of SDA is read when SCL is at a high level. Each high level → low level → high level on SCL is considered to be a pulse. Each device in pulse communication sends 1 bit of data until SCL sends the ninth pulse. The device as the data receiver will pull down the level state of SDA as ACK. Conversely, if SDA is at a high level, it is considered that negative acknowledgment (NACK) is fed back.

[0041] After the data transmission is completed or the data receiving end feedbacks NACK, the master device can send a stop signal to terminate the communication. The stop signal is when SCL is at a high level and the level state of SDA changes from a low level to a high level.

[0042] During the communication process, if the master device restarts abnormally, the slave device pulls the bus to a dead stop, or multiple tasks operate the integrated circuit bus at the same time, a bus fault will occur, resulting in communication failure. There are currently two commonly used methods. The first is to locate the faulty slave device and reset the slave device through the slave device's power switch. The second is that when SDA is pulled to a low level by the slave device, the slave device releases the integrated circuit bus through 9 consecutive SCL pulses. When the SDA high level is detected, the integrated circuit bus is considered to be restored. However, under the current methods, method 1 requires locating the device address of the slave device, which is more complicated; method 2 recovery is unreliable and cannot identify fault conditions under SDA high level, because SDA is in a high level state and it is also possible that the slave device is in a data reading state. The slave device waits for the SCL pulse to shift out the next bit of data. At this time, when the master device starts communication with other slave devices, the slave device in the data shifting state will send unfinished data, affecting communication.

[0043] Therefore, how to provide a simple and reliable integrated circuit bus recovery method becomes an urgent problem to be solved.

[0044] Figure 3 It is a schematic flow chart of a method for recovering an integrated circuit bus fault provided by an embodiment of the present application.

[0045] The fault of the integrated circuit bus may be an abnormal restart of the master device during the communication process, a NACK response from the slave device during the communication process, or the level state of the integrated circuit bus remains unchanged.

[0046] Exemplarily, when the master device communicates with slave device 1, the master device is in a state of reading data from slave device 1. If the master device restarts abnormally, slave device 1 will always control SDA to be at a high level or a low level and wait for the SCL pulse. If the master device communicates with slave device 2, slave device 1 will interfere with the communication content and even cause the master device to lose control of SDA. For example, when the master device sends the slave device address, it sends the data "1" corresponding to the high level, and when slave device 1 receives the SCL pulse, it sends the data "0" corresponding to the low level. At this time, slave device 2 will not be able to correctly receive the device address and will not be able to reply ACK. In addition, when the master device sends data corresponding to the high level of SDA, slave device 1 sends data corresponding to the low level of SDA. At this time, according to the competition mechanism, the master device will give up the control of the integrated circuit bus and stop communicating with slave device 2.

[0047] The data corresponding to the SDA high level can also be "0", and the data corresponding to the SDA low level can also be "1". The embodiment of the present application takes the data corresponding to the SDA high level as "1" and the data corresponding to the SDA low level as "0" as an example, but the embodiment of the present application does not limit this.

[0048] The method for recovering an integrated circuit bus fault can be applied to a master device, which can have a function of recovering an integrated circuit bus fault alone or integrate other functions. Optionally, when the integrated circuit bus system includes multiple master devices, the integrated circuit bus and the multiple master devices can support a multi-master device working module. The method may include: S310, when it is confirmed that the integrated circuit bus fails, determining a first level state of the serial data line SDA.

[0049] The level state of SDA may include a high level, a low level, etc. The embodiment of the present application performs bus fault recovery by judging the high level and the low level state, but the level state of SDA may also include other states, such as a high impedance state.

[0050] The master device in the embodiment of the present application may refer to a device having the function of a master device. The master device may have a multi-host mode and be able to control SCL and other functions.

[0051] The way to obtain the level state of the serial data line SDA can be to configure the serial data line SDA as a general-purpose input / output (GPIO) port of the master device, and the input of the general-purpose input / output GPIO port is the level state of the serial data line SDA. When the level state of SDA changes, the input state of the corresponding GPIO changes, and the master device responds accordingly. The way to obtain the SDA level state can also be obtained through voltage sampling, which is not limited in this application.

[0052] S320: When the first level state is at a high level, send detection information on SDA.

[0053] The detection information includes a start signal, a device address of a target slave device in at least one slave device, and a read instruction or a write instruction.

[0054] In order to eliminate the fault caused by the slave device controlling SDA to be at a high level, a read instruction or a write instruction is sent to any slave device, so that the further processing method can be determined according to the feedback of the slave device.

[0055] When the integrated circuit bus includes multiple master devices, if the integrated circuit bus has returned to normal, but when sending detection information, multiple master devices simultaneously initiate communication with the slave device, which may cause the detection information to fail to send, resulting in a misjudgment of the fault condition.

[0056] S330, after sending the detection information, determine the second level state of SDA.

[0057] After the master device sends a read instruction or a write instruction to any slave device through the detection information, the second level state of SDA is determined. Optionally, the master device can determine the second level state of SDA after a first preset time. If the slave device can communicate normally with the master device, after receiving the read instruction or the write instruction, the slave device will pull down the SDA line to feedback ACK. If the integrated circuit bus is occupied by other slave devices, the slave device will not control the SDA line, and the SDA line is always at a high level.

[0058] S340, when the second level state of SDA is at a high level, send a pulse on SCL, and repeatedly send detection information on SDA.

[0059] The slave device in the data-out state will wait for the master device to reply ACK after completing 8 bits of data. Since the master device may have data corresponding to the low level when sending the slave device address when sending the detection information, the slave device in the data-out state will continue to send the subsequent 8 bits of data. Sending a pulse on SCL will cause the position of the slave device in the data-out state to shift back one position. At this time, if the slave device in the data-out state receives the start signal in the detection signal sent by the master device after completing the data out, the slave device in the data-out state will release the bus.

[0060] After repeatedly sending the detection information on SDA, the second level state of SDA can be determined again with reference to step S330 until the second level state of SDA is at a low level.

[0061] Specifically, if the second level state of SDA is at a high level, it is considered that the slave device has fed back NACK. During the communication process, there may be a situation where the slave device has not released the integrated circuit bus. In the process of sending the detection information, it is necessary to control SCL to be pulled low, and the slave device that has not released the integrated circuit bus can continue to transmit unfinished data, thereby possibly releasing the integrated circuit bus, and then send the detection information again to enter the next round of judgment.

[0062] The first preset duration may be the duration of the SCL pulse, ensuring that the level state of SDA is detected when SCL returns to a high level. The first preset duration may also be other durations, such as an absolute duration of 10ms.

[0063] S350, when the second level state of SDA is at a low level, confirming that the integrated circuit bus is restored.

[0064] After sending a read command or a write command to any slave device through the detection information, if the level state of SDA is at a low level, it is considered that the slave device has fed back an ACK, the communication can proceed normally, and it can be confirmed that the integrated circuit bus has been restored.

[0065] Since there may still be a situation where a slave device controls the integrated circuit bus when SDA is at a high level, when an integrated circuit bus fault occurs in which SDA is pulled to death, only judging that SDA has recovered to a high level cannot reliably judge that the integrated circuit bus communication has recovered. A more reliable recovery method is needed. The embodiment of the present application uses a method of sending detection information when SDA is at a high level to determine the recovery of the integrated circuit, which can solve the problem of the slave device being pulled to death when the communication is not completed, thereby improving the efficiency of fault handling.

[0066] Exemplarily, when the unfinished data of the slave device is consistent with the first few bits of the device address of the slave device in the detection information, it can be considered that there is no fault, and communication can be directly performed after the slave device feeds back ACK, thereby improving fault handling efficiency.

[0067] In another possible situation, in step S310, when the integrated circuit bus fails, the first level state of SDA may be a low level, and step S410 may be performed: S410, with SDA low, send a pulse on SCL.

[0068] When the slave device that has not completed the communication occupies the integrated circuit bus and pulls down the integrated circuit bus, it will shift out the unsent data by one bit upon receiving the SCL pulse. When the shifted one bit of data corresponds to a high level, step S320 can be continued. The embodiment of the present application will not be described in detail here. If the shifted one bit of data corresponds to a low level, step S410 can be continued until the first level state of SDA is at a high level.

[0069] Specifically, when SDA is pulled low by the slave device, the integrated circuit bus is in an uncontrollable state. It is unknown which bit of the 8-bit data sent in each round is sent by the slave device that controls the integrated circuit bus, that is, it takes 1 to 8 pulses on SCL for the slave device to feedback ACK to release the integrated circuit bus. However, in some cases, when SDA is pulled low by the slave device, but the next bit of data transmitted by the slave device is SDA high-level data, after sending a pulse on SCL, the slave device will pull SDA high to a high level, and then detection information including read instructions or write instructions can be sent to any slave device. Therefore, the further processing method can be determined based on the feedback from the slave device.

[0070] Optionally, the value of the device address of the target slave device in the detection information can be the minimum value of the device address of at least one slave device of the integrated circuit bus, that is, the device address of the target slave device is the device address of the slave device with the smallest device address. According to the competition mechanism of the integrated circuit bus, when the master device detects that SDA is pulled low when it sends data corresponding to a high level, the master device will give up the control of the integrated circuit bus, and the master device will definitely not fail to send the detection information. The slave device with the smallest device address has the highest priority in communicating with the master device, thereby avoiding misjudgment of faults caused by collisions with other master devices.

[0071] Optionally, the slave device of the integrated circuit bus can be connected to normal power. Since the slave device may not have an independent power switch, the integrated circuit bus cannot be released by restarting the operation of the slave device. Restoring the integrated circuit bus in the manner of the embodiment of the present application can avoid long-term failure of the integrated circuit bus. The slave device of the integrated circuit bus can also be a slave device with a resettable switch, which is not limited in the present application. When the slave device has a resettable switch, you can choose to use the integrated circuit bus recovery method of the embodiment of the present application or power off the slave device to reset.

[0072] Optionally, when there are multiple master devices on the integrated circuit bus, the transmission rates between the master devices may be different. The master device can synchronize the clock with the master device through detection information when sending the south-side information, thereby ensuring the reliability of the integrated circuit bus communication.

[0073] Figure 4 Schematic diagram of a device for recovering from an integrated circuit bus failure provided in one embodiment of the present application.

[0074] like Figure 4 The control device 2000 shown may include a processor 2010 .

[0075] Alternatively, if Figure 4 As shown, the control device 2000 also includes a memory 2020 , and the memory 2020 is connected to the processor 2010 via a bus 2030 .

[0076] Optionally, the processor 2010 can be coupled to the memory 2020, and the memory 2020 is used to store computer programs or instructions and / or data. The processor 2010 is used to execute the computer programs or instructions stored in the memory 2020, or read the data stored in the memory 2020, so as to execute the methods in the above method embodiments.

[0077] Optionally, there are one or more processors 2010 .

[0078] Optionally, the memory 2020 is one or more.

[0079] Optionally, the memory 2020 is integrated with the processor 2010, or is separately provided.

[0080] As a solution, the control device 2000 is used to implement the operations performed by the processor or the main device in the above various method embodiments.

[0081] For example, the processor 2010 is used to execute the computer program or instructions stored in the memory 2020 to implement the relevant operations of the processor in the above various method embodiments.

[0082] It should be understood that the processor mentioned in the embodiments of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0083] It should also be understood that the memory mentioned in the embodiments of the present application may be a volatile memory and / or a non-volatile memory. Among them, the non-volatile memory may 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), or a flash memory. The volatile memory may be a random access memory (RAM). For example, RAM may be used as an external cache. By way of example and not limitation, RAM includes the following forms: static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0084] It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, the memory (storage module) can be integrated into the processor.

[0085] Figure 4 The device in the above embodiment may be a device, or a chip or a chip system, such as a system on chip (SoC). The processor is a processor or a microprocessor or an integrated circuit integrated on the chip. This is not limited here.

[0086] It should also be noted that the memory described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0087] When the device is the chip system (or may also be called a processing system), it may include a logic circuit and an input / output interface.

[0088] Among them, the logic circuit can be a processing circuit in the chip system. The logic circuit can be coupled to the storage unit and call the instructions in the storage unit so that the chip system can implement the methods and functions of each embodiment of the present application. The input / output interface can be an input / output circuit in the chip system, outputting information processed by the chip system, or inputting data or signaling information to be processed into the chip system for processing.

[0089] An embodiment of the present application also provides a computer-readable storage medium on which computer program instructions for implementing the methods executed by the apparatus in the above-mentioned method embodiments are stored.

[0090] For example, when the computer program instructions are executed by a computer, the computer can implement the method performed by the device in each embodiment of the above method.

[0091] The embodiment of the present application further provides a computer program product, comprising program instructions, which, when executed by a computer, implement the methods performed by the apparatus in the above-mentioned method embodiments.

[0092] The explanation of the relevant contents and beneficial effects of any of the above-mentioned devices can be referred to the corresponding method embodiments provided above, which will not be repeated here.

[0093] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0094] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0095] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0096] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0097] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0098] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.

[0099] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present 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. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for recovering from a fault in an integrated circuit bus, characterized in that: The method is applied to a master device, the master device is connected to the integrated circuit bus, the integrated circuit bus includes a serial data line SDA and a serial clock line SCL, the master device is used to communicate with at least one slave device through the integrated circuit bus, the SDA includes two level states of high level and low level, and the method includes: In the case of confirming that the integrated circuit bus fails, determining the first level state of the SDA; When the first level state of the SDA is at a high level, sending detection information on the SDA, the detection information including a start signal and a device address of a target slave device in the at least one slave device, and the detection information also including a read instruction or a write instruction; After sending the detection information, determining the second level state of the SDA; When the second level state of the SDA is at a high level, after sending a pulse on the SCL, repeatedly sending detection information on the SDA and judging the second level state of the SDA until the second level state of the SDA is at a low level; In a case where the second level state of the SDA is at a low level, it is confirmed that the integrated circuit bus is restored.

2. The method according to claim 1, characterized in that The method further comprises: In the case that the first level state of the SDA is at a low level, after sending a pulse on the SCL, the first level state of the SDA is determined until the first level state is at a high level.

3. The method according to claim 1, characterized in that In the detection information, the device address of the target slave device includes: the device address of the slave device with the smallest device address among the at least one slave device, and the slave device with the smallest device address has the highest priority in communicating with the master device.

4. The method according to any one of claims 1 to 3, characterized in that The determining the first level state of the SDA includes: The first level state of the SDA is determined according to the level value of the general purpose input / output port GPIO of the master device.

5. The method according to any one of claims 1 to 3, characterized in that The at least one slave device is normally powered.

6. The method according to claim 2, characterized in that The integrated circuit bus is connected to a plurality of master devices, and the method further comprises: When sending the detection information, the multiple master devices perform clock synchronization through the detection information.

7. The method according to any one of claims 1 to 3, characterized in that The confirmation of the integrated circuit bus fault includes at least one of the following situations: The master device restarts abnormally, the slave device responds with NACK during the communication process, and the level state of the SDA remains unchanged within a preset time period.

8. A device for recovering from an integrated circuit bus failure, characterized in that: The device is connected to the integrated circuit bus, the integrated circuit bus includes a serial data line SDA and a serial clock line SCL, the SDA includes two level states of high level and low level, the device is used to communicate with at least one slave device through the integrated circuit bus, and the device includes: Processor, memory, The memory stores a computer program; The processor is configured to control the device to execute the method according to any one of claims 1 to 7 when reading the computer program.

9. A system for communicating via an integrated circuit bus, characterized in that: The system comprises: An integrated circuit bus, the apparatus according to claim 8 connected to the integrated circuit bus, and at least one slave device.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program instructions, and the program instructions are used to be read by a processor to execute the method according to any one of claims 1 to 7.

11. A computer program product, characterized in that When the computer program product is run on a computer, the computer is caused to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method for solving communication deadlock of I2C (Inter-Integrated Circuit) bus

    CN102521187A

  • I2C communication anomaly recovery method and device

    CN110908841A

  • I2C bus fault processing method and device

    CN116107788A

  • Communication recovery method, device and system and readable storage medium

    CN116302687A

  • Reset method

    KR1019980035721A