A memory dump fault diagnosis method based on embedded system

By implementing memory address access and initialization in different startup modes in embedded systems, and using memory DUMP to record and output debugging information, the problem of flexibility and complexity of memory DUMP fault diagnosis in localized substitution and cross-platform development is solved, providing It provides a simple and efficient fault diagnosis method, suitable for early debugging and debugging of new processor platforms.

CN115098288BActive Publication Date: 2024-09-10BEIJING BLX IC DESIGN CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210725049.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-23
Publication Date
2024-09-10
Estimated Expiration
2042-06-23

AI Technical Summary

Technical Problem

In the process of localization replacement and cross-platform development, the existing memory DUMP fault diagnosis method is not flexible enough, complex to operate, and requires multiple technical reserves. Moreover, the JTAG interface of the embedded system is not standard, and the modularly designed board is not easy to debug. Occasional failures are difficult to reproduce.

Method used

By arranging an embedded microprocessor, dynamic random access memory, RESET button, startup mode selection switch, NAND FLASH memory and SPI FLASH memory on the PCB board, memory address access and initialization in different startup modes are realized, and memory DUMP records are used and output debugging information for fault diagnosis.

Benefits of technology

It provides a reasonable, simple and efficient fault diagnosis method, which is suitable for cross-platform development and early debugging. It can perform fault analysis without relying on external debugging interfaces, and simplifies the debugging process of new processor platforms.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

The invention discloses a memory dump fault diagnosis method based on an embedded system, and relates to the field of memory dump fault diagnosis. The memory dump fault diagnosis method based on an embedded system comprises the following steps: S1: preparation step: firstly, a PCB board is selected, and then an embedded microprocessor, a dynamic random access memory, a RESET reset button, a startup mode selection switch, a NAND FLASH memory, a SPI FLASH memory and a debugging serial port are arranged on the PCB board. The invention does not rely on other debugging interfaces, and does not need a debugger. For an embedded system that crashes unexpectedly after running for a long time, the DUMP response debugging information can be output to perform fault diagnosis and analysis. When developing a solution for a new processor platform, it is not necessary to be constrained by the constraints of debugging equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of memory DUMP fault diagnosis, in particular to a memory DUMP fault diagnosis method based on an embedded system. Background Art

[0002] There are many ways to debug embedded systems. Generally speaking, embedded microprocessors have JTAG interfaces, and the debugger can be used to test the chip and burn the FLASH. If the embedded system has been debugged and the debug serial port or network port in the peripheral hardware device has been successfully driven, there are more debugging methods. The most common method is to print the debug output information directly to the debug serial port to complete the tracking and fault analysis of the embedded software. Some high-speed processors can use the memory DUMP method to print out a key section of memory and analyze faults and performance by identifying core data. The above debugging methods are more suitable for transformation and design on mature software and hardware system solutions, or for teaching and explanation.

[0003] In recent years, with the increasing maturity of domestic processors, many solutions need to be replaced and transformed by domestic products. At this time, cross-platform development is a development difficulty. When designing and developing micro-modular products or conducting rigorous environmental testing on equipment, the above methods are exposed to defects such as inflexibility and complex operation. Among them, the following defects are particularly prominent. First, on a new processor architecture, a lot of technical reserves are required to fully master its underlying debugging methods. Secondly, embedded systems are generally small in size, and some solutions only reserve the JTAG interface rather than standard configuration. Moreover, the boards with modular design need to be integrated first and then assembled in the chassis. Not every link is easy to connect to the debugging interface. Finally, some faults occur sporadically, and can only be reproduced under long-term baking.

[0004] Therefore, those skilled in the art provide a memory dump fault diagnosis method based on an embedded system to solve the problems raised in the above background technology. Summary of the invention

[0005] The purpose of the present invention is to provide a memory DUMP fault diagnosis method based on an embedded system to solve the problems raised in the above background technology. In recent years, with the increasing maturity of domestic processors, many solutions need to be replaced and modified by domestic products. At this time, cross-platform development is a development difficulty; when designing and developing micro-modular products, or conducting rigorous environmental testing on equipment, the above methods are exposed to defects such as inflexibility and complex operation. Among them, the following defects are particularly prominent. First, on a certain new processor architecture, a lot of technical reserves are required to fully master its underlying debugging methods. Secondly, embedded systems are generally small in size, and some solutions are only reserved for JTAG interfaces, not standard configurations. Moreover, boards with modular design need to be integrated first and then assembled in the chassis. Not every link is convenient for connecting to the debugging interface. Finally, some faults occur sporadically, or even problems that can only be reproduced under long-term baking.

[0006] To achieve the above object, the present invention provides the following technical solutions:

[0007] A memory dump fault diagnosis method based on an embedded system, the method comprising the following steps:

[0008] S1: Preparation steps: First, select a PCB board, and then arrange the embedded microprocessor, dynamic random access memory, RESET reset button, boot mode selection switch, NAND FLASH memory, SPI FLASH memory and debug serial port on the PCB board.

[0009] S2: Equipment installation steps: an embedded microprocessor chip is provided in the embedded microprocessor, the dynamic random access memory DRAM controller of the embedded microprocessor chip is responsible for connecting the dynamic random access memory chip, the reset pin of the embedded microprocessor chip is connected to the external RESET reset button, the startup mode pin of the embedded microprocessor chip is connected to the startup mode selection switch, the NAND FLASH controller of the embedded microprocessor chip is responsible for connecting the NAND FLASH memory chip, the SPI FLASH controller of the embedded microprocessor chip is responsible for connecting the SPI FLASH memory chip, the serial port controller of the embedded microprocessor chip is connected to the debugging serial port, the serial port controller is provided with a serial port console, the debugging serial port is connected to the serial port console, and the SPI FLASH memory is integrated with the serial port controller.

[0010] S3: Equipment startup steps: The startup mode selection switch is installed on the embedded microprocessor. The startup mode selection switch can select the embedded microprocessor chip to start from the NAND FLASH memory and the SPI FLASH memory. The NAND FLASH memory is used to start the memory and a SPI FLASH memory is used to start the memory. The startup mode is changed, and the initialization and memory address access are reasonably performed under different startup modes to achieve the effect of using the memory to record the startup log. The RESET reset button is used to trigger the embedded microprocessor chip to reset with power on.

[0011] S4: Fault diagnosis steps: After the embedded system is ready, first turn the startup mode selection switch to position 1. After the embedded microprocessor is powered on, it fetches instructions from the NAND FLASH memory and runs. At this time, when the running program is compiled, it is necessary to reserve part of the memory from the high address space as a debugging area. The reserved memory size is determined according to the information that needs to be debugged. Then, after the memory controller is initialized, all the memory in the debugging area is cleared to 0. Various programs running thereafter can fill the key debugging and diagnostic information into the debugging area memory address in an orderly manner for recording. When it is necessary to enter the diagnostic mode, that is, when performing fault detection and diagnosis, connect the debugging serial port line under isolation or electrostatic protection, or choose to always connect the debugging serial port line, then switch the startup mode selection switch, turn it to position 0, press the RESET reset button, and the embedded microprocessor will perform a soft reset at this time without powering off. After the reset, the embedded microprocessor will be reset from SPI The FLASH memory fetches instructions and runs. The program running at this time should avoid the memory debugging area address during compilation and linking. The memory initialization code maintains the same configuration as before. The memory address space of the previous debugging area cannot be cleared, occupied, refreshed or rewritten at this time. Then use memory DUMP, and finally compare the actual DUMP information one by one with the relevant manual or formula to conduct fault diagnosis analysis and draw conclusions. The program displays the information filled into the debugging area memory address when it runs for the first time on the debugging serial port. If retesting is required, the startup mode selection switch can be turned back to 1, and then the above steps can be repeated for diagnosis.

[0012] As a preferred embodiment of the present invention: in the preparation step, the dynamic random access memory uses DDR2 SDRAM to store various debugging information, and the embedded microprocessor chip uses an embedded microprocessor that supports more than two startup modes and supports a dynamic random access memory controller, and can optionally support NAND FLASH memory startup and SPI FLASH memory startup.

[0013] As a preferred implementation of the present invention: in the preparation step, the startup mode selection switch is used to switch various startup modes of the embedded microprocessor chip, the NAND FLASH memory is used to store the debugged software, the SPI FLASH memory is used to store the correctly running software that can display DUMP information and store memory DUMP information, supports system reset, integrates a serial port controller, and the debugging serial port is used to display memory DUMP information.

[0014] Compared with the prior art, the present invention has the following beneficial effects:

[0015] The present invention provides a memory dump fault diagnosis method based on an embedded system, which can be adapted to cross-platform development or in the early debugging of embedded systems, operating system transplantation, baking machine experiments, stress tests, integrated tests or field tests, etc., to form a reasonable, feasible, simple and efficient fault diagnosis method. In particular, for finalized products or integrated embedded modules, fault diagnosis can be performed after simple modification, and the implementation is simple. By recording to a specific memory address space during software writing, there is no need to connect an external debugging interface to observe the system operation status, and fault query can be performed only after the method is operated when detection is required. By changing the startup mode and performing reasonable initialization and memory address access under different startup modes, the effect of using memory to record the startup log is achieved. Since the memory is a volatile storage device that loses data after power failure, a RESET button and a startup mode selection switch are also required to cooperate. The memory is used to temporarily store the debugging information of the embedded startup, and DUMP output is performed when needed. It does not rely on other debugging interfaces, and does not require a debugger. For embedded systems that crash unexpectedly after running for a long time, DUMP can be used to output response debugging information for fault diagnosis and analysis. When developing solutions for new processor platforms, there is no need to be constrained by debugging equipment. DETAILED DESCRIPTION

[0016] In an embodiment of the present invention, a memory dump fault diagnosis method based on an embedded system is provided. The memory dump fault diagnosis method based on an embedded system comprises the following steps:

[0017] S1: Preparation steps: First, select a PCB board, and then arrange the embedded microprocessor, dynamic random access memory, RESET reset button, boot mode selection switch, NAND FLASH memory, SPI FLASH memory and debug serial port on the PCB board.

[0018] S2: Equipment installation steps: an embedded microprocessor chip is provided in the embedded microprocessor, the dynamic random access memory DRAM controller of the embedded microprocessor chip is responsible for connecting the dynamic random access memory chip, the reset pin of the embedded microprocessor chip is connected to the external RESET reset button, the startup mode pin of the embedded microprocessor chip is connected to the startup mode selection switch, the NAND FLASH controller of the embedded microprocessor chip is responsible for connecting the NAND FLASH memory chip, the SPI FLASH controller of the embedded microprocessor chip is responsible for connecting the SPI FLASH memory chip, the serial port controller of the embedded microprocessor chip is connected to the debugging serial port, the serial port controller is provided with a serial port console, the debugging serial port is connected to the serial port console, and the SPI FLASH memory is integrated with the serial port controller.

[0019] S3: Equipment startup steps: The startup mode selection switch is installed on the embedded microprocessor. The startup mode selection switch can select the embedded microprocessor chip to start from the NAND FLASH memory and the SPI FLASH memory. The NAND FLASH memory is used to start the memory and a SPI FLASH memory is used to start the memory. The startup mode is changed, and the initialization and memory address access are reasonably performed under different startup modes to achieve the effect of using the memory to record the startup log. The RESET reset button is used to trigger the embedded microprocessor chip to reset with power on.

[0020] S4: Fault diagnosis steps: After the embedded system is ready, first turn the startup mode selection switch to position 1. After the embedded microprocessor is powered on, it fetches instructions from the NAND FLASH memory and runs. At this time, when the running program is compiled, it is necessary to reserve part of the memory from the high address space as a debugging area. The reserved memory size is determined according to the information that needs to be debugged. Then, after the memory controller is initialized, all the memory in the debugging area is cleared to 0. Various programs running thereafter can fill the key debugging and diagnostic information into the debugging area memory address in an orderly manner for recording. When it is necessary to enter the diagnostic mode, that is, when performing fault detection and diagnosis, connect the debugging serial port line under isolation or electrostatic protection, or choose to always connect the debugging serial port line, then switch the startup mode selection switch, turn it to position 0, press the RESET reset button, and the embedded microprocessor will perform a soft reset at this time without powering off. After the reset, the embedded microprocessor will be reset from SPI The FLASH memory fetches instructions and runs. The program running at this time should avoid the memory debugging area address during compilation and linking. The memory initialization code maintains the same configuration as before. The memory address space of the previous debugging area cannot be cleared, occupied, refreshed or rewritten at this time. Then use memory DUMP, and finally compare the actual DUMP information one by one with the relevant manual or formula to conduct fault diagnosis analysis and draw conclusions. The program displays the information filled into the debugging area memory address when it runs for the first time on the debugging serial port. If retesting is required, the startup mode selection switch can be turned back to 1, and then the above steps can be repeated for diagnosis.

[0021] A reasonable, feasible, simple and efficient fault diagnosis method can be formed to adapt to cross-platform development or early debugging of embedded systems, operating system transplantation, baking experiments, stress testing, integration testing or field testing. In particular, for finalized products or integrated embedded modules, fault diagnosis can be performed after simple modification. The implementation is simple and can be recorded in a specific memory address space when the software is written. There is no need to connect an external debugging interface to observe the system operation status. Fault query can be performed only after following this method when detection is needed.

[0022] In the preparation step, the dynamic random access memory uses DDR2 SDRAM to store various debugging information. The embedded microprocessor chip uses an embedded microprocessor that supports more than two startup modes and supports a dynamic random access memory controller. It can be selected to support NAND FLASH memory startup and SPI FLASH memory startup. The startup mode selection switch is used to switch various startup modes of the embedded microprocessor chip. The NAND FLASH memory is used to store the debugged software, and the SPI FLASH memory is used to store the correctly running software that can display DUMP information and store memory DUMP information. It supports system reset and integrates a serial port controller. The debugging serial port is used to display memory DUMP information.

[0023] By changing the startup mode and performing reasonable initialization and memory address access under different startup modes, the effect of using memory to record the startup log can be achieved. Since the memory is a volatile storage device that loses data after power failure, a RESET button and a startup mode selection switch are also required to cooperate. The memory is used to temporarily store the debugging information of the embedded startup, and DUMP output is performed when needed. It does not rely on other debugging interfaces, and does not require a debugger. For embedded systems that unexpectedly freeze after running for a long time, the response debugging information can be output through DUMP for fault diagnosis and analysis. When developing solutions for new processor platforms, there is no need to be constrained by debugging equipment.

[0024] The working principle of the present invention is: the method for diagnosing memory dump faults based on the embedded system comprises the following steps:

[0025] S1: Preparation step: First, select a PCB board, and then arrange the embedded microprocessor, dynamic random access memory, RESET reset button, startup mode selection switch, NAND FLASH memory, SPI FLASH memory and debugging serial port on the PCB board. In the preparation step, the dynamic random access memory uses DDR2 SDRAM to store various debugging information, and the embedded microprocessor chip uses an embedded microprocessor that supports more than two startup modes and supports dynamic random access memory controller. It can choose to support NAND FLASH memory startup and SPI FLASH memory startup. The startup mode selection switch is used to switch various startup modes of the embedded microprocessor chip, the NAND FLASH memory is used to store the debugged software, the SPI FLASH memory is used to store the correct running software that can display DUMP information and store memory DUMP information, support system reset, integrate the serial port controller, and the debugging serial port is used to display memory DUMP information.

[0026] S2: Equipment installation steps: an embedded microprocessor chip is provided in the embedded microprocessor, the dynamic random access memory DRAM controller of the embedded microprocessor chip is responsible for connecting the dynamic random access memory chip, the reset pin of the embedded microprocessor chip is connected to the external RESET reset button, the startup mode pin of the embedded microprocessor chip is connected to the startup mode selection switch, the NAND FLASH controller of the embedded microprocessor chip is responsible for connecting the NAND FLASH memory chip, the SPI FLASH controller of the embedded microprocessor chip is responsible for connecting the SPI FLASH memory chip, the serial port controller of the embedded microprocessor chip is connected to the debugging serial port, the serial port controller is provided with a serial port console, the debugging serial port is connected to the serial port console, and the SPI FLASH memory is integrated with the serial port controller.

[0027] S3: Equipment startup steps: The startup mode selection switch is installed on the embedded microprocessor. The startup mode selection switch can select the embedded microprocessor chip to start from the NAND FLASH memory and the SPI FLASH memory. The NAND FLASH memory is used to start the memory and a SPI FLASH memory is used to start the memory. The startup mode is changed, and the initialization and memory address access are reasonably performed under different startup modes to achieve the effect of using the memory to record the startup log. The RESET reset button is used to trigger the embedded microprocessor chip to reset with power on.

[0028] S4: Fault diagnosis steps: After the embedded system is ready, first turn the startup mode selection switch to position 1. After the embedded microprocessor is powered on, it fetches instructions from the NAND FLASH memory and runs. At this time, when the running program is compiled, it is necessary to reserve part of the memory from the high address space as a debugging area. The reserved memory size is determined according to the information that needs to be debugged. Then, after the memory controller is initialized, all the memory in the debugging area is cleared to 0. Various programs running thereafter can fill the key debugging and diagnostic information into the debugging area memory address in an orderly manner for recording. When it is necessary to enter the diagnostic mode, that is, when performing fault detection and diagnosis, connect the debugging serial port line under isolation or electrostatic protection, or choose to always connect the debugging serial port line, then switch the startup mode selection switch, turn it to position 0, press the RESET reset button, and the embedded microprocessor will perform a soft reset at this time without powering off. After the reset, the embedded microprocessor will be reset from SPI The FLASH memory fetches instructions and runs. The program running at this time should avoid the memory debugging area address during compilation and linking. The memory initialization code maintains the same configuration as before. The memory address space of the previous debugging area cannot be cleared, occupied, refreshed or rewritten at this time. Then use memory DUMP, and finally compare the actual DUMP information one by one with the relevant manual or formula to conduct fault diagnosis analysis and draw conclusions. The program displays the information filled into the debugging area memory address when it runs for the first time on the debugging serial port. If retesting is required, the startup mode selection switch can be turned back to 1, and then the above steps can be repeated for diagnosis.

[0029] A reasonable, feasible, simple and efficient fault diagnosis method is formed to adapt to cross-platform development or in the early debugging of embedded systems, operating system transplantation, baking machine experiments, stress testing, integration testing or field testing. In particular, for products that have been finalized or integrated embedded modules, fault diagnosis can be performed after simple modification, and the implementation is simple. By recording to a specific memory address space when the software is written, there is no need to connect an external debugging interface to observe the system operation status. Fault query is performed only after the method is operated when detection is required. By changing the startup mode and reasonably initializing and accessing the memory address under different startup modes, the effect of using the memory to record the startup log is achieved. Since the memory is a volatile storage device that loses data after power failure, a RESET reset button and a startup mode selection switch are also required to cooperate. The debugging information of the embedded startup is temporarily stored in the memory, and DUMP output is performed when necessary. It does not rely on other debugging interfaces, and does not need a debugger. For embedded systems that crash unexpectedly after long-term operation, the response debugging information can be output through DUMP to perform fault diagnosis and analysis. When developing solutions for new processor platforms, there is no need to be constrained by debugging equipment.

[0030] What is described above is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A memory dump fault diagnosis method based on an embedded system, characterized in that: The method for memory dump fault diagnosis based on embedded system comprises the following steps: S1: Preparation steps: First, select a PCB board, and then arrange the embedded microprocessor, dynamic random access memory, RESET reset button, boot mode selection switch, NAND FLASH memory, SPI FLASH memory and debug serial port on the PCB board; S2: Equipment installation steps: an embedded microprocessor chip is provided in the embedded microprocessor, a dynamic random access memory DRAM controller of the embedded microprocessor chip is responsible for connecting the dynamic random access memory chip, a reset pin of the embedded microprocessor chip is connected to an external RESET reset button, a startup mode pin of the embedded microprocessor chip is connected to a startup mode selection switch, a NAND FLASH controller of the embedded microprocessor chip is responsible for connecting the NAND FLASH memory chip, a SPI FLASH controller of the embedded microprocessor chip is responsible for connecting the SPI FLASH memory chip, a serial port controller of the embedded microprocessor chip is connected to the debugging serial port, a serial port console is provided in the serial port controller, the debugging serial port is connected to the serial port console, and the SPI FLASH memory is integrated with the serial port controller; S3: Device startup steps: The startup mode selection switch is installed on the embedded microprocessor. The startup mode selection switch can select the embedded microprocessor chip to start from the NAND FLASH memory and the SPI FLASH memory. The NAND FLASH memory is used to start the memory and a SPI FLASH memory is used to start the memory. The startup mode is changed, and the initialization and memory address access are reasonably performed under different startup modes to achieve the effect of using the memory to record the startup log. The RESET reset button is used to trigger the embedded microprocessor chip to reset with power on; S4: Fault diagnosis steps: After the embedded system is ready, first turn the startup mode selection switch to position 1. After the embedded microprocessor is powered on, it fetches instructions from the NAND FLASH memory and runs. At this time, when the running program is compiled, it is necessary to reserve part of the memory from the high address space as a debugging area. The reserved memory size is determined according to the information that needs to be debugged. Then, after the memory controller is initialized, all the memory in the debugging area is cleared to 0. Various programs running thereafter can fill the key debugging and diagnostic information into the debugging area memory address in an orderly manner for recording. When it is necessary to enter the diagnostic mode, that is, when performing fault detection and diagnosis, connect the debugging serial port line under isolation or electrostatic protection, or choose to always connect the debugging serial port line, then switch the startup mode selection switch, turn it to position 0, press the RESET reset button, and the embedded microprocessor will perform a soft reset at this time without powering off. After the reset, the embedded microprocessor will be reset from SPI The FLASH memory fetches instructions and runs. The program running at this time should avoid the memory debugging area address during compilation and linking. The memory initialization code maintains the same configuration as before. The memory address space of the previous debugging area cannot be cleared, occupied, refreshed or rewritten at this time. Then use memory DUMP, and finally compare the actual DUMP information one by one with the relevant manual or formula to conduct fault diagnosis analysis and draw conclusions. The program displays the information filled into the debugging area memory address when it runs for the first time on the debugging serial port. If retesting is required, the startup mode selection switch can be turned back to 1, and then the above steps can be repeated for diagnosis.

2. A memory dump fault diagnosis method based on an embedded system according to claim 1, characterized in that: In the preparation step, the dynamic random access memory uses DDR2 SDRAM to store various debugging information, and the embedded microprocessor chip uses an embedded microprocessor that supports more than two startup modes and supports a dynamic random access memory controller, and can optionally support NAND FLASH memory startup and SPI FLASH memory startup.

3. A memory dump fault diagnosis method based on an embedded system according to claim 1, characterized in that: In the preparation step, the startup mode selection switch is used to switch various startup modes of the embedded microprocessor chip, the NAND FLASH memory is used to store the debugged software, the SPI FLASH memory is used to store the correctly running software that can display DUMP information and store memory DUMP information, supports system reset, integrates a serial port controller, and the debugging serial port is used to display the memory DUMP information.