Safety detection method and related equipment for real-time clock modules in automotive-grade chips
By detecting the difference in count value of the real-time clock module and outputting error flag signals, the problem of untimely detection or false alarms in the prior art is solved, and efficient and accurate real-time clock module status detection is achieved, which improves the safety and reliability of the automotive electronic system.
Patent Information
- Application Number
- CN202411683435.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-04-04
AI Technical Summary
The existing real-time clock module may have untimely detection or false alarms when facing complex working conditions, which affects the reliability and safety of automotive electronic systems.
By obtaining the current count value output by the real-time clock module, counting detection is performed, counting values at multiple different times, and the working status of the real-time clock module is judged based on the difference between the count value at the current time and the count value at the previous time. If a counting abnormality is detected, an error flag signal is output, and the error flag signal is received through the functional safety management module to trigger corresponding safety measures.
It realizes efficient and accurate detection of real-time clock module status, improves the performance and safety of automotive-grade chips, ensures that the system can timely detect and deal with potential problems when facing complex working conditions, and avoids safety risks caused by time errors.
Smart Images

Figure CN119759178A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of chip design and application technology, and in particular to a safety detection method and related equipment for a real-time clock module in an automotive-grade chip. Background Art
[0002] In modern automotive electronic systems, real-time clock modules, as key time reference components, are widely used in various vehicle systems, such as navigation systems, driving recorders, airbag control units, etc. It is responsible for providing accurate time information to ensure the normal operation of vehicle systems. However, due to the complex and changeable operating environment of the vehicle, the real-time clock module may be affected by factors such as electromagnetic interference and power supply fluctuations, resulting in deviations or stagnation in time counting, which in turn affects the reliability and safety of the entire system. Especially in autonomous driving and advanced driver assistance systems (ADAS), the accuracy of timestamps is crucial for target recognition, path planning, etc. Any time error may lead to serious consequences.
[0003] Although the existing solutions can guarantee the basic functions of the real-time clock module to a certain extent, there may still be untimely detection or false alarms when facing complex working conditions. Therefore, developing a method that can efficiently and accurately detect the status of the real-time clock module is of great significance to improving the overall performance of automotive electronic systems. Summary of the invention
[0004] The embodiments of the present application provide a method and related equipment for detecting the security of a real-time clock module in an automotive-grade chip, which can efficiently and accurately detect the status of the real-time clock module and has a simple design, thereby improving the performance and security of the automotive-grade chip.
[0005] To achieve the above-mentioned purpose, the first aspect of an embodiment of the present application provides a safety detection method for a real-time clock module in an automotive-grade chip, including: obtaining the current count value output by the real-time clock module, performing count detection, and obtaining count values at multiple different moments; judging the working status of the real-time clock module according to the difference between the count value at the current moment and the count value at the previous moment, and outputting an error flag signal if a counting abnormality is detected; receiving the error flag signal through a preset functional safety management module, and triggering the safety measures corresponding to the error flag signal according to the system configuration corresponding to the automotive-grade chip.
[0006] In some embodiments, the process of obtaining the current count value output by the real-time clock module, performing counting detection, and obtaining count values at multiple different moments includes: receiving the count value of the real-time clock module while the system clock of the automotive-grade chip is synchronized, and obtaining the count value of the real-time clock module again after one cycle of the system clock, so as to respectively determine the two count values obtained as the count values at the current moment and the previous moment.
[0007] In some embodiments, the working state of the real-time clock module is judged according to the difference between the count value at the current moment and the count value at the previous moment, and if a counting abnormality is detected, an error flag signal is output, including: comparing the count value at the current moment with the count value at the previous moment, if the count value at the current moment is greater than the count value at the previous moment, determining that the working state of the real-time clock module is normal operation; if the count value at the current moment is less than or equal to the count value at the previous moment, determining that the working state of the real-time clock module is that there is a counting abnormality, and outputting an error flag signal.
[0008] In some embodiments, the error flag signal is received by a preset functional safety management module, and corresponding safety measures are triggered according to the system configuration corresponding to the automotive-grade chip, including: when the preset functional safety management module receives the error flag signal, determining the preset rules in the system configuration corresponding to the automotive-grade chip; according to the preset rules, one or more of a high-priority error interrupt, a low-priority error interrupt or an ErrorPad status signal are selected for output, so that the automotive-grade chip enters a corresponding safety state.
[0009] In some embodiments, before obtaining the current count value output by the real-time clock module, the method also includes: after the real-time clock module turns on its own enable signal and starts normal counting and operation, sending a real-time detection enable signal and a power-on self-test enable signal to a preset clock detection module, so that the clock detection module starts to obtain the current count value output by the real-time clock module and perform counting detection.
[0010] In some embodiments, the sending of a real-time detection enable signal and a power-on self-test enable signal to a preset clock detection module so that the clock detection module starts to obtain the current count value output by the real-time clock module and performs a count detection includes: sending a real-time detection enable signal to a preset clock detection module so that the clock detection module starts to obtain the current count value output by the real-time clock module and performs a count detection; after the clock detection module starts to obtain the current count value output by the real-time clock module and performs a count detection, sending a real-time detection enable signal to the clock detection module so that the clock detection module performs a power-on self-test action.
[0011] In some embodiments, the method also includes: reading and writing the configuration register of the functional safety management module through the APB bus to configure the preset rules of the functional safety management module, and the preset rules are used to determine the output conditions of the high priority error interrupt, the low priority error interrupt and the ErrorPad status signal.
[0012] To achieve the above-mentioned purpose, the second aspect of an embodiment of the present application provides a safety detection device for a real-time clock module in an automotive-grade chip, including: a real-time clock module, used to output a count value; a clock detection module, used to obtain the current count value output by the real-time clock module, perform count detection, and obtain count values at multiple different moments; judge the working status of the real-time clock module according to the difference between the count value at the current moment and the count value at the previous moment, and output an error flag signal if a counting abnormality is detected; a functional safety management module, used to receive the error flag signal, and trigger the safety measures corresponding to the error flag signal according to the system configuration corresponding to the automotive-grade chip.
[0013] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application provides an electronic device, comprising: at least one processor; at least one memory for storing at least one program; when at least one of the programs is executed by at least one of the processors, a security detection method for a real-time clock module in an automotive-grade chip as described in any one of the first aspects is implemented.
[0014] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the security detection method of the real-time clock module in the automotive-grade chip as described in any one of the fourth aspects.
[0015] The embodiments of the present application provide a safety detection method and related equipment for a real-time clock module in an automotive-grade chip. The method can obtain the current count value output by the real-time clock module, perform count detection, and obtain count values at multiple different moments; judge the working status of the real-time clock module according to the difference between the count value at the current moment and the count value at the previous moment, and output an error flag signal if a counting abnormality is detected; receive the error flag signal through a preset functional safety management module, and trigger the safety measures corresponding to the error flag signal according to the system configuration corresponding to the automotive-grade chip; wherein the real-time clock module continuously outputs the current count value. The clock detection module periodically reads this count value and records it. In this way, the count values at multiple different time points can be obtained, providing basic data for subsequent comparison and analysis; further, the clock detection module compares the count value at the current moment with the count value at the previous moment, and calculates the difference between them. If the difference is greater than zero, it means that the count is normal and the real-time clock module is working normally. Through simple difference calculation, the working status of the real-time clock module can be quickly and accurately determined, and potential problems can be discovered in time; further, the error flag signal is received through the preset functional safety management module, and the safety measures corresponding to the error flag signal are triggered according to the system configuration corresponding to the automotive-grade chip. Once the clock detection module detects a count abnormality, it will output an error flag signal. It can be understood that after receiving the error flag signal, the functional safety management module decides the safety measures to be taken according to the preset system configuration, thereby ensuring that when a problem is detected, the system can take prompt action to avoid safety risks caused by time errors. In summary, the present application can quickly determine whether the count is normal by comparing the difference in count value between the current moment and the previous moment. The clock detection module continuously monitors the output of the real-time clock module, and immediately outputs an error flag signal once an abnormality is found, ensuring that the problem can be discovered and handled in time, and can simply and efficiently complete the status detection of the real-time clock module in a short time. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A schematic diagram of a safety detection device for a real-time clock module in an automotive-grade chip provided in an embodiment of the present application;
[0017] Figure 2 A flowchart of a method for safety detection of a real-time clock module in an automotive-grade chip provided in an embodiment of the present application;
[0018] Figure 3 A schematic diagram of clock detection in a safety detection method for a real-time clock module in an automotive-grade chip provided in an embodiment of the present application;
[0019] Figure 4A flowchart for performing clock detection in a safety detection method for a real-time clock module in an automotive-grade chip provided in an embodiment of the present application;
[0020] Figure 5 A flow chart of outputting an error flag signal in a safety detection method for a real-time clock module in an automotive-grade chip provided in an embodiment of the present application;
[0021] Figure 6 A flowchart of triggering corresponding safety measures in a safety detection method for a real-time clock module in an automotive-grade chip provided in an embodiment of the present application;
[0022] Figure 7 A flow chart of performing counting detection in a safety detection method for a real-time clock module in an automotive-grade chip provided in an embodiment of the present application;
[0023] Figure 8 Another flow chart of counting detection in the safety detection method of the real-time clock module in the automotive-grade chip provided in one embodiment of the present application;
[0024] Fig. 9 A flowchart for configuring preset rules in a security detection method for a real-time clock module in an automotive-grade chip provided in an embodiment of the present application;
[0025] Fig.10 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0027] In some embodiments, although the functional modules are divided in the system schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the system or the order in the flowchart. The terms first, second, etc. in the specification, claims and the above drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0028] In addition, unless otherwise clearly specified and limited, the term "connected" should be understood in a broad sense. For example, it can be a fixed connection or a movable connection, a detachable connection or a non-detachable connection, or an integral connection; it can be a mechanical connection, an electrical connection, or the two can communicate with each other; it can be a direct connection or an indirect connection through an intermediate medium.
[0029] In the description of the embodiments of the present application, the description of reference terms "one embodiment / implementation", "another embodiment / implementation" or "certain embodiments / implementations", "in the above embodiments / implementations", etc. means that the specific features, structures, materials or characteristics described in combination with the implementation or example are included in at least two embodiments or implementations disclosed in the present application. In the disclosure of this application, the schematic representation of the above terms does not necessarily refer to the same embodiment or implementation. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that in the flowchart.
[0030] Currently, in modern automotive electronic systems, real-time clock modules are widely used in various vehicle systems as key time reference components, such as navigation systems, driving recorders, airbag control units, etc. It is responsible for providing accurate time information to ensure the normal operation of vehicle systems. However, due to the complex and changeable operating environment of the vehicle, the real-time clock module may be affected by factors such as electromagnetic interference and power supply fluctuations, resulting in deviations or stagnation in time counting, which in turn affects the reliability and safety of the entire system. Especially in autonomous driving and advanced driver assistance systems (ADAS), the accuracy of timestamps is crucial for target recognition, path planning, etc. Any time error may lead to serious consequences.
[0031] Although the existing solutions can guarantee the basic functions of the real-time clock module to a certain extent, there may still be untimely detection or false alarms when facing complex working conditions. Therefore, developing a method that can efficiently and accurately detect the status of the real-time clock module is of great significance to improving the overall performance of automotive electronic systems.
[0032] It can be understood that in order to overcome the limitations of the prior art, the present application provides a safety detection method for a real-time clock module in an automotive-grade chip, including: obtaining the current count value output by the real-time clock module, performing count detection, and obtaining count values at multiple different moments; judging the working status of the real-time clock module according to the difference between the count value at the current moment and the count value at the previous moment, and outputting an error flag signal if a counting abnormality is detected; receiving the error flag signal through a preset functional safety management module, and triggering the safety measures corresponding to the error flag signal according to the system configuration corresponding to the automotive-grade chip, wherein the present application can quickly determine whether the counting is normal by comparing the difference between the count value at the current moment and the previous moment, and the clock detection module continuously monitors the output of the real-time clock module, and immediately outputs an error flag signal once an abnormality is found, to ensure that the problem can be discovered and handled in a timely manner, and the status detection of the real-time clock module can be completed simply and efficiently in a short time.
[0033] The embodiments of the present application are further described below in conjunction with the accompanying drawings.
[0034] refer to Figure 1 and Figure 2 , Figure 1 A schematic diagram of a safety detection device for a real-time clock module in an automotive-grade chip provided in an embodiment of the present application, Figure 2 A flowchart of a safety detection method for a real-time clock module in an automotive-grade chip provided by an embodiment of the present application; To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application provides a safety detection method for a real-time clock module in an automotive-grade chip, the method being applied to a safety detection device for a real-time clock module in an automotive-grade chip, the method comprising:
[0035] Step S210, obtaining the current count value output by the real-time clock module, performing count detection, and obtaining count values at multiple different moments;
[0036] Step S220, judging the working state of the real-time clock module according to the difference between the count value at the current moment and the count value at the previous moment, and outputting an error flag signal if a count abnormality is detected;
[0037] Step S230, receiving the error flag signal through a preset functional safety management module, and triggering the safety measures corresponding to the error flag signal according to the system configuration corresponding to the automotive-grade chip.
[0038] Among them, the real-time clock module continuously outputs the current count value. The clock detection module periodically reads this count value and records it. Through the above method, the count values of multiple different time points can be obtained to provide basic data for subsequent comparison and analysis; further, the clock detection module compares the count value at the current moment with the count value at the previous moment, and calculates the difference between them. If the difference is greater than zero, it means that the count is normal and the real-time clock module is working normally. Through simple difference calculation, the working state of the real-time clock module can be quickly and accurately judged, and potential problems can be discovered in time; further, the error flag signal is received through the preset functional safety management module, and the safety measures corresponding to the error flag signal are triggered according to the system configuration corresponding to the automotive-grade chip. Once the clock detection module detects an abnormal count, it will output an error flag signal. It can be understood that after receiving this error flag signal, the functional safety management module determines the safety measures to be taken according to the preset system configuration, so as to ensure that when a problem is detected, the system can take prompt action to avoid safety risks caused by time errors. In summary, the present application can quickly determine whether the count is normal by comparing the difference in count value between the current moment and the previous moment. The clock detection module continuously monitors the output of the real-time clock module, and immediately outputs an error flag signal once an abnormality is found, ensuring that the problem can be discovered and handled in time, and can simply and efficiently complete the status detection of the real-time clock module in a short time.
[0039] Among them, the automotive-grade chip is an integrated circuit chip that meets the automotive industry standards and is suitable for automotive electronic systems. The real-time clock module (RTC) is a hardware module that can provide accurate time information and is usually used to record system time. This application continuously monitors the count value output by the real-time clock module to ensure the continuity and correctness of the count value, and determines whether the real-time clock module is working normally by calculating the difference between the count value at the current moment and the count value at the previous moment. When the real-time clock module is detected to be working abnormally, the generated signal is used to notify other parts of the system.
[0040] In some embodiments, the functional safety management module (ESM) is responsible for managing and processing error flag signals from various safety mechanisms, triggering corresponding safety measures according to the system configuration, and the system configuration: = is a preset series of parameters and rules used to define specific safety measures to be taken when an error is detected.
[0041] In some embodiments, corresponding to step S210, by periodically reading the current count value of the real-time clock module, it ensures that enough data points are obtained to improve the accuracy of the detection. By continuously obtaining the count value, the real-time nature of the detection result is ensured, and potential problems are discovered in time; corresponding to step S220, the present application uses a simple difference calculation to quickly determine whether the count is normal, thereby improving the detection efficiency. A difference greater than zero indicates that the count is normal, and a difference less than or equal to zero indicates that the count is abnormal. This method is simple and accurate. Once an abnormality is detected, an error flag signal is immediately output to ensure that the system can take timely measures; corresponding to step S230, the functional safety management module can choose to generate a high-priority error interrupt, a low-priority error interrupt or an ErrorPad status signal according to the system configuration to ensure that the system takes appropriate countermeasures in different situations, and by timely triggering safety measures, avoids safety risks caused by time errors, and improves the overall stability of the system. The system configuration can be adjusted according to specific application scenarios to improve the adaptability and flexibility of the system.
[0042] In some embodiments, the current count value output by the real-time clock module is obtained, and count detection is performed to obtain count values at multiple different moments. It also includes periodically triggering the reading of the current count value of the real-time clock module by using a timer, for example, reading it once per second, and storing each read count value in a circular buffer to ensure that the count values at multiple different moments can be stored. When reading the count value, data verification is performed based on a preset trajectory to ensure the integrity and accuracy of the data.
[0043] In some embodiments, the working state of the real-time clock module is judged according to the difference between the count value at the current moment and the count value at the previous moment. If a counting abnormality is detected, an error flag signal is output. It also includes: taking the count value at the current moment and the count value at the previous moment from the ring buffer, calculating their difference, and setting a threshold. For example, the difference in count values within 1 second should be 1. If the difference is less than or equal to 0, or exceeds a reasonable range (such as more than 100), it is judged as a counting abnormality. Once a counting abnormality is detected, an error flag signal can be immediately generated and sent to the functional safety management module.
[0044] In some embodiments, an error flag signal is received through a preset functional safety management module, and the safety measures corresponding to the error flag signal are triggered according to the system configuration corresponding to the automotive-grade chip. The functional safety management module also receives the error flag signal through a dedicated interface, and reads the preset system configuration to determine the safety measures to be taken when an error is detected, wherein the safety measures include: high-priority error interrupt: immediately trigger a high-priority error interrupt to notify the CPU to stop the current operation and enter the error handler. Low-priority error interrupt: trigger a low-priority error interrupt to notify other parts of the system to check and process. ErrorPad status signal: output the status signal through the ErrorPad for further diagnosis and processing by external devices. In addition, the functional safety management module can also record the occurrence time and type of the error flag signal to facilitate subsequent analysis and troubleshooting.
[0045] refer to Figure 3 and Figure 4 , Figure 3 A schematic diagram of clock detection in a safety detection method for a real-time clock module in an automotive-grade chip provided in an embodiment of the present application, Figure 4 A flowchart of clock detection in a safety detection method for a real-time clock module in an automotive-grade chip provided in an embodiment of the present application; in some embodiments, obtaining a current count value output by the real-time clock module, performing count detection, and obtaining count values at multiple different times includes:
[0046] Step S410, receiving a count value of a real-time clock module when the system clock of the automotive-grade chip is synchronized;
[0047] Step S420, obtaining the count value of the real-time clock module again after one cycle of the system clock, so as to determine the two obtained count values as the count values at the current moment and the previous moment respectively.
[0048] In some embodiments, corresponding to step S410, it can be understood that, when the system clock is synchronized, it is ensured that when reading the count value of the real-time clock module, the timing of the system clock and the real-time clock module are consistent, so as to avoid data reading errors caused by clock asynchronization. Specifically, the present application can use a synchronization signal (such as a synchronization pulse) to ensure the synchronization of the system clock and the real-time clock module, and read the current count value of the real-time clock module under the triggering of the synchronization signal, and store the read count value at a specific location in the memory for subsequent use.
[0049] In some embodiments, corresponding to step S420, it can be understood that after one cycle of the system clock, the count value of the real-time clock module is read again, so that the time interval between the two readings is fixed, which is convenient for the subsequent difference calculation. Specifically, the present application can use a timer or a counter to ensure that the reading operation is triggered again after one cycle of the system clock, and the new count value is stored in another location in the memory, marked as the count value at the current moment, and the previous count value is marked as the count value at the previous moment, and a ring buffer or other data structure is used to manage the count values at multiple different moments to ensure the orderliness and integrity of the data, and then the working status of the real-time clock module can be judged according to the difference between the count value at the current moment and the count value at the previous moment. For example, Figure 3 In the process, the count value at the current moment is subtracted from the count value at the previous moment through a subtraction module, and the corresponding difference is used as a flag bit. A state detection is performed based on the flag bit. If a count abnormality is detected, an error flag signal is output.
[0050] refer to Figure 5 , Figure 5 A flowchart of outputting an error flag signal in a safety detection method for a real-time clock module in a vehicle-grade chip provided in an embodiment of the present application; in some embodiments, the working state of the real-time clock module is judged according to the difference between the count value at the current moment and the count value at the previous moment, and if a count abnormality is detected, an error flag signal is output, including:
[0051] Step S510, compare the count value at the current moment with the count value at the previous moment. If the count value at the current moment is greater than the count value at the previous moment, determine that the working state of the real-time clock module is normal operation; if the count value at the current moment is less than or equal to the count value at the previous moment, determine that the working state of the real-time clock module is that there is a counting abnormality, and output an error flag signal.
[0052] In some embodiments, by comparing the count values at the current moment and the previous moment, it is determined whether the real-time clock module is working normally. If the count value at the current moment is greater than the count value at the previous moment, it means that the count is normal; otherwise, it means that the count is abnormal. Specifically, the present application can read the count values at the current moment and the previous moment from the memory, calculate their difference, and set a reasonable threshold. For example, the difference in count values within 1 second should be 1. If the difference is greater than 0, it means that the count is normal; if the difference is less than or equal to 0, it means that the count is abnormal. Then, when the count abnormality is detected, an error flag signal is generated and sent to the functional safety management module.
[0053] In some embodiments, corresponding to step S410, the present application can also introduce a multi-level synchronization mechanism to ensure the accuracy of data reading under different levels of clock synchronization, and add a fault-tolerant mechanism during the synchronization process, such as taking the average of multiple readings to reduce reading errors caused by instantaneous interference; step S420, the present application can also use a circular buffer to manage count values at multiple different times to ensure the orderliness and efficient management of the data, and add a data verification mechanism when reading and storing count values, such as CRC verification, to ensure the integrity and accuracy of the data.
[0054] In some embodiments, the present application can dynamically adjust the threshold of the difference judgment in step S510 according to the actual application scenario, improve the flexibility and accuracy of the detection, perform multiple comparisons within one detection cycle, take the majority of results as the final judgment, reduce the possibility of misjudgment, and generate different levels of error flag signals according to the severity of the abnormality, such as minor abnormalities, serious abnormalities, etc., so that the system can take different response measures; in addition, after the error flag signal is generated, a self-recovery mechanism is added to try to automatically repair the abnormality of the real-time clock module to reduce manual intervention.
[0055] refer to Figure 6 , Figure 6 A flowchart of triggering corresponding safety measures in a safety detection method for a real-time clock module in an automotive-grade chip provided in an embodiment of the present application; in some embodiments, an error flag signal is received by a preset functional safety management module, and corresponding safety measures are triggered according to the system configuration corresponding to the automotive-grade chip, including:
[0056] Step S610, when the preset functional safety management module receives the error flag signal, it determines the preset rules in the system configuration corresponding to the automotive-grade chip;
[0057] Step S620, according to preset rules, select one or more of a high priority error interrupt, a low priority error interrupt or an ErrorPad status signal for output, so that the automotive-grade chip enters a corresponding safety state.
[0058] In some embodiments, after receiving the error flag signal, the functional safety management module first reads the preset system configuration to understand the specific measures to be taken when an error is detected, wherein the system configuration is stored in a non-volatile memory (such as Flash or EEPROM) to ensure that it remains valid after the system is restarted. The functional safety management module can read the system configuration file and parse the preset rules therein, such as the priority of the error interrupt, the output conditions of the ErrorPad status signal, etc., and perform a simple verification before applying the preset rules to ensure the validity and consistency of the rules.
[0059] In some embodiments, based on the parsed preset rules, the functional safety management module selects appropriate error handling measures to ensure that the system can quickly enter a safe state. Specifically, the present application can generate a high-priority or low-priority error interrupt signal according to the preset rules, and send it to the CPU through the interrupt controller. If the configuration includes an ErrorPad status signal, the functional safety management module outputs the ErrorPad status signal through a dedicated pin for further diagnosis and processing by external devices; in addition, the present application can support the simultaneous generation of multiple error handling measures, such as simultaneously generating a high-priority error interrupt and an ErrorPad status signal to ensure multiple protections of the system, and record detailed information on each error handling, including the generation time of the error flag signal, the selected error handling measures, etc., to facilitate subsequent analysis and troubleshooting.
[0060] In some embodiments, the chip system corresponding to the present application supports multiple ErrorPad pins for outputting different types of status signals to improve the diagnostic capability of the system. The functional safety management module can adjust the strength and type of the ErrorPad signal according to the requirements of external devices to ensure the reliability of signal transmission.
[0061] refer to Figure 7 , Figure 7 A flowchart of performing count detection in a safety detection method for a real-time clock module in a vehicle-grade chip provided in an embodiment of the present application; in some embodiments, before obtaining the current count value output by the real-time clock module, the method further includes:
[0062] Step S710, after the real-time clock module turns on its own enable signal and starts normal counting and operation, it sends a real-time detection enable signal and a power-on self-test enable signal to a preset clock detection module, so that the clock detection module starts to obtain the current count value output by the real-time clock module and perform count detection.
[0063] In some embodiments, after the real-time clock module works normally, the clock detection module is activated by sending a real-time detection enable signal and a power-on self-test enable signal, so that it starts counting detection. Specifically, the real-time clock module turns on its own enable signal to ensure its normal operation. This can be achieved by setting a register bit or sending a specific command; by setting the register bit of the clock detection module and sending a real-time detection enable signal, the clock detection module enters the real-time detection mode; at the beginning of the system power-on, by setting the register bit of the clock detection module and sending a power-on self-test enable signal, the clock detection module performs self-test to ensure that its own function is normal.
[0064] refer to Figure 8 , Figure 8 Another flow chart for performing count detection in a safety detection method for a real-time clock module in an automotive-grade chip provided in an embodiment of the present application; in some embodiments, a real-time detection enable signal and a power-on self-test enable signal are sent to a preset clock detection module so that the clock detection module starts to obtain the current count value output by the real-time clock module and performs count detection, including:
[0065] Step S810, sending a real-time detection enable signal to a preset clock detection module, so that the clock detection module starts to obtain the current count value output by the real-time clock module and performs count detection;
[0066] Step S820, after the clock detection module starts to obtain the current count value output by the real-time clock module and performs count detection, a real-time detection enable signal is sent to the clock detection module to enable the clock detection module to perform a power-on self-test action.
[0067] It is understandable that the real-time detection enable signal and the power-on self-test enable signal cannot be enabled at the same time, ensuring that the clock detection module only performs one detection task at the same time. The functional safety management module monitors the status of the clock detection module to ensure that it works as expected. This can be achieved by reading the status register or receiving the status report. Through the power-on self-test enable signal, the clock detection module automatically performs self-test when the chip starts to ensure its normal operation, further improving the reliability of the system.
[0068] refer to Fig. 9 , Fig. 9 A flowchart of configuring preset rules in a security detection method for a real-time clock module in a vehicle-grade chip provided in an embodiment of the present application; in some embodiments, the method further includes:
[0069] Step S910, reading and writing the configuration register of the functional safety management module through the APB bus to configure the preset rules of the functional safety management module, the preset rules are used to determine the output conditions of the high priority error interrupt, the low priority error interrupt and the ErrorPad status signal.
[0070] In some embodiments, the CPU can access the configuration registers of the functional safety management module through the APB bus, read or write configuration data, and set preset rules, including the output conditions of high-priority error interrupts, low-priority error interrupts, and ErrorPad status signals. For example, the high-priority error interrupt can be set to be triggered when a serious error is detected, the low-priority error interrupt can be set to be triggered when a minor error is detected, and the ErrorPad status signal can be output when any error is detected; further, after setting the configuration, a simple verification is performed to ensure the validity and consistency of the rules, and the configuration data is saved in a non-volatile memory (such as Flash or EEPROM) to ensure that it is still valid after the system is restarted, so as to allow dynamic adjustment of the configuration during system operation and improve the flexibility and adaptability of the system.
[0071] It is understandable that the functional safety management module can select different safety measures according to the system configuration, such as high-priority error interrupt, low-priority error interrupt or Error Pad status signal, to ensure that the system can take appropriate countermeasures in different situations; among them, the high-priority error interrupt is a higher priority interrupt signal, which is used to notify the CPU and other system modules that a serious error has occurred and needs to be processed immediately; the low-priority error interrupt is a lower priority interrupt signal, which is used to notify the CPU and other system modules that a minor error has occurred and can be processed at an appropriate time; the Error Pad status signal is an error status signal output through a dedicated pin, which is used to notify external devices that an error has occurred in the system and report the error status of the real-time clock module to facilitate further diagnosis and processing.
[0072] In some embodiments, after detecting a counting abnormality, the present application can automatically reset the real-time clock module after a preset time interval, reinitialize the counter, and automatically switch to a backup clock source when the main clock source corresponding to the real-time clock module fails, thereby ensuring the continuity of the system time.
[0073] To achieve the above-mentioned purpose, the second aspect of an embodiment of the present application provides a safety detection device for a real-time clock module in an automotive-grade chip, including: a real-time clock module, used to output a count value; a clock detection module, used to obtain the current count value output by the real-time clock module, perform count detection, and obtain count values at multiple different moments; judge the working status of the real-time clock module according to the difference between the count value at the current moment and the count value at the previous moment, and output an error flag signal if a counting abnormality is detected; a functional safety management module, used to receive the error flag signal, and trigger the safety measures corresponding to the error flag signal according to the system configuration corresponding to the automotive-grade chip.
[0074] Some embodiments of the present application provide an electronic device, Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, referring to Fig.10 The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the safety detection method for the real-time clock module in the automotive-grade chip of any one of the above embodiments is implemented. For example, the above described Figure 2 Steps S210 to S230 of the method, Figure 4 Steps S410 to S420 of the method, Figure 5 In method step S510, Figure 6 Steps S610 to S620 of the method, Figure 7 In method step S710, Figure 8 Steps S810 to S820 of the method, Fig. 9 Method step S910 in .
[0075] The electronic device 1000 of the embodiment of the present application includes one or more processors 1010 and a memory 1020. Fig.10 In the figure, a processor 1010 and a memory 1020 are taken as an example.
[0076] The processor 1010 and the memory 1020 may be connected via a bus or other means. Fig.10 The example of connecting through bus is taken in the following.
[0077] The memory 1020, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory 1020 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 1020 may optionally include a memory 1020 remotely disposed relative to the processor 1010, and these remote memories may be connected to the electronic device 1000 via a network. At the same time, examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0078] In some embodiments, when the processor executes a computer program, the method for safety detection of a real-time clock module in an automotive-grade chip of any of the above embodiments is executed at preset intervals.
[0079] Those skilled in the art will understand that Fig.10 The device structure shown in the figure does not constitute a limitation on the electronic device 1000, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0080] exist Fig.10 In the electronic device 1000 shown, the processor 1010 can be used to call the safety detection method of the real-time clock module in the automotive-grade chip stored in the memory 1020, thereby implementing the safety detection method of the real-time clock module in the automotive-grade chip.
[0081] Based on the hardware structure of the above-mentioned electronic device 1000, various embodiments of the safety detection device for the real-time clock module in the automotive-grade chip of the present application are proposed. At the same time, the non-transient software program and instructions required to implement the safety detection method for the real-time clock module in the automotive-grade chip of the above-mentioned embodiment are stored in the memory. When executed by the processor, the safety detection method for the real-time clock module in the automotive-grade chip of the above-mentioned embodiment is executed.
[0082] The embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are used to execute the above-mentioned security detection method for the real-time clock module in the automotive-grade chip, which can enable the above-mentioned one or more processors to execute the security detection method for the real-time clock module in the automotive-grade chip of any of the above-mentioned embodiments, for example, to execute the above-mentioned Figure 2 Steps S210 to S230 of the method, Figure 4 Steps S410 to S420 of the method, Figure 5 In method step S510, Figure 6 Steps S610 to S620 of the method, Figure 7 In method step S710, Figure 8 Steps S810 to S820 of the method, Fig. 9 Method step S910 in .
[0083] The embodiment of the present application also provides a computer program product, which includes a computer program, which is stored in a computer-readable storage medium. The processor of the computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the security detection method of the real-time clock module in the automotive-grade chip in any of the above embodiments, for example, executing the above described Figure 2 Steps S210 to S230 of the method, Figure 4 Steps S410 to S420 of the method, Figure 5 In method step S510, Figure 6 Steps S610 to S620 of the method, Figure 7 In method step S710, Figure 8 Steps S810 to S820 of the method, Fig. 9In the method step S910, the above described device embodiment is only illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place, or they may be distributed on multiple network nodes. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0084] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer-readable storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer-readable storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer-readable storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD to ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically include computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery media. The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the above implementation mode. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present application, and these equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.
Claims
1. A safety detection method for a real-time clock module in an automotive-grade chip, characterized in that: include: Obtain the current count value output by the real-time clock module, perform count detection, and obtain count values at multiple different times; Determine the working state of the real-time clock module according to the difference between the count value at the current moment and the count value at the previous moment, and output an error flag signal if a count abnormality is detected; The error flag signal is received through a preset functional safety management module, and the safety measures corresponding to the error flag signal are triggered according to the system configuration corresponding to the automotive-grade chip.
2. The safety detection method for the real-time clock module in the automotive-grade chip according to claim 1 is characterized in that: The method of obtaining the current count value output by the real-time clock module and performing count detection to obtain the count values at multiple different times includes: When the system clock of the automotive-grade chip is synchronized, the count value of the real-time clock module is received, and the count value of the real-time clock module is obtained again after one cycle of the system clock, so as to respectively determine the two count values obtained as the count values at the current moment and the previous moment.
3. The safety detection method for the real-time clock module in the automotive-grade chip according to claim 1 is characterized in that: The method of judging the working state of the real-time clock module according to the difference between the count value at the current moment and the count value at the previous moment, and outputting an error flag signal if a count abnormality is detected, includes: Compare the count value at the current moment with the count value at the previous moment. If the count value at the current moment is greater than the count value at the previous moment, determine that the working state of the real-time clock module is normal operation; if the count value at the current moment is less than or equal to the count value at the previous moment, determine that the working state of the real-time clock module is that there is a counting abnormality, and output an error flag signal.
4. The safety detection method for the real-time clock module in the automotive-grade chip according to claim 1 is characterized in that: The receiving the error flag signal through a preset functional safety management module and triggering corresponding safety measures according to the system configuration corresponding to the automotive-grade chip include: When the preset functional safety management module receives the error flag signal, it determines a preset rule in the system configuration corresponding to the automotive-grade chip; According to the preset rules, one or more of a high priority error interrupt, a low priority error interrupt or an ErrorPad status signal are selected for output, so that the automotive-grade chip enters a corresponding safety state.
5. The safety detection method for the real-time clock module in the automotive-grade chip according to claim 1 is characterized in that: Before obtaining the current count value output by the real-time clock module, the method further includes: A real-time detection enable signal and a power-on self-test enable signal are sent to a preset clock detection module, so that the clock detection module starts to obtain the current count value output by the real-time clock module and performs count detection.
6. The safety detection method for the real-time clock module in the automotive-grade chip according to claim 5 is characterized in that: The sending of the real-time detection enable signal and the power-on self-test enable signal to the preset clock detection module so that the clock detection module starts to obtain the current count value output by the real-time clock module and performs count detection, including: Sending a real-time detection enable signal to a preset clock detection module, so that the clock detection module starts to obtain the current count value output by the real-time clock module and performs count detection; The clock detection module starts to obtain the current count value output by the real-time clock module, and after performing count detection, sends a real-time detection enable signal to the clock detection module, so that the clock detection module performs a power-on self-test action.
7. The safety detection method for the real-time clock module in the automotive-grade chip according to claim 4 is characterized in that: The method further comprises: The configuration register of the functional safety management module is read and written through the APB bus to configure the preset rules of the functional safety management module, and the preset rules are used to determine the output conditions of the high priority error interrupt, the low priority error interrupt and the ErrorPad status signal.
8. A safety detection device for a real-time clock module in an automotive-grade chip, characterized in that: include: Real-time clock module, used to output count value; The clock detection module is used to obtain the current count value output by the real-time clock module, perform count detection, and obtain count values at multiple different times; Determine the working state of the real-time clock module according to the difference between the count value at the current moment and the count value at the previous moment, and output an error flag signal if a count abnormality is detected; A functional safety management module is used to receive the error flag signal and trigger safety measures corresponding to the error flag signal according to the system configuration corresponding to the automotive-grade chip.
9. An electronic device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When at least one of the programs is executed by at least one of the processors, the security detection method for the real-time clock module in the automotive-grade chip as described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the safety detection method for the real-time clock module in the automotive-grade chip as described in any one of claims 1 to 7.