CN115658321A - Method and device for acquiring fault information of automobile instrument, electronic equipment and storage medium - Google Patents

Method and device for acquiring fault information of automobile instrument, electronic equipment and storage medium Download PDF

Info

Publication number
CN115658321A
CN115658321A CN202211426708.4A CN202211426708A CN115658321A CN 115658321 A CN115658321 A CN 115658321A CN 202211426708 A CN202211426708 A CN 202211426708A CN 115658321 A CN115658321 A CN 115658321A
Authority
CN
China
Prior art keywords
sram
information
automobile instrument
abnormal
log
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211426708.4A
Other languages
Chinese (zh)
Inventor
苏雷龙
汪骏
张富国
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beidou Xingtong Zhilian Technology Nanjing Co ltd
BDstar Intelligent and Connected Vehicle Technology Co Ltd
Original Assignee
BDstar Intelligent and Connected Vehicle Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BDstar Intelligent and Connected Vehicle Technology Co Ltd filed Critical BDstar Intelligent and Connected Vehicle Technology Co Ltd
Priority to CN202211426708.4A priority Critical patent/CN115658321A/en
Publication of CN115658321A publication Critical patent/CN115658321A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application relates to the technical field of automobile instruments, in particular to an automobile instrument fault information acquisition method, an apparatus, electronic equipment and a storage medium, wherein abnormal field information of a real-time operating system (RTOS) is acquired by utilizing an abnormal interruption mechanism of an automobile instrument MCU, and is prevented from being lost based on the retention characteristic of a Static Random Access Memory (SRAM), a Central Processing Unit (CPU) state register and stack information contained in the abnormal field information are sent to a vehicle machine System On Chip (SOC) through a Serial Peripheral Interface (SPI) bus, so that research personnel can call and analyze the abnormal field information to locate problems, the time for reappearing and troubleshooting is effectively saved, and the quality of instrument software is improved. Whether the CPU state register and the stack information stored in the log cache area in the SRAM need to be sent or not is judged by checking the update mark of the log cache area in the SRAM, and unnecessary occupation of SPI bus load can be avoided.

Description

Automobile instrument fault information acquisition method and device, electronic equipment and storage medium
Technical Field
The application relates to the technical field of automobile instruments, in particular to a method and a device for acquiring fault information of an automobile instrument, electronic equipment and a storage medium.
Background
The automobile instrument consists of various instruments and indicators, in particular to a warning light alarm for a driver and the like, and provides required automobile operation parameter information for the driver. When a problem occurs in the running process of an automobile instrument program, the state of the instrument in the fault is required to be obtained at the first time so as to analyze the problem.
At present, most of the acquisition modes of the MCU logs of the automobile instrument are that a simulator or a serial port is inserted into a circuit board and the MCU logs are acquired in real time through an online tool. However, a Jtag socket (emulator connector) or a serial port socket is left on the mass production instrument, which is challenging to the information security of the product, and generally, a connector which can leak system information is not allowed to be reserved on the mass production instrument, so that the mass production instrument cannot acquire abnormal information of the MCU through an online tool; and the abnormal site can not be kept all the time, so long as the instrument is powered off or restarted, the site information is lost, and the method is very unfavorable for subsequent analysis and positioning problems. In addition, system crash or software abnormity is reproduced in mass production version with extremely low probability, and once field information when abnormity occurs cannot be acquired, a large amount of time cost is consumed for restoring a fault field in a reproduction mode.
Disclosure of Invention
In view of this, an object of the present application is to provide a method, an apparatus, an electronic device, and a storage medium for acquiring vehicle instrument fault information, which can realize acquisition of CPU state information and stack information when a system is abnormal based on retention characteristics of a static random access memory SRAM, and are beneficial to analyzing and locating vehicle instrument problems.
The method for acquiring the fault information of the automobile instrument comprises the following steps:
dividing a static random access memory SRAM in an automobile instrument MCU into log cache areas;
acquiring abnormal field information of a real-time operating system (RTOS) based on an abnormal interruption mechanism of the automobile instrument MCU, and storing the abnormal field information of the RTOS into a log cache region in the SRAM; the RTOS abnormal field information comprises a CPU state register and stack information;
and sending the abnormal field information stored in the SRAM log buffer area to the vehicle SOC based on the SPI bus.
In some embodiments, the static random access memory SRAM in the car meter MCU is partitioned into log buffers as follows:
and modifying a link script file of the MCU of the automobile instrument, dividing a log cache region from the SRAM, and configuring the log cache region into a storage mode so as to enable a storage array of the SRAM not to be powered down and keep data in the log cache region.
In some embodiments, the obtaining of the abnormal field information of the real-time operating system RTOS based on the abnormal interrupt mechanism of the automobile instrument MCU includes:
responding to the abnormity of the automobile instrument MCU, and executing a command for acquiring a CPU state register and stack information;
and acquiring the state register and stack information of the CPU by a stack overflow hook function based on the RTOS to obtain abnormal field information of the RTOS of the real-time operating system.
In some embodiments, after the storing the abnormal field information of the RTOS to the log buffer in the SRAM, the method further includes the following steps:
and setting an update mark for a log cache region in the SRAM.
In some embodiments, the sending the abnormal field information stored in the SRAM log buffer to the vehicle SOC based on the SPI bus includes:
checking an update mark of a log cache region in the SRAM;
if the log cache area in the SRAM has an update mark, analyzing data in the log cache area in the SRAM to obtain a CPU state register and stack information when the automobile instrument MCU is abnormal last time;
and sending the acquired CPU state register and stack information to a vehicle SOC (system on chip) based on an SPI (serial peripheral interface) bus, and clearing an update mark of a log cache region in the SRAM.
In some embodiments, the acquired CPU state register and stack information are sent to an embedded multimedia card of the vehicle SOC based on the SPI bus, and are stored in a log file for retrieving the log file and analyzing, and locating a failure of the vehicle instrument.
In some embodiments, at least a 2K byte area is partitioned from the SRAM as a log buffer.
The utility model provides a motormeter fault information acquisition device, the device includes:
the dividing module is used for dividing a Static Random Access Memory (SRAM) in the automobile instrument MCU into log cache areas;
the acquisition module is used for acquiring abnormal field information of a real-time operating system (RTOS) based on an abnormal interrupt mechanism of the automobile instrument MCU and storing the abnormal field information of the RTOS into a log cache region in the SRAM; the RTOS abnormal field information comprises a CPU state register and stack information;
and the sending module is used for sending the abnormal field information stored in the SRAM log buffer area to the vehicle SOC based on the SPI bus.
The electronic device provided by the embodiment of the application comprises a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, when the electronic device runs, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the method for acquiring the fault information of the automobile instrument comprises the steps of executing any one of the above steps.
The computer-readable storage medium stores thereon a computer program, and the computer program is executed by a processor to perform any one of the steps of the method for acquiring vehicle instrument fault information.
According to the method, the device, the electronic equipment and the storage medium for acquiring the fault information of the automobile instrument, a Static Random Access Memory (SRAM) in an automobile instrument MCU is divided into a log cache region; acquiring abnormal field information of a real-time operating system (RTOS) based on an abnormal interrupt mechanism of the automobile instrument MCU, and storing the abnormal field information of the RTOS into a log cache region in the SRAM; the RTOS abnormal field information comprises a CPU state register and stack information; the abnormal field information stored in the SRAM log buffer area is sent to the vehicle SOC based on the SPI bus, the problems that a vehicle instrument is powered off or restarted and field information is lost are solved, research and development personnel can call and analyze the abnormal field information to locate the problems, the time for recurrence and fault removal is effectively saved, and the quality of instrument software is improved.
In some embodiments, whether to send the CPU status register and stack information stored in the log cache area in the SRAM is determined by checking the update flag of the log cache area in the SRAM, thereby avoiding occupying the load of the SPI bus.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
FIG. 1 is a flow chart illustrating a method for acquiring failure information of a vehicle instrument according to an embodiment of the present application;
fig. 2 shows a connection block diagram of the vehicle on-board unit SOC and an automobile instrument MCU provided in the embodiment of the present application;
fig. 3 shows a flowchart for acquiring abnormal field information of a real-time operating system RTOS based on an abnormal interrupt mechanism of the automobile instrument MCU according to the embodiment of the present application;
fig. 4 shows a flowchart for sending the abnormal field information stored in the SRAM log buffer to the vehicle SOC based on the SPI bus according to the embodiment of the present application;
fig. 5 shows a schematic diagram of a log file saved by the vehicle SOC provided in the embodiment of the present application;
fig. 6 shows a block diagram of a structure of an apparatus for acquiring failure information of a vehicle instrument provided in an embodiment of the present application;
fig. 7 shows a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for illustrative and descriptive purposes only and are not used to limit the scope of protection of the present application. Additionally, it should be understood that the schematic drawings are not necessarily drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be performed out of order, and steps without logical context may be performed in reverse order or simultaneously. One skilled in the art, under the guidance of this application, may add one or more other operations to, or remove one or more operations from, the flowchart.
In addition, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of embodiments of the present application, generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that in the embodiments of the present application, the term "comprising" is used to indicate the presence of the features stated hereinafter, but does not exclude the addition of further features.
Along with the popularization and development of vehicles, the functions of the automobile instrument are more and more abundant, the structure and the system are more and more complex, the probability of faults in the operation process is gradually increased, the problem of difficult positioning is solved if the fault information of the automobile instrument cannot be obtained, and the potential safety hazard is caused. Although fault information of the automobile instrument can be acquired in a log mode in the prior art, if a system is crashed or application logic is deadlocked, the log sending thread cannot send abnormal field information to the automobile machine, and the current log acquiring means does not acquire information of a CPU state register and a stack, and the information locates key information of the problem of the automobile instrument. Based on the method, the device, the electronic equipment and the storage medium, the method, the device, the electronic equipment and the storage medium for acquiring the fault information of the automobile instrument can be used for acquiring the state information of the CPU and the stack information when the system is abnormal based on the retention characteristic of the Static Random Access Memory (SRAM), and are beneficial to analyzing and positioning the automobile instrument.
Referring to the accompanying drawing 1 of the specification, an embodiment of the present application provides a method for acquiring failure information of an automobile instrument, where the method includes the following steps:
s1, dividing a Static Random Access Memory (SRAM) in an automobile instrument MCU into log cache areas;
in order to clearly understand the technical solution of the embodiment of the present invention, an application scenario may be exemplarily described. The automobile instrument is independent of a vehicle machine SOC (System on Chip System on Chip), but an SPI bus for data transmission is arranged between an automobile instrument MCU (Microcontroller Unit) and the vehicle machine SOC, and in the application, field abnormal information stored in the SRAM when the automobile instrument breaks down is mainly sent to the vehicle machine SOC through the SPI bus. Specifically, the connection relationship between the vehicle SOC and the car instrument MCU is shown in fig. 2, wherein for the hardware portion, both the vehicle SOC and the car instrument MCU are provided with SPI controllers, the car instrument MCU is provided with an SRAM (Static Random-Access Memory), and the vehicle SOC is provided with a storage device and a 4G/5G communication module connected thereto; for the software part, the car instrument MCU is installed with an SPI controller driver and an RTOS (Real Time Operating System) and a log thread to be executed, and the car machine SOC is installed with an Android System bottom driver and an Android System and a log module.
Based on the hardware part and the software part configured by the vehicle SOC and the MCU, it is fully possible to send the field abnormal information stored in the SRAM to the vehicle SOC in the form of log when the vehicle has a fault.
In step S1, the SRAM is one of random access memories, and the term "static" means that the data stored in the DRAM can be constantly maintained as long as the memory is powered on, whereas the data stored in the DRAM needs to be periodically updated. In the method, a log cache region is divided from an SRAM (static random access memory) by modifying a link script file of an MCU (microprogrammed control unit) of the automobile instrument, and the log cache region is configured into a storage mode, so that a storage array of the SRAM is not powered down, and data in the log cache region is kept.
In one embodiment, at least a 2K byte area is divided from the SRAM to be used as a log cache area for subsequently storing field abnormal information when the automobile instrument has a fault. In other embodiments, the size of the log cache area partitioned from the SRAM may be set according to actual needs, and this is limited and fixed in the present application.
S2, acquiring abnormal field information of a real-time operating system (RTOS) based on an abnormal interrupt mechanism of the automobile instrument MCU, and storing the abnormal field information of the RTOS into a log cache region in the SRAM; the abnormal field information of the RTOS comprises a CPU state register and stack information;
in step S2, the abnormal interruption mechanism of the automobile instrument MCU means that when an abnormality (some abnormal state or some system event) occurs during the program running process, the automobile instrument MCU executes some preset commands with higher execution rights, so that the system runs smoothly, and returns to the site where the abnormality occurs after the commands with higher execution rights are executed. In the present application, by setting in advance, the command having the higher execution right is set to: and acquiring abnormal field information of the RTOS, namely CPU state register and stack information.
In an embodiment, referring to fig. 3 of the specification, the obtaining of the abnormal field information of the real-time operating system RTOS based on the abnormal interrupt mechanism of the automobile instrument MCU includes the following steps:
s201, responding to the abnormity of the automobile instrument MCU, and executing a command for acquiring a CPU state register and stack information;
s202, acquiring a CPU state register and stack information based on a stack overflow hook function of the RTOS, and acquiring abnormal field information of the RTOS of the real-time operating system;
in the embodiment, when the MCU is abnormal, the command for acquiring the current CPU state register and stack information is immediately executed, and the command for acquiring the current CPU state register and stack information is the trigger condition of the hook function, the CPU state register and stack information are acquired, and the abnormal field information of the RTOS of the real-time operating system is further acquired, and the acquired abnormal field information of the RTOS is stored in the log cache area in the SRAM. For example, when the real-time operating system RTOS running on the car instrument MCU detects an abnormality or a system crash, field information of the current processor operation is immediately saved to a log buffer area in the SRAM, such as a PC (general purpose register) pointer, an LR register, a stack pointer, and the like.
And S3, sending the abnormal field information stored in the SRAM log buffer area to a vehicle SOC (system on chip) based on the SPI bus.
Namely, after the CPU state register and the stack information are acquired when the MCU of the automobile instrument is abnormal based on the retention characteristic of the SRAM, the abnormal field information stored in the SRAM log buffer area is sent to the SOC of the automobile machine through the SPI bus. Because the abnormal phenomena of the automobile instrument belong to a few phenomena, if the automobile instrument is restarted every time, the abnormal field information in the SRAM log buffer area is directly sent to the vehicle SOC, unnecessary occupation of the SPI bus load is certainly caused, and after all, the abnormal field information in the SRAM log buffer area can be long-term before. Based on this, in the present application, in order to avoid over occupying the SPI bus load, after the abnormal field information of the RTOS is stored in the log cache area in the SRAM, an update flag is also set to the log cache area in the SRAM.
In an embodiment, referring to fig. 4 of the specification, the sending the abnormal field information stored in the SRAM log buffer to the vehicle SOC based on the SPI bus includes the following steps:
s301, checking an update mark of a log cache region in the SRAM;
s302, if the log cache area in the SRAM has an update mark, analyzing data in the log cache area in the SRAM, and acquiring a CPU state register and stack information when the automobile instrument MCU is abnormal last time;
s303, sending the acquired CPU state register and stack information to a vehicle SOC (system on chip) based on an SPI (serial peripheral interface) bus, and clearing an update mark of a log cache region in the SRAM.
After the automobile instrument is restarted, checking an update mark of a log cache area in the SRAM, if the update mark exists, indicating that an MCU (micro control unit) of the automobile instrument is abnormal in the last running process and storing a current CPU (central processing unit) state register and stack information, sending the update mark to the SOC (system on chip) of the automobile instrument through an SPI (serial peripheral interface) bus, and clearing the update mark of the log cache area in the SRAM so as to avoid repeatedly sending data of the log cache area in the SRAM through the SPI bus after the automobile instrument is restarted next time; and if the automobile instrument is restarted, it is verified that the log cache area in the SRAM does not have the updating mark, the vehicle works normally, and the SPI bus load is not occupied to process abnormity.
And sending the acquired CPU state register and stack information to an embedded multimedia card of the vehicle SOC based on an SPI bus, storing the information in a log file mode, calling the log file at a later stage, analyzing the log file, and positioning the faults of the automobile instrument. In one embodiment, the log is a text file, and can be called through a 4G/5G communication module or a USB interface via the vehicle SOC, and then opened with a notepad to view the content. For example, referring to fig. 5 in the specification, the content of the log file obtained by the vehicle SOC is as follows:
RFault:0xf7f8f9fa,RO:0xa5a5a5a5
R1:0x60000000,R2:0x280421e4
R3:0x2,R12:0xa
LR:0x10508737,PC:0x104e066e
Psr:0x1000000,cfsr:0x400
FaultType:0xa1a2a3a4
based on the log file information and the decompilation of the meter software, it can quickly be located that the exception is a hard fault exception that was generated by accessing an illegal memory address.
The method for acquiring the fault information of the automobile instrument comprises the steps of acquiring abnormal field information of a real-time operating system (RTOS) by utilizing an abnormal interruption mechanism of an automobile instrument MCU, avoiding the loss of the abnormal field information based on the retention characteristic of a Static Random Access Memory (SRAM), sending a Central Processing Unit (CPU) state register and stack information contained in the abnormal field information to a vehicle on-board computer (SOC) through a Serial Peripheral Interface (SPI) bus, and further facilitating research and development personnel to call and analyze the abnormal field information so as to locate problems, effectively saving the time for recurrence and fault removal, and improving the quality of instrument software. Whether the CPU state register and stack information stored in the log cache area in the SRAM are to be sent or not is judged by checking the update mark of the log cache area in the SRAM, and unnecessary occupation of SPI bus load can be avoided.
Based on the same inventive concept, the embodiment of the present application further provides a device for acquiring failure information of an automobile instrument, and as the principle of solving the problem of the device in the embodiment of the present application is similar to that of the method for acquiring failure information of an automobile instrument in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts are not described again.
As shown in the accompanying fig. 6 of the specification, the present application further provides an apparatus for acquiring failure information of an automobile instrument, the apparatus including:
the dividing module 601 is used for dividing a static random access memory SRAM in an automobile instrument MCU into log cache areas;
an obtaining module 602, configured to obtain abnormal field information of an RTOS (real time operating system) of a real-time operating system based on an abnormal interrupt mechanism of the MCU of the automobile instrument, and store the abnormal field information of the RTOS in a log cache area in the SRAM; the RTOS abnormal field information comprises a CPU state register and stack information;
and a sending module 603, configured to send the abnormal field information stored in the SRAM log buffer to the vehicle SOC based on the SPI bus.
In some embodiments, the dividing module 601 modifies a link script file of an MCU, divides a log buffer from an SRAM, and configures the log buffer into a save mode, so that a storage array of the SRAM is not powered down and data in the log buffer is maintained.
In some embodiments, the partitioning module 601 partitions at least a 2 kbyte region from the SRAM as a log buffer.
In some embodiments, the obtaining module 602 obtains the abnormal field information of the real-time operating system RTOS based on an abnormal interruption mechanism of the car instrument MCU, including:
responding to the abnormity of the automobile instrument MCU, and executing a command for acquiring a CPU state register and stack information;
and acquiring the state register and stack information of the CPU based on a stack overflow hook function of the RTOS to obtain abnormal field information of the RTOS of the real-time operating system.
In some embodiments, after the obtaining module 602 stores the abnormal field information of the RTOS in a log buffer in the SRAM, the method further includes:
and setting an update mark for a log cache region in the SRAM.
In some embodiments, the sending module 603 sends the abnormal field information stored in the SRAM log buffer to the vehicle SOC based on an SPI bus, including:
checking an update mark of a log cache region in the SRAM;
if the log cache area in the SRAM has an update mark, analyzing data in the log cache area in the SRAM, and acquiring a CPU state register and stack information when the automobile instrument MCU is abnormal last time;
and sending the acquired CPU state register and stack information to a vehicle SOC (system on chip) based on an SPI (serial peripheral interface) bus, and clearing an update mark of a log cache region in the SRAM.
In some embodiments, the sending module 603 sends the acquired CPU status register and stack information to an embedded multimedia card of the vehicle SOC based on the SPI bus, and stores the information in a log file for retrieving the log file and analyzing the log file to locate the failure of the vehicle instrument.
According to the automobile instrument fault information acquisition device, a Static Random Access Memory (SRAM) in an automobile instrument MCU is divided into a log cache region through a dividing module; acquiring abnormal field information of a real-time operating system (RTOS) through an acquisition module based on an abnormal interrupt mechanism of the automobile instrument MCU, and storing the abnormal field information of the RTOS into a log cache region in the SRAM; the RTOS abnormal field information comprises a CPU state register and stack information; the abnormal field information stored in the SRAM log buffer area is sent to the vehicle SOC through the sending module based on the SPI bus, the problems that a vehicle instrument is powered off or restarted and the field information is lost are solved, research and development personnel can call and analyze the abnormal field information to locate the problem, the time for recurrence and fault removal is effectively saved, and the instrument software quality is improved. In some embodiments, the sending module checks the update flag of the log cache area in the SRAM to determine whether to send the CPU status register and stack information stored in the log cache area in the SRAM, thereby avoiding occupying a load of the SPI bus.
Based on the same concept of the present invention, as shown in fig. 7 in the specification, an embodiment of the present application provides a structure of an electronic device 700, where the electronic device 700 includes: at least one processor 701, at least one network interface 704 or other user interface 703, memory 705, and at least one communication bus 702. A communication bus 702 is used to enable connective communication between these components. The electronic device 700 optionally contains a user interface 703 including a display (e.g., touchscreen, LCD, CRT, holographic (Holographic) or projection (Projector), etc.), a keyboard or a pointing device (e.g., mouse, trackball (trackball), touch pad or touchscreen, etc.).
Memory 705 may include both read-only memory and random access memory, and provides instructions and data to processor 701. A portion of the memory 705 may also include non-volatile random access memory (NVRAM).
In some embodiments, memory 705 stores the following elements, protectable modules or data structures, or a subset thereof, or an expanded set thereof:
an operating system 7051, which contains various system programs for implementing various basic services and for processing hardware-based tasks;
the application module 7052 contains various applications, such as a desktop (launcher), a Media Player (Media Player), a Browser (Browser), and the like, for implementing various application services.
In the embodiment of the present application, by calling a program or an instruction stored in the memory 705, the processor 701 is configured to execute steps in a method for acquiring failure information of an automobile instrument, and can realize acquisition of CPU state information and stack information when a system is abnormal based on retention characteristics of a static random access memory SRAM, which is beneficial to analysis and positioning of problems of an automobile instrument.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps as in the motormeter failure information acquisition method.
Specifically, the storage medium can be a general-purpose storage medium, such as a removable disk, a hard disk, or the like, and when a computer program on the storage medium is executed, the above-mentioned method for acquiring failure information of a vehicle instrument can be executed.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, a division of a unit is merely a division of one logic function, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and various media capable of storing program codes.
Finally, it should be noted that: the above examples are only specific embodiments of the present application, and are not intended to limit the technical solutions of the present application, and the scope of the present application is not limited thereto, although the present application is described in detail with reference to the foregoing examples, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the present disclosure, which should be construed in light of the above teachings. Are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method for acquiring fault information of an automobile instrument is characterized by comprising the following steps:
dividing a static random access memory SRAM in an automobile instrument MCU into log cache areas;
acquiring abnormal field information of a real-time operating system (RTOS) based on an abnormal interruption mechanism of the automobile instrument MCU, and storing the abnormal field information of the RTOS into a log cache region in the SRAM; the RTOS abnormal field information comprises a CPU state register and stack information;
and sending the abnormal field information stored in the SRAM log buffer area to the vehicle SOC based on the SPI bus.
2. The method for acquiring the fault information of the automobile instrument as claimed in claim 1, wherein the static random access memory SRAM in the automobile instrument MCU is partitioned into log buffers as follows:
and modifying a link script file of the MCU of the automobile instrument, dividing a log cache region from the SRAM, and configuring the log cache region into a storage mode so as to enable a storage array of the SRAM not to be powered down and keep data in the log cache region.
3. The method for acquiring the fault information of the automobile instrument as claimed in claim 2, wherein the acquiring of the abnormal site information of the real-time operating system RTOS based on the abnormal interrupt mechanism of the automobile instrument MCU comprises the following steps:
responding to the abnormity of the automobile instrument MCU, and executing a command for acquiring a CPU state register and stack information;
and acquiring the state register and stack information of the CPU by a stack overflow hook function based on the RTOS to obtain abnormal field information of the RTOS of the real-time operating system.
4. The method for acquiring the vehicle instrument fault information according to claim 2, wherein after the abnormal field information of the RTOS is stored in a log buffer area in the SRAM, the method further comprises the following steps:
and setting an update mark for a log cache region in the SRAM.
5. The method for acquiring the vehicle instrument fault information according to claim 4, wherein the step of sending the abnormal field information stored in the SRAM log buffer to a vehicle SOC based on an SPI bus comprises the following steps:
checking an update mark of a log cache region in the SRAM;
if the log cache area in the SRAM has an update mark, analyzing data in the log cache area in the SRAM to obtain a CPU state register and stack information when the automobile instrument MCU is abnormal last time;
and sending the acquired CPU state register and stack information to a vehicle SOC (system on chip) based on an SPI (serial peripheral interface) bus, and clearing an update mark of a log cache region in the SRAM.
6. The method for acquiring the automobile instrument fault information according to claim 5, wherein the acquired CPU state register and stack information are sent to an embedded multimedia card of a vehicle SOC (system on chip) based on an SPI (serial peripheral interface) bus, and are stored in a log file manner, so that the log file is called and analyzed, and the automobile instrument fault is positioned.
7. The method of claim 6, wherein at least a 2 kbyte area is divided from the SRAM as a log buffer.
8. An automobile instrument failure information acquisition device, characterized in that the device comprises:
the dividing module is used for dividing a static random access memory SRAM in the automobile instrument MCU into a log cache region;
the acquisition module is used for acquiring abnormal field information of a real-time operating system (RTOS) based on an abnormal interrupt mechanism of the automobile instrument MCU and storing the abnormal field information of the RTOS into a log cache region in the SRAM; the RTOS abnormal field information comprises a CPU state register and stack information;
and the sending module is used for sending the abnormal field information stored in the SRAM log buffer area to the vehicle SOC based on the SPI bus.
9. An electronic device, comprising a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, the processor and the memory communicate via the bus when the electronic device is running, and the machine-readable instructions are executed by the processor to perform the steps of the method for obtaining failure information of an automobile instrument according to any one of claims 1 to 7.
10. A computer-readable storage medium characterized by: the computer readable storage medium has a computer program stored thereon, which when executed by a processor performs the steps of the motormeter failure information acquisition method according to any one of claims 1 to 7.
CN202211426708.4A 2022-11-15 2022-11-15 Method and device for acquiring fault information of automobile instrument, electronic equipment and storage medium Pending CN115658321A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211426708.4A CN115658321A (en) 2022-11-15 2022-11-15 Method and device for acquiring fault information of automobile instrument, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211426708.4A CN115658321A (en) 2022-11-15 2022-11-15 Method and device for acquiring fault information of automobile instrument, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115658321A true CN115658321A (en) 2023-01-31

Family

ID=85020881

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211426708.4A Pending CN115658321A (en) 2022-11-15 2022-11-15 Method and device for acquiring fault information of automobile instrument, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115658321A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115993996A (en) * 2023-03-22 2023-04-21 南京芯驰半导体科技有限公司 Method and system for realizing sleep mode based on RTOS
CN116820898A (en) * 2023-08-31 2023-09-29 合肥康芯威存储技术有限公司 Method and system for monitoring running state of eMMC and computer readable storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115993996A (en) * 2023-03-22 2023-04-21 南京芯驰半导体科技有限公司 Method and system for realizing sleep mode based on RTOS
CN116820898A (en) * 2023-08-31 2023-09-29 合肥康芯威存储技术有限公司 Method and system for monitoring running state of eMMC and computer readable storage medium
CN116820898B (en) * 2023-08-31 2024-01-02 合肥康芯威存储技术有限公司 Method and system for monitoring running state of eMMC and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN115658321A (en) Method and device for acquiring fault information of automobile instrument, electronic equipment and storage medium
CN108874624B (en) Server, method for monitoring Java process and storage medium
US9262283B2 (en) Method for reading kernel log upon kernel panic in operating system
US20020073400A1 (en) Method for monitoring a program execution using a debug logic
CN105723348A (en) Detection of unauthorized memory modification and access using transactional memory
CN113064748A (en) Process succession method, device, electronic equipment and storage medium
EP3769222B1 (en) Testing kernel mode computer code by executing the computer code in user mode
Seo et al. A profiling method by PCB hooking and its application for memory fault detection in embedded system operational test
CN111475356A (en) System startup test information display method and related device
CN116225541A (en) Method and system for communication between in-band CPU and out-of-band management BMC
JP4558376B2 (en) controller
CN115292077A (en) Kernel exception handling method and system
US20100077383A1 (en) Simulation method and storage medium for storing program
CN113849230A (en) Server starting method and device, electronic equipment and readable storage medium
CN112416695B (en) Global variable monitoring method, device, equipment and storage medium
KR20070089399A (en) Method for booting control of digital store apparatus
CN116051352A (en) Method and system for actively acquiring GPU temperature through BMC
CN117827547A (en) Method and system for recovering touch abnormality of vehicle-mounted display screen, electronic equipment and medium
CN114327648B (en) Driving debugging method and device, electronic equipment and storage medium
US11567751B2 (en) Providing system updates in automotive contexts
CN111176735B (en) Method for accelerating startup of electrocardiograph
CN115421952A (en) Method, system, electronic device and storage medium for preventing automobile software system from crashing
CN117873771B (en) System downtime processing method, device, equipment, storage medium and server
EP3989075B1 (en) On-board secure storage system
JP7172155B2 (en) Electronic control device and software generation method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20231102

Address after: 401120 Building 2, No. 81, Tonggui Avenue, Yufengshan Town, Yubei District, Chongqing

Applicant after: Beidou Xingtong Zhilian Technology Co.,Ltd.

Applicant after: Beidou Xingtong Zhilian Technology (Nanjing) Co.,Ltd.

Address before: 401120 No.3, Tonggui Avenue, Yufengshan Town, Yubei District, Chongqing

Applicant before: Beidou Xingtong Zhilian Technology Co.,Ltd.

TA01 Transfer of patent application right