Abnormity processing method and device for multi-chip equipment, equipment and storage medium

By introducing an asynchronous startup mechanism in multi-chip devices, the slave chip is allowed to start before the initialization configuration of the peripheral module of the main chip is completed, solving the problem of falsely triggering exception handling and improving cold startup efficiency and user experience.

CN120045364APending Publication Date: 2025-05-27BEIJING CO WHEELS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311587724.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-24
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

Currently, the exception handling method of multi-chip devices when an exception occurs from the chip is relatively single, and the abnormality caused by false triggering is also treated as a real exception, affecting the user's user experience.

Method used

By introducing an asynchronous startup mechanism in a multi-chip device, the slave chip is allowed to start before the initialization configuration of the peripheral module of the main chip is completed, thereby reducing the abnormal processing caused by false triggers. The specific steps include: loading the firmware code of the slave chip to the preset storage area of ​​the master chip, and starting the slave chip without waiting for the peripheral module to be initialized.

Benefits of technology

This method effectively reduces the abnormal handling caused by false triggering and improves the cold start efficiency and user experience of multi-chip devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045364A_ABST
    Figure CN120045364A_ABST
Patent Text Reader

Abstract

The invention provides an exception handling method and device for multi-chip equipment, equipment and a storage medium, and the method comprises the steps: when it is determined that a first slave chip in at least one slave chip has an exception, counting the exceptions of the first slave chip within a preset time period through a mode of calling a preset exception handling function, determining whether the number of times that the first slave chip is abnormal within a preset time length exceeds a preset threshold value or not, and when it is determined that the number of times that the first slave chip is abnormal within the preset time length exceeds the preset threshold value, interrupting communication between the first slave chip and the master chip and cancelling initial configuration of a peripheral module of the first slave chip, therefore, abnormal processing caused by false triggering is reduced, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing, and in particular, to an abnormal processing method, apparatus, device, and storage medium for a multi-chip device. Background Art

[0002] With the continuous diversification of the functional requirements of computers and electronic devices, multi-chip devices have emerged as the times require.

[0003] However, the current abnormal processing method for the slave chip when an abnormality occurs is relatively single. For example, when an abnormality occurs in the slave chip, the abnormality of the slave chip is directly processed. This processing method causes the mis-triggered abnormality to be treated as a real abnormality, affecting the user experience. Therefore, how to reduce the abnormal processing caused by mis-triggering has become an urgent technical problem to be solved. Summary of the Invention

[0004] To solve the above technical problems, the present disclosure provides an abnormal processing method for a multi-chip device. After loading the firmware code of the slave chip into a preset storage area of the master chip, the slave chip can be controlled to start without waiting for the initialization configuration of the peripheral module of the master chip, so that the start-up process of the slave chip and the initialization configuration of the peripheral module of the master chip are executed asynchronously, improving the cold start efficiency of the multi-chip device.

[0005] In a first aspect, the present disclosure provides an abnormal processing method for a multi-chip device, where the multi-chip device includes a master chip and at least one slave chip, and the method includes:

[0006] If it is determined that a first slave chip among the at least one slave chip has an abnormality, a preset abnormal processing function is triggered to be executed;

[0007] The preset abnormal processing function is called to count the abnormality that occurs in the first slave chip within a preset time period, and it is determined whether the number of times the first slave chip has the abnormality within the preset time period exceeds a preset threshold;

[0008] And if it is determined that the number of times the first slave chip has the abnormality within the preset time period exceeds the preset threshold, the communication between the first slave chip and the master chip is interrupted and the initialization configuration of the peripheral module of the first slave chip is cancelled.

[0009] In an optional implementation manner, the step of if it is determined that a first slave chip among the at least one slave chip has an abnormality, a preset abnormal processing function is triggered to be executed includes:

[0010] If it is determined that a first slave chip among the at least one slave chip has an abnormality after the cold start of the multi-chip device is successful, a preset abnormal processing function is triggered to be executed.

[0011] In an alternative embodiment, the exception is an exception triggered when executing the first instruction, and the method further includes:

[0012] If it is determined that the number of times the first slave chip has the exception within the preset duration does not exceed the preset threshold, then roll back to the execution position of the first instruction and re-trigger the execution of the first instruction;

[0013] If it is determined that the first slave chip has the exception again, then trigger the execution of the preset exception handling function to count the exception that the first slave chip has within the preset duration.

[0014] In an alternative embodiment, before triggering the execution of the preset exception handling function if it is determined that the first slave chip among the at least one slave chip has an exception after the cold start of the multi-chip device is successful, it further includes:

[0015] If it is determined that the first slave chip among the at least one slave chip has an exception during the cold start of the multi-chip device, then interrupt the communication between the first slave chip and the master chip and cancel the initialization configuration of the peripheral module of the first slave chip.

[0016] In an alternative embodiment, if it is determined that the first slave chip among the at least one slave chip has an exception during the cold start of the multi-chip device, then interrupt the communication between the first slave chip and the master chip and cancel the initialization configuration of the peripheral module of the first slave chip, including:

[0017] If it is determined that the first slave chip among the at least one slave chip has an exception during the cold start of the multi-chip device, then control the first slave chip to restart;

[0018] Determine whether the number of times the first slave chip restarts exceeds the preset number of times;

[0019] If it is determined that the number of times the first slave chip restarts exceeds the preset number of times, then interrupt the communication between the first slave chip and the master chip and cancel the initialization configuration of the peripheral module of the first slave chip.

[0020] In an alternative embodiment, before triggering the execution of the preset exception handling function if it is determined that the first slave chip among the at least one slave chip has an exception after the cold start of the multi-chip device is successful, it further includes:

[0021] In response to the completion of the initialization configuration of the microcontroller (MCU) of the master chip, load the firmware code of the at least one slave chip into the preset storage area of the master chip and control the at least one slave chip to start;

[0022] And, initialize and configure the peripheral modules of the main chip;

[0023] When it is determined that the initialization and configuration of the peripheral modules of the main chip are completed and the MCU initialization and configuration of the at least one slave chip are completed, initialize and configure the peripheral modules of the at least one slave chip to complete the cold start of the multi-chip device.

[0024] In an optional implementation, before triggering the execution of a preset exception handling function if it is determined that a first slave chip among the at least one slave chip has an exception, it further includes:

[0025] Obtain the exception address;

[0026] Determine whether the exception address is within the preset address range of the main chip;

[0027] If it is determined that the exception address is within the preset address range of the main chip, determine that the first slave chip has an exception.

[0028] In a second aspect, the present disclosure provides an exception handling device for a multi-chip device, the multi-chip device including a main chip and at least one slave chip, the device including:

[0029] A first counting module, configured to trigger the execution of a preset exception handling function when it is determined that a first slave chip among the at least one slave chip has an exception;

[0030] A first determination module, configured to call the preset exception handling function to count the exceptions that occur to the first slave chip within a preset duration, and determine whether the number of times the first slave chip has the exception within the preset duration exceeds a preset threshold;

[0031] A first interrupt module, configured to interrupt the communication between the first slave chip and the main chip and cancel the initialization configuration of the peripheral modules of the first slave chip when it is determined that the number of times the first slave chip has the exception within the preset duration exceeds the preset threshold.

[0032] In a third aspect, the present disclosure provides an exception handling device for a multi-chip device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the above method is implemented.

[0033] In a fourth aspect, the present disclosure provides a computer-readable storage medium, in which instructions are stored, and when the instructions run on a terminal device, the terminal device implements the above method.

[0034] The technical solutions provided by the embodiments of the present disclosure have at least the following advantages compared with the prior art:

[0035] The embodiments of the present disclosure provide an exception handling method for a multi-chip device. If it is determined that a first slave chip among at least one slave chip has an exception, a preset exception handling function is triggered to execute. The preset exception handling function is called to count the exceptions that occur in the first slave chip within a preset duration, and it is determined whether the number of exceptions that occur in the first slave chip within the preset duration exceeds a preset threshold. And if it is determined that the number of exceptions that occur in the first slave chip within the preset duration exceeds the preset threshold, the communication between the first slave chip and the master chip is interrupted and the initialization configuration of the peripheral module of the first slave chip is cancelled. It can be seen that in the embodiments of the present disclosure, when an exception occurs in the first slave chip, the exception is handled by calling the preset exception handling function. When it is determined that the number of exceptions that occur in the first slave chip within the preset duration exceeds the preset threshold, the communication between the first slave chip and the master chip is interrupted and the initialization configuration of the peripheral module of the first slave chip is cancelled, thereby reducing the exception handling caused by mis-triggering and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The accompanying drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with the present disclosure and used together with the specification to explain the principles of the present disclosure.

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0038] Figure 1 It is a flowchart of an exception handling method for a multi-chip device provided by an embodiment of the present disclosure;

[0039] Figure 2 It is a flowchart of another exception handling method for a multi-chip device provided by an embodiment of the present disclosure;

[0040] Figure 3 It is a flowchart of yet another exception handling method for a multi-chip device provided by an embodiment of the present disclosure;

[0041] Figure 4 It is a flowchart of yet another exception handling method for a multi-chip device provided by an embodiment of the present disclosure;

[0042] Figure 5 It is a flowchart of yet another exception handling method for a multi-chip device provided by an embodiment of the present disclosure;

[0043] Figure 6Structural schematic diagram of an exception handling device for a multi-chip device provided by an embodiment of the present disclosure;

[0044] Figure 7 Structural schematic diagram of an exception handling device for a multi-chip device provided by an embodiment of the present disclosure. Detailed implementation manners

[0045] In order to more clearly understand the above objects, features, and advantages of the present disclosure, the solutions of the present disclosure will be further described below. It should be noted that, without conflict, the embodiments of the present disclosure and the features in the embodiments may be combined with each other.

[0046] Many specific details are set forth in the following description to facilitate a thorough understanding of the present disclosure, but the present disclosure may be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only a part of the embodiments of the present disclosure, rather than all the embodiments.

[0047] In order to reduce exception handling caused by mis-triggering and improve the user experience, the present disclosure provides an exception handling method for a multi-chip device.

[0048] Specifically, if it is determined that an exception occurs in a first slave chip among at least one slave chip, a preset exception handling function is triggered to execute, the preset exception handling function is called to count the exceptions that occur in the first slave chip within a preset time period, it is determined whether the number of exceptions that occur in the first slave chip within the preset time period exceeds a preset threshold, and, if it is determined that the number of exceptions that occur in the first slave chip within the preset time period exceeds the preset threshold, the communication between the first slave chip and the master chip is interrupted and the initialization configuration of the peripheral module of the first slave chip is cancelled. It can be seen that in the embodiment of the present disclosure, when an exception occurs in the first slave chip, the exception is handled by calling the preset exception handling function, and when it is determined that the number of exceptions that occur in the first slave chip within the preset time period exceeds the preset threshold, the communication between the first slave chip and the master chip is interrupted and the initialization configuration of the peripheral module of the first slave chip is cancelled, thereby reducing exception handling caused by mis-triggering and improving the user experience.

[0049] Based on this, the embodiment of the present disclosure provides an exception handling method for a multi-chip device. Refer to Figure 1 , which is a flowchart of an exception handling method for a multi-chip device provided by an embodiment of the present disclosure. The multi-chip device includes a master chip and at least one slave chip. The method includes:

[0050] S101: If it is determined that an exception occurs in a first slave chip among at least one slave chip, a preset exception handling function is triggered to execute.

[0051] Wherein, the first slave chip is any one of the at least one slave chip included in the multi-chip device.

[0052] Specifically, the method for determining that the first slave chip has an abnormality is described as follows:

[0053] In an alternative embodiment, an abnormal address is obtained, and it is determined whether the abnormal address is within the preset address range of the main chip. If it is determined that the abnormal address is within the preset address range of the main chip, it is determined that the first slave chip has an abnormality.

[0054] In the embodiments of the present disclosure, the abnormal address can be obtained from a data abort. Specifically, in the Data Abort processing logic, an abnormal address is obtained, and it is determined whether the abnormal address is within the preset address range of the main chip. If it is determined that the abnormal address is within the preset address range of the main chip, it is determined that the first slave chip has an abnormality.

[0055] Specifically, in the embodiments of the present disclosure, the abnormality of the first slave chip can be determined after successful cold start of multiple chips.

[0056] In an alternative embodiment, if it is determined that the first slave chip among at least one slave chip has an abnormality after successful cold start of a multi-chip device, a preset exception handling function is triggered to execute.

[0057] It should be noted that the embodiments of the present disclosure do not make any limitations on the scenario where a slave chip has an abnormality.

[0058] In the embodiments of the present disclosure, when it is determined that the first slave chip has an abnormality, it can jump to a preset exception handling function. When the first slave chip has an abnormality, the exception handling process for the abnormality of the first slave chip is executed using the processing logic of the preset exception handling function.

[0059] Specifically, the preset exception handling function can be a piece of code or a program for executing an exception handling process for the abnormality of the first slave chip, thereby reducing exception handling caused by mis-triggering.

[0060] The exception handling process includes: counting the abnormalities that occur in the first slave chip within a preset duration, determining whether the number of abnormalities that occur in the first slave chip within the preset duration exceeds a preset threshold, and if it is determined that the number of abnormalities that occur in the first slave chip within the preset duration exceeds the preset threshold, interrupting the communication between the first slave chip and the main chip and canceling the initialization configuration of the peripheral module of the first slave chip.

[0061] Specifically, for a detailed description of the exception handling process, refer to step S102 and step S103 of the embodiments of the present disclosure.

[0062] S102: Call a preset exception handling function to count the exceptions that occur in the first slave chip within a preset duration, and determine whether the number of exceptions that occur in the first slave chip within the preset duration exceeds a preset threshold.

[0063] Among them, the preset duration can be set according to requirements.

[0064] In the embodiments of the present disclosure, when an exception occurs in the first slave chip, by using whether the number of exceptions that occur in the first slave chip within the preset duration exceeds the preset threshold as a judgment condition, the processing of the exception of the first slave chip caused by mis-triggering can be reduced.

[0065] Exemplarily, the preset threshold can be set to 3. Specifically, when an exception occurs in the first slave chip, a preset exception handling function can be called to count the exceptions that occur in the first slave chip within the preset duration, and determine whether the number of exceptions that occur in the first slave chip within the preset duration exceeds 3. If the number of exceptions that occur in the first slave chip within the preset duration exceeds 3, it indicates that the exception that occurs in the first slave chip is not caused by mis-triggering. At this time, the communication between the first slave chip and the master chip can be interrupted and the initialization configuration of the peripheral module of the first slave chip can be cancelled to shield the slave chip.

[0066] S103: If it is determined that the number of exceptions that occur in the first slave chip within the preset duration exceeds the preset threshold, interrupt the communication between the first slave chip and the master chip and cancel the initialization configuration of the peripheral module of the first slave chip.

[0067] Specifically, although interrupting the communication between the first slave chip and the master chip can shield the first slave chip, the software logic on the master chip side may still continue to execute and access the mapped address of the first slave chip register, resulting in reading an unknown value. Therefore, it is particularly important to cancel the initialization configuration of the peripheral module of the first slave chip.

[0068] In the embodiments of the present disclosure, canceling the initialization configuration of the peripheral module of the first slave chip includes changing the state of the peripheral module of the first slave chip to an uninitialized state.

[0069] In the embodiments of the present disclosure, canceling the initialization configuration of the peripheral module of the first slave chip means canceling the peripheral modules such as the analog-to-digital converter (ADC) module and the pulse width modulation (PWM) module of the slave chip from the software logic level. Since the operations related to the MCU (Microcontroller Unit) registers of the first slave chip fail after interrupting the communication between the first slave chip and the master chip first, but canceling the peripheral modules such as the ADC module and the PWM module can change the state of the peripheral module of the first slave chip to an uninitialized state, and then the registers of the first slave chip can no longer be accessed from the software logic.

[0070] In the embodiments of the present disclosure, if it is determined that the number of times the first slave chip has an abnormality within a preset time period exceeds a preset threshold, it indicates that the abnormality of the first slave chip is not caused by accidental touch. Then, the first slave chip can be shielded by interrupting the communication between the first slave chip and the master chip and canceling the initialization configuration of the peripheral module of the first slave chip, so as to avoid the impact caused by the abnormality of the first slave chip.

[0071] Specifically, in order to reduce the abnormal processing caused by accidental triggering, when the abnormality is triggered when executing the first instruction, in an optional embodiment, if it is determined that the number of times the first slave chip has an abnormality within a preset time period does not exceed the preset threshold, then return to the execution position of the first instruction and re-trigger the execution of the first instruction. If it is determined that the first slave chip has an abnormality again, then trigger the execution of calling a preset exception handling function to count the number of abnormalities of the first slave chip within the preset time period.

[0072] In the embodiments of the present disclosure, after returning to the execution position of the first instruction and re-triggering the execution of the first instruction, if it is determined that the first slave chip has no abnormality, then end the exception handling.

[0073] In the embodiments of the present disclosure, if it is determined that the number of times the first slave chip has an abnormality within a preset time period does not exceed the preset threshold, it indicates that the abnormality of the first slave chip is caused by accidental triggering. Therefore, it is possible to return to the execution position of the first instruction and re-trigger the execution of the first instruction. If it is determined that the first slave chip has an abnormality again, then continue to trigger the execution of calling a preset exception handling function to count the number of abnormalities of the first slave chip within the preset time period, and determine whether the number of abnormalities of the first slave chip within the preset time period exceeds the preset threshold. If it is determined that the number of abnormalities of the slave chip within the preset time period exceeds the preset threshold, then interrupt the communication between the first slave chip and the master chip and cancel the initialization configuration of the peripheral module of the first slave chip. If it is determined that the number of abnormalities of the slave chip within the preset time period still does not exceed the preset threshold, then continue to execute the step of returning to the execution position of the first instruction and re-triggering the execution of the first instruction.

[0074] In the exception handling method of the multi-chip device provided by the embodiments of the present disclosure, if it is determined that an exception occurs in a first slave chip among at least one slave chip, a preset exception handling function is triggered to execute. The preset exception handling function is called to count the exceptions that occur in the first slave chip within a preset time period, and it is determined whether the number of exceptions that occur in the first slave chip within the preset time period exceeds a preset threshold. And if it is determined that the number of exceptions that occur in the first slave chip within the preset time period exceeds the preset threshold, the communication between the first slave chip and the master chip is interrupted and the initialization configuration of the peripheral module of the first slave chip is canceled. It can be seen that in the embodiments of the present disclosure, when an exception occurs in the first slave chip, the exception is handled by calling the preset exception handling function. When it is determined that the number of exceptions that occur in the first slave chip within the preset time period exceeds the preset threshold, the communication between the first slave chip and the master chip is interrupted and the initialization configuration of the peripheral module of the first slave chip is canceled, thereby reducing the exception handling caused by mis-triggering and improving the user experience.

[0075] In some embodiments of the present disclosure, if it is determined that an exception occurs in a first slave chip among at least one slave chip during the cold start process of the multi-chip device, the communication between the first slave chip and the master chip is interrupted and the initialization configuration of the peripheral module of the first slave chip is canceled.

[0076] In the embodiments of the present disclosure, during the cold start process of the multi-chip device, if the master chip does not receive the handshake signal sent by the first slave chip, it is determined that an exception occurs in the first slave chip. The first slave chip can be shielded by interrupting the communication between the first slave chip and the master chip and canceling the initialization configuration of the peripheral module of the first slave chip, so as to avoid the influence caused when an exception occurs in the first slave chip.

[0077] In the embodiments of the present disclosure, the specific description of interrupting the communication between the first slave chip and the master chip and canceling the initialization configuration of the peripheral module of the first slave chip can refer to the above embodiments, and the embodiments of the present disclosure will not make any redundant description here.

[0078] In addition, in order to avoid the failure of the first slave chip to start caused by mis-triggering, in an optional implementation manner, if it is determined that an exception occurs in a first slave chip among at least one slave chip during the cold start process of the multi-chip device, the first slave chip is controlled to restart, and it is determined whether the number of times the first slave chip restarts exceeds a preset number of times. If it is determined that the number of times the first slave chip restarts exceeds the preset number of times, the communication between the first slave chip and the master chip is interrupted and the initialization configuration of the peripheral module of the first slave chip is canceled.

[0079] In the embodiments of the present disclosure, if it is determined that an exception occurs in a first slave chip among at least one slave chip during the cold start process of the multi-chip device, the first slave chip can be controlled to restart by loading the firmware code of the first slave chip into a preset storage area of the master chip.

[0080] In the embodiments of the present disclosure, the number of times the first slave chip restarts can be determined by a preset controller. If the number of times the first slave chip restarts exceeds the preset number of times, the communication between the first slave chip and the master chip is interrupted and the initialization configuration of the peripheral module of the first slave chip is cancelled. If the number of times the first slave chip restarts does not exceed the preset number of times, the execution of loading the firmware code of the first slave chip into the preset storage area of the master chip is continued to be triggered, and the first slave chip is controlled to restart.

[0081] It should be noted that the embodiments of the present disclosure do not make any limitation on the method for determining the number of times the first slave chip restarts.

[0082] It can be seen that in the embodiments of the present disclosure, when it is determined that the first slave chip among at least one slave chip is abnormal during the cold start process of the multi-chip device, by controlling the first slave chip to restart, the first slave chip is restarted to avoid the failure of the first slave chip to start caused by accidental touch.

[0083] In some embodiments of the present disclosure, during the cold start process of the multi-chip device, after receiving the completion of the initialization configuration of the microcontroller (MCU) of the master chip, the firmware code of at least one slave chip can be loaded into the preset storage area of the master chip, so that the start process of the slave chip and the initialization configuration of the peripheral module of the master chip are executed asynchronously, improving the cold start efficiency of the multi-chip device.

[0084] Specifically, as described below:

[0085] In response to the completion of the initialization configuration of the microcontroller (MCU) of the master chip, the firmware code of at least one slave chip is loaded into the preset storage area of the master chip, and at least one slave chip is controlled to start.

[0086] Among them, the MCU initialization configuration includes clock initialization configuration, memory protection initialization configuration, etc.

[0087] In the embodiments of the present disclosure, the master chip and the slave chip can communicate through an expandable serial peripheral interface (XSPI).

[0088] In the embodiments of the present disclosure, the built-in boot loader (BOOTROM) of the master chip loads the master chip running code from the flash memory (FLASH) into the random access memory (RAM) of the master chip through the serial peripheral interface (SPI) interface, triggering the master chip to start. After the master chip starts, the microcontroller (MCU) of the master chip is first initialized. When the MCU initialization of the master chip is completed, the firmware code of at least one slave chip is loaded from the FLASH into the preset storage area of the master chip through the SPI interface, and the slave chip is controlled to start.

[0089] Initialize and configure the peripheral modules of the main chip. When it is determined that the initialization and configuration of the peripheral modules of the main chip are completed and the MCU initialization and configuration of at least one slave chip are completed, initialize and configure the peripheral modules of at least one slave chip to complete the cold start of the multi-chip device.

[0090] Among them, the peripheral modules of the main chip include an ADC module, a PWM module, etc.

[0091] Specifically, the peripheral modules of the main chip refer to the modules integrated in the main chip that interact with the central processing unit of the main chip to achieve preset functions. Correspondingly, initializing and configuring the peripheral modules of the main chip can be to initialize and configure the ADC module, the PWM module, etc.

[0092] For ease of understanding, take the target slave chip among at least one slave chip as an example for description.

[0093] In the embodiment of the present disclosure, after loading the firmware code of the target slave chip into the preset storage area of the main chip, the initialization and configuration of the target slave chip and the peripheral modules of the main chip can be executed asynchronously. That is, after loading the firmware code of the target slave chip into the preset storage area of the main chip, without waiting for the initialization and configuration of the peripheral modules of the main chip, the target slave chip can be controlled to start, so that the startup process of the target slave chip and the initialization and configuration of the peripheral modules of the main chip are executed asynchronously, improving the cold start efficiency of the multi-chip device.

[0094] In the embodiment of the present disclosure, when it is determined that the initialization and configuration of the peripheral modules of the main chip are completed, a handshake signal sent by the target slave chip (i.e., the signal corresponding to the completion of the MCU initialization and configuration of the target slave chip) is received, and the peripheral modules of the target slave chip are initialized and configured to complete the cold start of the multi-chip device.

[0095] In the actual application scenario, refer to Figure 2 , which is a flowchart of another method for handling exceptions of a multi-chip device provided by the embodiment of the present disclosure. The multi-chip device includes a main chip and at least one slave chip, and the method includes:

[0096] For ease of understanding, continue to take the target slave chip among at least one slave chip as an example for description.

[0097] First, the system is powered on (i.e., the multi-chip device is powered on). The main chip BOOTROM loads the main chip running code from the FLASH into the RAM of the main chip, triggering the main chip to start. After the main chip starts, it first initializes and configures the MCU of the main chip. When the initialization and configuration of the MCU of the main chip are completed, the firmware code of the target slave chip is loaded from the FLASH into the preset storage area of the main chip through the SPI interface, and the target slave chip is controlled to start.

[0098] The target slave chip establishes XSPI interaction with the master chip through the BOOTROM to determine whether the master chip has downloaded the firmware code of the target slave chip (i.e., whether the firmware code of the target slave chip is loaded into the preset storage area of the master chip). If it is determined that the master chip has downloaded the firmware code of the target slave chip, the target slave chip starts. After the target slave chip starts, the target slave chip performs MCU initialization configuration. After the target slave chip completes the MCU initialization configuration, it sends a handshake signal to the master chip.

[0099] After determining that the initialization configuration of the peripheral module of the master chip is completed, it is judged whether the target slave chip has established a handshake signal. If it is determined that the target slave chip has established a handshake signal (i.e., the master chip has received the handshake signal sent by the target slave chip), the handshake is successful, and the initialization configuration of the peripheral module of the target slave chip is performed. If it is determined that the target slave chip has not established a handshake signal (i.e., the master chip has not received the handshake signal sent by the target slave chip), the handshake fails, the target slave chip failure is recorded, and the target slave chip is masked.

[0100] It can be seen that after the firmware code of the target slave chip is loaded into the preset storage area of the master chip in the embodiment of the present disclosure, it is not necessary to wait for the initialization configuration of the peripheral module of the master chip, and the target slave chip can be controlled to start, so that the start-up process of the target slave chip and the initialization configuration of the peripheral module of the master chip are executed asynchronously, improving the cold start efficiency of the multi-chip device.

[0101] Based on the above embodiments, the embodiment of the present disclosure further provides an exception handling method for a multi-chip device. Refer to Figure 3 , which is a flowchart of another exception handling method for a multi-chip device provided by the embodiment of the present disclosure. The multi-chip device includes a master chip and at least one slave chip. The method includes:

[0102] During the cold start process of the multi-chip device, in order to avoid the failure of the first slave chip to start caused by mis-triggering, when it is determined that the first slave chip has not established a handshake signal (i.e., the first slave chip has an exception), the execution is triggered to load the firmware code of the first slave chip into the preset storage area of the master chip to control the first slave chip to restart. When the number of times of controlling the first slave chip to restart exceeds the preset number of times, the first slave chip fails to start, the first slave chip failure flag is recorded, and the first slave chip peripheral initialization is masked. If the number of times of controlling the slave chip to restart does not exceed the preset number of times, the first slave chip is reset, and the firmware code of the first slave chip is continuously loaded into the preset storage area of the master chip to control the first slave chip to restart.

[0103] When determining that the first slave chip establishes a handshake signal (i.e., when the first slave chip starts successfully), it is also possible to continue to check whether accessing the RAM of the first slave chip is successful. If it is determined that accessing the RAM of the first slave chip is successful, the master chip continues to execute. If it is determined that accessing the RAM of the first slave chip fails, it is determined that the first slave chip fails to start, and the steps of triggering the loading of the firmware code of the first slave chip into the preset storage area of the master chip and controlling the start of the first slave chip are executed to control the first slave chip to restart. When the number of times of controlling the first slave chip to restart exceeds the preset number of times, the first slave chip fails to start, the first slave chip failure flag is recorded, and the initialization of the first slave chip peripherals is masked. If the number of times of controlling the restart of the slave chip does not exceed the preset number of times, the first slave chip is reset, and the firmware code of the first slave chip is continuously loaded into the preset storage area of the master chip to control the first slave chip to restart.

[0104] It can be seen that in the embodiments of the present disclosure, when it is determined that the first slave chip does not establish a handshake signal (i.e., the first slave chip has an exception) or the first slave chip establishes a handshake signal but fails to access the RAM of the first slave chip, the steps of triggering the loading of the firmware code of the first slave chip into the preset storage area of the master chip and controlling the start of the first slave chip are executed, so as to avoid the failure of the first slave chip to start caused by accidental touch.

[0105] Based on the above embodiments, the embodiments of the present disclosure further provide an exception handling method for a multi-chip device. Refer to Figure 4 , which is a flowchart of another exception handling method for a multi-chip device provided by the embodiments of the present disclosure. The multi-chip device includes a master chip and at least one slave chip. The method includes:

[0106] After the cold start of the multi-chip device is completed, if the first slave chip has an exception, the access request to the first slave chip can also be masked.

[0107] Specifically, after the cold start of the multi-chip device is completed, if an exception occurs, Data Abort is triggered. In the Data Abort processing logic, it is determined whether the exception address is within the preset address range of the master chip. If the exception address is within the preset address range of the master chip, it is determined that the first slave chip has an exception, the first slave chip failure flag is recorded, and the access request to the first slave chip is masked (i.e., the communication between the first slave chip and the master chip is interrupted and the initialization configuration of the peripheral module of the first slave chip is canceled).

[0108] In the embodiments of the present disclosure, after the cold start of the multi-chip device is completed, when an exception occurs, by triggering Data Abort, in the Data Abort processing logic, if it is determined that the exception address is within the preset address range of the master chip, the operating system OS of the system (i.e., the multi-chip device) is prevented from being affected by the exception of the first slave chip by masking the access request to the first slave chip.

[0109] Based on the above embodiments, the embodiments of the present disclosure further provide an abnormal handling method for a multi-chip device. Refer to Figure 5 , which is a flowchart of another abnormal handling method for a multi-chip device provided by the embodiments of the present disclosure. The multi-chip device includes a main chip and a slave chip. The method includes:

[0110] In order to reduce the handling of the abnormality of the first slave chip caused by mis-triggering, after the cold start of the multi-chip device is completed, after triggering a Data Abort, the XSPI boundary address (i.e., the preset address range in the above embodiments) is loaded through a register to determine whether the abnormal address is within the XSPI boundary address range. If it is determined that the abnormal address is within the XSPI boundary address range, then jump to a preset abnormal handling function, and use the preset abnormal handling function to execute an abnormal handling process for the abnormality that occurs in the first slave chip.

[0111] Specifically, the abnormal handling process includes: determining whether the number of times the first slave chip has an abnormality within a preset duration exceeds a preset threshold. If it is determined that the number of times the first slave chip has an abnormality within the preset duration exceeds the preset threshold, then record the first slave chip failure flag and mask the access request to the first slave chip (i.e., interrupt the communication between the first slave chip and the main chip and cancel the initialization configuration of the peripheral module of the first slave chip). Taking the abnormality triggered when executing the first instruction as an example, if it is determined that the number of times the first slave chip has an abnormality within the preset duration does not exceed the preset threshold, then roll back to the execution position of the first instruction, re-trigger the execution of the first instruction, and determine whether the first slave chip has an abnormality again within the preset duration.

[0112] If it is determined that the first slave chip has an abnormality again within the preset duration, then continue to execute the steps of triggering a Data Abort and loading the XSPI boundary address through a register. If the first slave chip does not have an abnormality within the preset duration, then end the abnormal handling.

[0113] It can be seen that in the embodiments of the present disclosure, by using a preset abnormal handling function to determine whether the number of times the first slave chip has an abnormality within a preset duration exceeds a preset threshold, and when it is determined that the number of times the first slave chip has an abnormality within the preset duration exceeds the preset threshold, recording the first slave chip failure flag and masking the access request to the first slave chip, the abnormal handling caused by mis-triggering is reduced, and the user experience is improved.

[0114] Based on the same inventive concept as the above embodiments, the embodiments of the present disclosure further provide an abnormal handling device for a multi-chip device. Refer to Figure 6, which is a schematic structural diagram of an exception handling device for a multi-chip device provided by an embodiment of the present disclosure. The multi-chip device includes a main chip and at least one slave chip. The exception handling device 600 of the multi-chip device includes:

[0115] A first counting module 601, configured to trigger the execution of a preset exception handling function when it is determined that a first slave chip among the at least one slave chip has an exception;

[0116] A first determination module 602, configured to call the preset exception handling function to count the exceptions that occur to the first slave chip within a preset duration, and determine whether the number of times the first slave chip has an exception within the preset duration exceeds a preset threshold;

[0117] A first interruption module 603, configured to interrupt the communication between the first slave chip and the main chip and cancel the initialization configuration of the peripheral module of the first slave chip when it is determined that the number of times the first slave chip has an exception within the preset duration exceeds the preset threshold.

[0118] In an optional implementation manner, the first counting module 601 is specifically configured to:

[0119] If it is determined that a first slave chip among the at least one slave chip has an exception after the cold start of the multi-chip device is successful, then trigger the execution of a preset exception handling function.

[0120] In an optional implementation manner, the exception is an exception triggered when executing a first instruction, and the device further includes:

[0121] A fallback module, configured to fallback to the execution position of the first instruction and re-trigger the execution of the first instruction when it is determined that the number of times the first slave chip has an exception within the preset duration does not exceed the preset threshold;

[0122] A second counting module, configured to trigger the execution of the call to the preset exception handling function to count the exceptions that occur to the first slave chip within a preset duration when it is determined that the first slave chip has an exception again.

[0123] In an optional implementation manner, the device further includes:

[0124] A second interruption module, configured to interrupt the communication between the first slave chip and the main chip and cancel the initialization configuration of the peripheral module of the first slave chip when it is determined that a first slave chip among the at least one slave chip has an exception during the cold start process of the multi-chip device.

[0125] In an optional implementation manner, the second interruption module includes:

[0126] A control sub-module, configured to control a first slave chip among the at least one slave chip to restart when it is determined that the first slave chip has an abnormality during a cold start process of the multi-chip device;

[0127] A determination sub-module, configured to determine whether the number of times the first slave chip restarts exceeds a preset number of times;

[0128] An interruption sub-module, configured to interrupt the communication between the first slave chip and the master chip and cancel the initialization configuration of the peripheral module of the first slave chip when it is determined that the number of times the first slave chip restarts exceeds the preset number of times.

[0129] In an alternative embodiment, the device further includes:

[0130] A loading module, configured to, in response to the completion of the initialization configuration of the microcontroller (MCU) of the master chip, load the firmware code of the at least one slave chip into a preset storage area of the master chip and control the at least one slave chip to start;

[0131] And a first configuration module, configured to perform an initialization configuration on the peripheral module of the master chip;

[0132] A second configuration module, configured to perform an initialization configuration on the peripheral module of the at least one slave chip when it is determined that the initialization configuration of the peripheral module of the master chip is completed and the MCU initialization configuration of the at least one slave chip is completed, so as to complete the cold start of the multi-chip device.

[0133] In an alternative embodiment, the device further includes:

[0134] An acquisition module, configured to acquire an abnormal address;

[0135] A second determination module, configured to determine whether the abnormal address is within a preset address range of the master chip;

[0136] A third determination module, configured to determine that the first slave chip has an abnormality when the abnormal address is within the preset address range of the master chip.

[0137] In the exception handling device of the multi-chip device provided by the embodiments of the present disclosure, if it is determined that an exception occurs in a first slave chip among at least one slave chip, a preset exception handling function is triggered to execute, and the preset exception handling function is called to count the exceptions that occur in the first slave chip within a preset duration, determine whether the number of exceptions that occur in the first slave chip within the preset duration exceeds a preset threshold, and, if it is determined that the number of exceptions that occur in the first slave chip within the preset duration exceeds the preset threshold, interrupt the communication between the first slave chip and the master chip and cancel the initialization configuration of the peripheral module of the first slave chip. It can be seen that in the embodiments of the present disclosure, when an exception occurs in the first slave chip, the exception is handled by calling the preset exception handling function. When it is determined that the number of exceptions that occur in the first slave chip within the preset duration exceeds the preset threshold, the communication between the first slave chip and the master chip is interrupted and the initialization configuration of the peripheral module of the first slave chip is canceled, thereby reducing the exception handling caused by mis-triggering and improving the user experience.

[0138] In addition to the above methods and devices, the embodiments of the present disclosure also provide a computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions run on a terminal device, the terminal device implements the exception handling method of the multi-chip device described in the embodiments of the present disclosure.

[0139] In addition, the embodiments of the present disclosure also provide an exception handling device for a multi-chip device. Refer to Figure 7 as shown, which may include:

[0140] A processor 701, a memory 702, an input device 703, and an output device 704. The number of processors 701 in the exception handling device for the multi-chip device may be one or more. Figure 7 Here, one processor is taken as an example. In some embodiments of the present disclosure, the processor 701, the memory 702, the input device 703, and the output device 704 may be connected through a bus or other means. Among them, Figure 7 here, the connection through the bus is taken as an example.

[0141] The memory 702 can be used to store software programs and modules. The processor 701 runs the software programs and modules stored in the memory 702, thereby realizing various functional applications and data processing of the exception handling device for the multi-chip device. The memory 702 mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function, etc. In addition, the memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices. The input device 703 can be used to receive input digital or character information, and generate signal inputs related to user settings and function controls of the exception handling device for the multi-chip device.

[0142] Specifically, in this embodiment, the processor 701 will load the executable files corresponding to the processes of one or more application programs into the memory 702 according to the following instructions, and the processor 701 will run the application programs stored in the memory 702, so as to implement various functions of the above-mentioned exception handling device for multi-chip devices.

[0143] It should be noted that in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.

[0144] The above are only specific embodiments of the present disclosure, enabling those skilled in the art to understand or implement the present disclosure. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to these embodiments described herein, but rather to the broadest scope consistent with the principles and novel features disclosed herein.

Claims

1. An abnormal handling method for a multi-chip device, characterized in that, the multi-chip device includes a main chip and at least one slave chip, and the method includes: if it is determined that a first slave chip among the at least one slave chip has an abnormality, trigger the execution of a preset abnormal handling function; invoke the preset abnormal handling function to count the abnormality that occurs in the first slave chip within a preset time period, and determine whether the number of times the first slave chip has the abnormality within the preset time period exceeds a preset threshold; and if it is determined that the number of times the first slave chip has the abnormality within the preset time period exceeds the preset threshold, interrupt the communication between the first slave chip and the main chip and cancel the initialization configuration of the peripheral module of the first slave chip.

2. The method according to claim 1, characterized in that, the step of if it is determined that a first slave chip among the at least one slave chip has an abnormality, trigger the execution of a preset abnormal handling function includes: if it is determined that a first slave chip among the at least one slave chip has an abnormality after the cold start of the multi-chip device is successful, trigger the execution of a preset abnormal handling function.

3. The method according to claim 2, characterized in that, the abnormality is an abnormality triggered when executing a first instruction, and the method further includes: if it is determined that the number of times the first slave chip has the abnormality within the preset time period does not exceed the preset threshold, roll back to the execution position of the first instruction and re-trigger the execution of the first instruction; if it is determined that the first slave chip has the abnormality again, trigger the execution of the step of invoking the preset abnormal handling function to count the abnormality that occurs in the first slave chip within a preset time period.

4. The method according to claim 2, characterized in that, before the step of if it is determined that a first slave chip among the at least one slave chip has an abnormality after the cold start of the multi-chip device is successful, trigger the execution of a preset abnormal handling function, it further includes: if it is determined that a first slave chip among the at least one slave chip has an abnormality during the cold start of the multi-chip device, interrupt the communication between the first slave chip and the main chip and cancel the initialization configuration of the peripheral module of the first slave chip.

5. The method according to claim 4, characterized in that, the step of if it is determined that a first slave chip among the at least one slave chip has an abnormality during the cold start of the multi-chip device, interrupt the communication between the first slave chip and the main chip and cancel the initialization configuration of the peripheral module of the first slave chip includes: if it is determined that a first slave chip among the at least one slave chip has an abnormality during the cold start of the multi-chip device, control the first slave chip to restart; determine whether the number of times the first slave chip restarts exceeds a preset number of times; if it is determined that the number of times the first slave chip restarts exceeds the preset number of times, interrupt the communication between the first slave chip and the main chip and cancel the initialization configuration of the peripheral module of the first slave chip.

6. The method according to claim 2, characterized in that, Before triggering the execution of a preset exception handling function if it is determined that a first slave chip among the at least one slave chip has an exception after a successful cold start of the multi-chip device, the method further includes: In response to the completion of the initialization configuration of the microcontroller unit (MCU) of the master chip, loading the firmware code of the at least one slave chip into a preset storage area of the master chip, and controlling the at least one slave chip to start; And, initializing and configuring the peripheral modules of the master chip; When it is determined that the initialization configuration of the peripheral modules of the master chip is completed and the initialization configuration of the MCU of the at least one slave chip is completed, initializing and configuring the peripheral modules of the at least one slave chip to complete the cold start of the multi-chip device.

7. The method according to claim 1, wherein, Before triggering the execution of a preset exception handling function if it is determined that a first slave chip among the at least one slave chip has an exception, the method further includes: Obtaining an exception address; Determining whether the exception address is within a preset address range of the master chip; If it is determined that the exception address is within the preset address range of the master chip, determining that the first slave chip has an exception.

8. An exception handling apparatus for a multi-chip device, wherein, The multi-chip device includes a master chip and at least one slave chip, and the apparatus includes: A first counting module, configured to trigger the execution of a preset exception handling function when it is determined that a first slave chip among the at least one slave chip has an exception; A first determining module, configured to call the preset exception handling function to count the exceptions that occur to the first slave chip within a preset duration, and determine whether the number of exceptions that occur to the first slave chip within the preset duration exceeds a preset threshold; A first interrupt module, configured to interrupt the communication between the first slave chip and the master chip and cancel the initialization configuration of the peripheral modules of the first slave chip when it is determined that the number of exceptions that occur to the first slave chip within the preset duration exceeds the preset threshold.

9. An exception handling device for a multi-chip device, wherein, It includes: A memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the method as described in any one of claims 1-7 is implemented.

10. A computer-readable storage medium, wherein, Instructions are stored in the computer-readable storage medium. When the instructions are run on a terminal device, the terminal device is caused to implement the method as described in any one of claims 1-7.