Error tracking method of embedded system and device thereof

An embedded system and error tracking technology, applied in the field of error tracking methods and devices of embedded systems, can solve problems such as system stability impact, system crash, ineffective and timely system debugging and recovery, etc., to protect memory pages, Improved stability and reliability effects

Active Publication Date: 2009-09-23
BEIJING HOLLYSYS
View PDF0 Cites 52 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0002] In the field of industrial control, with the rapid development of my country's economy and the deepening of automation applications in electric power, chemical industry, energy and other fields, in addition to the performance and function requirements of the automation control system, more requirements are placed on the reliability of the embedded software system. Strict requirements, in the field where the industrial control system is implemented or in the research and development stage of the system, due to design defects during the operation of the application program, many errors and exceptions will occur, resulting in system crashes and resets
[0003] In the current existing embedded software system, when an error occurs in the system, the on-site information can be saved, and the address of the command that caused the system error to be found can be found for query and recovery; however, in some cases, the There is no error in the instruction of the computer itself, and the source of the error lies in other instructions related to this instruction and executed before; and when there are many instruction codes, multi-layer calls and multi-way branches, it will become difficult to find the source of the error. It is a complex and time-consuming work, so after the system goes down, the system cannot be debugged and restored effectively and in a timely manner, which has a relatively large impact on system stability and

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Error tracking method of embedded system and device thereof
  • Error tracking method of embedded system and device thereof
  • Error tracking method of embedded system and device thereof

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0051] Embodiment 1, an error tracking method for an embedded system, comprising:

[0052] When an exception occurs in the system, save the processor operating environment, and find the stack frame of the currently running function according to the frame pointer;

[0053] Repeat the following steps until the entire function call relationship chain that runs when an exception occurs in the system is traced back:

[0054] From the found stack frame, obtain the register information saved when the function to which the stack frame belongs begins to execute, and the function parameter information, as well as the starting address of the function code, and further obtain the name of the function, and obtain the function that calls the function The bottom of the stack frame; the stack frame of the function calling the function is found through the bottom of the stack frame.

[0055] In this embodiment, the method is as figure 1 As shown, it specifically includes the following steps:...

Embodiment 2

[0070] Embodiment 2, an error tracking device for an embedded system, such as figure 2 shown, including:

[0071] The exception handling unit is used to obtain and save the processor operating environment when an exception occurs in the system;

[0072] The stack frame backtracking unit is used to find the stack frame of the currently running function according to the frame pointer when the system is abnormal; and then repeat the following steps until the entire function call relationship chain running when the system is abnormal is traced back:

[0073] From the found stack frame, obtain the register information saved when the function to which the stack frame belongs begins to execute, and the function parameter information, as well as the starting address of the function code, and further obtain the name of the function, and obtain the function that calls the function The bottom of the stack frame; find the stack frame of the function that calls the function through the b...

Embodiment 3

[0088] Embodiment 3, a specific example of error tracking.

[0089] Such as image 3 As shown, after the system is powered on, the hardware device environment and software resources are initialized, and the access attributes of each memory area are set through the mmu, such as read-only, read-write, etc. After that, the application program starts to run. If the operating system supports it, the application program will schedule the function to run in the thread mode; if not, the application program will execute in the function call mode.

[0090] In this example, the memory area where the memory 0x0 is located is pre-set as a read-only attribute, so that the following content in the application program will cause a data access abort exception because there is no write permission:

[0091] unsigned int x = 0; / / global variable

[0092] int func1(unsigned int*c)

[0093] {

[0094] int d = 0;

[0095] *(unsigned int*)c=0x100;

[0096] d=*(unsigned int*)c;

[0097] return ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses an error tracking method of an embedded system and a device thereof. When system exception occurs, the operation environment of a processor is stored and a frame point is used for finding out a stack frame of a currently operated function; the following steps are repeated until an integral function calling relationship chain which is operated when the system exception occurs is backtracked: register information which is stored when a function to which the stack frame belongs begins to operate, function parameter information, initial address of function code and function name are acquired from the found stack frame; function stack frame bottom which calls the function is acquired; and the stack frame bottom is used for finding out the function stack frame which calls the function. In the technical scheme of the invention, the order and the function which are corresponding to the error can be positioned rapidly when system exception occurs; therefore, the technical scheme is applicable to a software system no matter whether operation system support exists; when a plurality of function calling branches exist, the method finds out the calling route of the currently operated function with error rapidly, thereby improving tracking efficiency.

Description

technical field [0001] The invention relates to an embedded system, in particular to an error tracking method and device for an embedded system. Background technique [0002] In the field of industrial control, with the rapid development of my country's economy and the deepening of automation applications in electric power, chemical industry, energy and other fields, in addition to the performance and function requirements of the automation control system, more requirements are placed on the reliability of the embedded software system. Strict requirements, on-site implementation of the industrial control system or in the development stage of the system, due to design defects during the operation of the application program, many errors and exceptions will occur, resulting in system crashes and resets. [0003] In the current existing embedded software system, when an error occurs in the system, the on-site information can be saved, and the address of the command that caused th...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F11/36
Inventor 刘小树傅一帆张冰波刘跃刘谦王衍
Owner BEIJING HOLLYSYS
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products