Method for measuring embedded system with high resolution

By executing MCU instructions in an embedded system step by step and measuring data in real time, the problem that traditional power consumption analysis methods cannot provide fine-grained information is solved, and high-resolution data acquisition and system energy efficiency optimization are achieved.

CN119804970APending Publication Date: 2025-04-11HANGZHOU VANGO TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510033941.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-09
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The power consumption analysis methods of traditional embedded systems cannot provide fine-grained power consumption information, making it difficult to accurately understand the power consumption performance of the system under different operating states, affecting the complexity of system performance optimization and debugging.

Method used

By stepping through the MCU instructions of the embedded system under test and measuring various data in real time, high-resolution data acquisition at the instruction level, including real-time measurement of current, voltage, temperature and frequency.

Benefits of technology

It realizes high-resolution data acquisition, which can promptly identify the system's instantaneous power consumption abnormalities in different operating states, improves debugging efficiency, and provides fine-grained data to facilitate developers to optimize system energy efficiency in a targeted manner.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119804970A_ABST
    Figure CN119804970A_ABST
Patent Text Reader

Abstract

The invention discloses a method for measuring an embedded system with high resolution, which is applied to the embedded system with high resolution, and the embedded system with high resolution comprises a test process control unit, a communication interface, a measurement unit, a debugger unit, a data storage unit and a power supply unit, and comprises the following steps of: initializing; setting a test flow control unit to initialize each module, and configuring a communication interface and a measurement unit; starting testing, receiving a control instruction through a communication interface, and starting an MCU (Microprogrammed Control Unit) in the tested embedded system; executing the instructions one by one, controlling the MCU to execute the instructions one by one by the debugger unit, and pausing after each instruction; the measuring unit measures current and voltage in real time and sends data to the data storage unit; data recording is carried out, and measured data are stored in a data storage unit for subsequent analysis; and after the test is completed, the test process control unit sends an ending signal, and a result is fed back to the control end through the communication interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of embedded systems, and in particular relates to a method for high-resolution measurement of embedded systems. Background Art

[0002] In today's rapidly developing electronic technology environment, embedded systems are widely used in the fields of Internet of Things, smart devices, automation control and medical equipment. These systems are usually composed of microcontroller units (MCUs) and multiple functional modules, and undertake complex tasks. However, as the complexity of applications increases, the management of embedded systems, especially power consumption, becomes increasingly important, especially in scenarios that require high performance and low power consumption.

[0003] Traditional embedded system power consumption analysis methods mostly rely on overall current sampling and low-frequency data acquisition, which cannot provide fine-grained power consumption information, resulting in developers being unable to accurately understand the power consumption performance of the system under different operating states. This limitation not only affects the optimization of system performance, but also increases the complexity of the debugging process, making it difficult to timely discover and solve hidden problems and power consumption anomalies. In addition, existing power consumption estimation methods are usually based on statistical models or high-level simulations. Although these methods can provide preliminary power consumption assessments, the lack of direct association with specific instructions limits the accuracy and reliability of the analysis results. Especially in multi-core or multi-functional embedded systems, the power consumption of each module affects each other, and traditional methods are difficult to effectively identify the power consumption contribution of each module. Moreover, even if the sampling frequency of traditional measurement methods is high enough, the data obtained is based on the unit sampling time interval, which cannot intuitively reflect the power consumption of the system in each state, and can only estimate the current system operation state based on the time point. Summary of the invention

[0004] In view of the above problems, the present invention provides a method for high-resolution measurement of embedded systems, which is used to implement high-resolution data acquisition at the instruction level by single-stepping the MCU instructions of the embedded system under test and measuring various types of data in real time.

[0005] In order to solve the above technical problems, the present invention adopts the following technical solutions:

[0006] A method for high-resolution measurement of an embedded system is applied to a high-resolution measurement embedded system, wherein the high-resolution measurement embedded system comprises a test process control unit, a communication interface, a measurement unit, a debugger unit, a data storage unit and a power supply unit, and comprises the following steps:

[0007] Set up a test process control unit for the test control logic and process of the embedded system under test, realize state transition through the state machine, and manage different test phases;

[0008] Setting a communication interface to realize data communication with a control terminal, the control terminal is used to send and receive commands and data to a test process control unit;

[0009] The measuring unit is configured to measure the real-time current, voltage, temperature and frequency of the embedded system under test according to the control of the test process control unit;

[0010] A debugger unit is set to control the running state of the MCU in the embedded system under test, so as to measure the power consumption after executing each instruction and to feed back the current state of the MCU in the embedded system under test to the test process control unit;

[0011] Setting a data storage unit for storing measured data;

[0012] A power supply unit is provided to provide a stable power supply for the above test process control unit, communication interface, measurement unit, debugger unit and data storage unit;

[0013] Perform initialization and set the test process control unit to initialize each module and configure the communication interface and measurement unit;

[0014] Start the test, receive control instructions through the communication interface, and start the MCU in the embedded system under test;

[0015] Instruction-by-instruction execution: the debugger unit controls the MCU to execute instructions one by one and pause after each instruction;

[0016] Perform real-time measurement, where the measuring unit measures current and voltage in real time and sends the data to the data storage unit;

[0017] Perform data recording and save the measured data to the data storage unit for subsequent analysis;

[0018] End the test. After the test is completed, the test process control unit sends an end signal and feeds back the result to the control end through the communication interface.

[0019] In a possible implementation manner, the working process of the state machine includes:

[0020] When the measurement system is started, the state machine is in the initialization state, and performs hardware and software initialization, including setting the clock of the MCU of the test process control unit, configuring GPIO, and initializing the measurement unit. After the initialization is completed, the state machine is ready to receive control commands and waits for the event of "receiving control commands";

[0021] If a control command is received, the state machine switches to the control command receiving state; in this state, the measurement system parses and processes the received command and confirms the execution parameters; after processing the control command, the system triggers the "start measurement" event and switches to the next state;

[0022] If the state machine receives the "start measurement" event, the state transitions to the measurement execution state. In this state, the system executes the measurement logic and starts real-time measurement of various performance indicators. After the measurement is completed, the system detects the "measurement completion" event and prepares to record data.

[0023] If the "measurement completed" event is received, the state machine switches to the data recording state; in this state, the system saves all measurement results to the data storage unit;

[0024] After data recording is completed, the system triggers the "test end" event and the test ends.

[0025] In a possible implementation manner, the state process of performing measurement includes:

[0026] State transition: When the state machine transitions from the "receiving control commands" state to the "executing measurement" state, the system begins to prepare for measurement.

[0027] Prepare for measurement: Based on the control commands received previously, the system configures the measuring devices and sensors and sets the necessary parameters; if necessary, initializes the relevant measuring modules and sensors to ensure that they are in the correct working state.

[0028] Single-step test process: Start measurement: The system starts the measurement process and enters the single-step test mode;

[0029] Single-step execution: Using a debugger or internal control logic, the system executes measurement instructions one by one; after each measurement instruction is executed, it pauses and enters the measurement state to allow the measurement equipment to stabilize and collect data;

[0030] Data collection: After each single-step execution, the system uses measurement equipment to collect current power consumption, voltage, frequency and other data; after data collection is completed, the results are stored in a temporary buffer for subsequent processing;

[0031] Status check: After each single-step execution and data acquisition, check whether there is an interruption or error; if an abnormal situation is detected, jump to the error handling state or adjust the measurement parameters as needed;

[0032] Continue measuring: If there is no abnormality, the system will continue to execute the next measurement instruction and repeat the single-step execution and data collection. When all measurement instructions are executed, the system will trigger the "measurement completed" event;

[0033] End measurement: After all instructions have been executed, the system will process the collected measurement data, which may include calculating statistics such as average and maximum values. It is ready to enter the "recording data" state and store the measurement results in persistent storage;

[0034] If the state machine receives the "test end" event, the state transitions to the end state; in this state, the system performs cleanup work, releases resources, closes each module, and ensures the safe exit of the system; at this time, the state machine's workflow is completed and enters the standby state, ready to receive instructions for the next test.

[0035] In a possible implementation manner, the test unit is configured to include a current sensor for current measurement.

[0036] In a possible implementation manner, the test unit is configured to include a voltage sensor, which is used to collect voltage data using an analog-to-digital converter ADC.

[0037] In a possible implementation, the test unit is configured to include a frequency meter, which is used to count specific pulse signals using a timer or counter inside the MCU of the test unit to calculate the frequency.

[0038] In a possible implementation manner, the test unit is configured to include a thermocouple or a thermistor for obtaining a temperature value of an MCU of the embedded system under test.

[0039] In a possible implementation manner, the debugger unit working process includes:

[0040] Connect the debugger unit to the MCU of the embedded system under test through a dedicated interface;

[0041] Initialize the debugger unit to start the debugger software and configure the test parameters;

[0042] Load the firmware or control logic code to be debugged into the MCU of the embedded system under test;

[0043] Set breakpoints in the debugger unit interface to pause program execution when a specific instruction is executed;

[0044] Start the single-step execution mode and execute instructions one by one; the debugger pauses after each instruction is executed, allowing developers to view the current register values, memory status and power consumption of each module; after each instruction is executed, the test unit is used to monitor the performance indicators of the embedded system under test in real time.

[0045] The present invention has the following beneficial effects:

[0046] (1) High-resolution data acquisition: By executing MCU instructions step by step, power consumption measurement at the instruction level can be achieved, providing more detailed power consumption information.

[0047] (2) Hidden problem detection capability: Ability to promptly identify the instantaneous power consumption anomalies of the system under different operating conditions, thereby improving debugging efficiency.

[0048] (3) Targeted optimization: Providing fine-grained data to facilitate developers to optimize system energy efficiency for each function. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 The present invention is a principle block diagram of a high-resolution embedded system measurement method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0051] The embodiment of the present invention provides a method for high-resolution measurement of an embedded system, which is applied to Figure 1 The high-resolution measurement embedded system shown includes a test process control unit, a communication interface, a measurement unit, a debugger unit, a data storage unit and a power supply unit, including the following steps:

[0052] The test process control unit is set up to control the test logic and process of the embedded system under test, realize state transition through the state machine, and manage different test phases; the test process control unit can select a suitable microcontroller, such as the ARMCortex-M series. Different test phases can include initialization, execution, measurement, recording and termination.

[0053] A communication interface is set up to realize data communication with the control end, and the control end is used to send and receive commands and data to the test process control unit; the communication interface can use a UART or USB interface; a simple communication protocol is defined to send and receive commands and data (for example, test start, pause, obtain data, etc.). Real-time data transmission is supported to facilitate the control end to monitor the test status.

[0054] The measuring unit is configured to measure the real-time current, voltage, temperature and frequency of the embedded system under test according to the control of the test process control unit;

[0055] A debugger unit is set to control the running state of the MCU in the embedded system under test, so as to measure the power consumption after executing each instruction and to feed back the current state of the MCU in the embedded system under test to the test process control unit;

[0056] Setting a data storage unit for storing measured data;

[0057] A power supply unit is provided to provide a stable power supply for the above test process control unit, communication interface, measurement unit, debugger unit and data storage unit;

[0058] Perform initialization and set the test process control unit to initialize each module and configure the communication interface and measurement unit;

[0059] Start the test, receive control instructions through the communication interface, and start the MCU in the embedded system under test;

[0060] Instruction-by-instruction execution: the debugger unit controls the MCU to execute instructions one by one and pause after each instruction;

[0061] Perform real-time measurement, where the measuring unit measures current and voltage in real time and sends the data to the data storage unit;

[0062] Perform data recording and save the measured data to the data storage unit for subsequent analysis;

[0063] End the test. After the test is completed, the test process control unit sends an end signal and feeds back the result to the control end through the communication interface.

[0064] It should be noted that the above steps of setting up the test process control unit, the communication interface, the measurement unit, the debugger unit, the data storage unit and the power supply unit do not have to be performed in this order.

[0065] In a specific application example, the working process of setting the state machine in the test process control unit includes:

[0066] Initialization: When the measurement system is started, the state machine is in the initialization state, and performs hardware and software initialization, including setting the clock of the MCU of the test process control unit, configuring GPIO, and initializing the measurement unit. After the initialization is completed, the state machine is ready to receive control commands (such as instructions from the control end) and waits for the event of "receiving control commands";

[0067] Receive control command: If a control command is received, the state machine switches to the receive control command state; in this state, the measurement system parses and processes the received command and confirms the execution parameters (such as measurement type, measurement time, etc.); after processing the control command, the system triggers the "start measurement" event and switches to the next state;

[0068] Execute measurement: If the state machine receives the "start measurement" event, the state transitions to the execution measurement state; in this state, the system executes the measurement logic and starts real-time measurement of various performance indicators (such as power consumption, voltage, etc.). After the measurement is completed, the system detects the "measurement completed" event and prepares to record data;

[0069] Recording data: If a "measurement completed" event is received, the state machine switches to the recording data state; in this state, the system saves all measurement results to the data storage unit for subsequent analysis and use.

[0070] Measurement: After data recording is completed, the system triggers the "Test End" event and the test ends.

[0071] Furthermore, the state process of performing the measurement includes:

[0072] State transition: When the state machine transitions from the "receiving control commands" state to the "executing measurement" state, the system begins to prepare for measurement.

[0073] Prepare for measurement: Based on the control commands received previously, the system configures the measuring devices and sensors and sets the necessary parameters (such as measuring time, sampling rate, etc.). If necessary, initialize the relevant measuring modules and sensors to ensure that they are in the correct working state.

[0074] Single-step test process: Start measurement: The system starts the measurement process and enters the single-step test mode.

[0075] Single-step execution: Using a debugger or internal control logic, the system executes measurement instructions one by one. After each measurement instruction is executed, it pauses and enters the measurement state to allow the measurement device to stabilize and collect data.

[0076] Data collection: After each single step execution, the system uses measurement equipment to collect current power consumption, voltage, frequency, etc. After the data collection is completed, the results are stored in a temporary buffer for subsequent processing.

[0077] Status check: After each single-step execution and data acquisition, check whether there is an interrupt or error. If an abnormal situation is detected, you can jump to the error handling state or adjust the measurement parameters as needed.

[0078] Continue measuring: If there is no abnormality, the system will continue to execute the next measurement instruction and repeat the single-step execution and data collection. The system will trigger the "measurement completed" event until all measurement instructions are executed.

[0079] End measurement: After all instructions have been executed, the system will process the collected measurement data, which may include calculating statistics such as average and maximum values. It is ready to enter the "recording data" state and store the measurement results in persistent storage.

[0080] If the state machine receives the "test end" event, the state transitions to the end state. In this state, the system performs cleanup, releases resources, closes each module, and ensures the system exits safely. At this point, the state machine's workflow is complete and enters the standby state, ready to receive instructions for the next test.

[0081] In a specific application example, the measurement unit includes a current sensor, a voltage sensor, a power consumption current measurement, a voltage measurement, a frequency meter, and a thermocouple or thermistor. The current sensor selects a suitable sensor (such as a Hall sensor or a shunt resistor) for current measurement. The voltage sensor uses an ADC (analog-to-digital converter) to collect voltage data. When measuring power consumption current, a shunt resistor and a high-precision current sensor are used to calculate the power consumption in combination with voltage measurement (such as the V=IR rule). Voltage measurement can simulate a voltage sensor: the analog voltage signal is converted into a digital signal for processing through the ADC. The frequency meter uses the timer or counter inside the MCU to count specific pulse signals to calculate the frequency. When measuring temperature, a thermocouple or NTC / PTC thermistor sensor is used to convert the temperature change into a voltage signal, which is then collected through the ADC. Or use a temperature sensor with a digital output directly through I 2 C or SPI interface to communicate with MCU and obtain temperature value.

[0082] In specific application examples, the debugging unit can use the standard interface CMSIS-DAP (Cortex Microcontroller Software Interface Standard-Debug Access Port) to control the running status of the MCU. CMSIS-DAP is a debugging interface standard launched by ARM, which aims to provide a unified debugging interface for the Cortex-M series microcontrollers. Its main features and functions include: (1) Versatility. CMSIS-DAP provides a universal debugging protocol that is compatible with various Cortex-M microcontrollers and development environments. It supports multiple debuggers and IDEs, allowing developers to use the same debugging tools on different platforms. (2) Hardware interface. CMSIS-DAP is usually connected to the host computer via USB and connected to the target microcontroller via SWD (Serial Wire Debug) or JTAG interface. This enables fast and reliable debugging and programming functions. (3) Simple and easy to use. CMSIS-DAP is designed to simplify the debugging process. Developers can easily debug, program and monitor the system through a standardized interface, reducing development complexity. (4) Supported functions. Support single-step execution: allows developers to execute programs instruction by instruction, facilitating detailed debugging. Support setting breakpoints: You can set breakpoints in the program code and pause the program when it reaches a specific location, making it easier to check the status. Support memory and register access: You can read and write the memory and registers of the target MCU, helping developers monitor and modify the status in real time. Support program burning: Support downloading application code to the flash memory of the target MCU. (5) Compatibility. CMSIS-DAP supports a variety of development tools and integrated development environments (IDEs), such as Keil MDK, IAR Embedded Workbench, Arm DevelopmentStudio, etc., which enhances its wide application in embedded development. (6) Open source implementation. The protocol and implementation of CMSIS-DAP are open. ARM has released relevant sample code and hardware design documents, allowing hardware and software developers to customize development according to their own needs. (7) Debugger hardware. Commonly used CMSIS-DAP debugger hardware includes DAPLink and Segger J-Link DAP. Among them, DAPLink is an open source CMSIS-DAP debugger that is commonly used in development boards, such as those of NXP and ST. Segger J-Link DAP's debugger also supports the CMSIS-DAP protocol, combined with its high-performance debugging functions. (8) Application scenarios. CMSIS-DAP is widely used in the development and debugging of Cortex-M series microcontrollers, especially in the fields of IoT, embedded control, sensor data acquisition, etc.With CMSIS-DAP, developers can debug and develop more efficiently, thereby improving the development efficiency and reliability of embedded systems.

[0083] The specific working process of the debugger unit in an embedded system usually includes the following steps: (1) Hardware connection: Connect the debugger to the MCU or processor through a dedicated interface (such as JTAG, SWD or UART). The debugger usually contains a debug adapter and a software interface. (2) Initialize the debugger: Start the debugger software, configure the necessary parameters (such as target device type, debugging protocol, etc.), and ensure smooth communication with the target MCU. (3) Load the program: Load the firmware or control logic code to be debugged into the MCU. The debugger usually burns the code into the flash memory or RAM of the target device. (4) Set breakpoints: Set breakpoints in the debugger interface and specify to pause the program when a specific instruction is executed. This allows developers to check the status when the program executes to a critical position. (5) Single-step execution: Start the single-step execution mode and execute instructions one by one. The debugger pauses after each instruction is executed, allowing developers to view the current register values, memory status and power consumption of each module. (6) Data monitoring: After each instruction is executed, use the built-in measurement function to monitor the system's performance indicators such as power consumption, voltage and temperature in real time. This usually requires that the measured data be sent back to the host computer through the debugger for recording and analysis. (7) Troubleshooting and adjustment: Through the monitoring function of the debugger, developers can analyze system behavior, find the source of errors and make corresponding adjustments. Variable values ​​can be modified in real time, specific memory addresses can be monitored, etc. (8) Recording and analysis: The debugger can record power consumption data collected during instruction execution and generate analysis reports. This data is used for subsequent performance optimization and troubleshooting. (9) End debugging: After debugging is completed, the status and data of the debugging session can be saved, the debugger can be closed, and the modified code can be prepared for formal compilation and burning. The implementation process of the above debugger unit provides developers with the ability to deeply analyze and optimize the performance of embedded systems, ensuring efficient operation and stability of the system.

[0084] By using the above-mentioned high-resolution embedded system measurement method, after measuring the current, voltage, frequency, and temperature data, the various performance indicators of the embedded system under test can be fully measured. For example, the power consumption can be calculated by multiplying the voltage and current, which helps analyze the energy consumption of the system under different working conditions. By measuring the fluctuation of the reference voltage, its output noise level can be evaluated to ensure that the system will not be disturbed in high-precision applications. Monitor the change of the reference voltage with temperature to evaluate its stability under different environmental conditions. Observe the change of the reference voltage under different load conditions and analyze its adaptability to load changes. Measure the voltage range and number of bits of the DAC output to evaluate the minimum voltage change it can achieve. By measuring the deviation between the DAC output and the ideal output, its linearity is evaluated to ensure the accuracy of the output signal. Evaluate the distortion of the DAC output signal to ensure the integrity of the output signal in terms of frequency response. Integral nonlinearity and differential nonlinearity, these indicators can be evaluated by measuring the relationship between the DAC output voltage and the input digital value to ensure the accuracy of the DAC over the entire output range. Monitoring the voltage fluctuations of each power domain can evaluate the power supply stability of the system to ensure stable operation under high load and sudden situations. Measuring the response time and amplitude of voltage under load changes can analyze the system's adaptability to dynamic loads. Since voltage is related to temperature changes, monitoring voltage changes can indirectly reflect the temperature status of the system, which helps with thermal management. By measuring input and output voltages, you can evaluate the power conversion efficiency and understand the performance of the power module. Calculate the load current through voltage drop to evaluate the current response and system performance under different load conditions. Measuring the operating frequency of the system clock or MCU ensures that it operates within the design specifications to ensure system performance. Measuring the frequency of input and output signals can evaluate the stability and frequency response characteristics of the signal, which is especially important in communication and audio applications. Measuring the width of pulse signals can help analyze the timing characteristics of digital signals, which is crucial to the accuracy of timing and control systems. Monitoring the change of frequency over time and analyzing the frequency stability of the system under different operating conditions to ensure the reliability of the system under dynamic loads. In modems and wireless communications, measuring the frequency and bandwidth of modulated signals can evaluate the quality of the communication link. Analyzing the noise spectrum in the system can help identify interference sources that may affect system performance, especially in high-precision applications.

[0085] Temperature measurement can be used to evaluate multiple performance indicators in embedded systems, including: monitoring the overall system temperature to ensure that each component is within the safe operating range and prevent failures caused by overheating. Measuring the temperature of specific hardware modules (such as MCU, sensor, power amplifier, etc.) to evaluate their thermal performance under different workloads. Evaluating the impact of ambient temperature on system performance to ensure the reliability and stability of the system under different environmental conditions. Monitoring the drift of component characteristics (such as sensors and reference voltage sources) with temperature changes to help optimize the design and calibration process. Measuring the system's response time to temperature changes to evaluate its stability under rapidly changing conditions. By measuring temperature changes, analyzing the relationship between power consumption and heat generation to optimize energy efficiency and thermal design. Setting temperature limits and monitoring whether they exceed safety thresholds to ensure that the system is not damaged by overheating. By monitoring these performance indicators, it helps to optimize the design and implementation of embedded systems, optimize thermal design, and improve overall performance and reliability.

[0086] The above-mentioned method of high-resolution measurement of embedded systems can achieve high-resolution data acquisition: by gradually executing MCU instructions, it can achieve instruction-level power consumption measurement and provide more detailed power consumption information. It has the ability to detect hidden problems: it can timely identify the instantaneous power consumption anomalies of the system under different operating conditions and improve debugging efficiency. It can conveniently achieve targeted optimization: it provides fine-grained data to facilitate developers to optimize system energy efficiency for each function.

[0087] It should be understood that the exemplary embodiments described herein are illustrative rather than restrictive. Although one or more embodiments of the present invention have been described in conjunction with the accompanying drawings, it should be understood by those skilled in the art that various changes in form and detail may be made without departing from the spirit and scope of the present invention as defined by the appended claims.

Claims

1. A method for high-resolution measurement of an embedded system, characterized in that: The invention is applied to a high-resolution measurement embedded system, wherein the high-resolution measurement embedded system comprises a test process control unit, a communication interface, a measurement unit, a debugger unit, a data storage unit and a power supply unit, and comprises the following steps: Set up a test process control unit for the test control logic and process of the embedded system under test, realize state transition through the state machine, and manage different test phases; Setting a communication interface to realize data communication with a control terminal, the control terminal is used to send and receive commands and data to a test process control unit; The measuring unit is configured to measure the real-time current, voltage, temperature and frequency of the embedded system under test according to the control of the test process control unit; A debugger unit is set to control the running state of the MCU in the embedded system under test, so as to measure the power consumption after executing each instruction and to feed back the current state of the MCU in the embedded system under test to the test process control unit; Setting a data storage unit for storing measured data; A power supply unit is provided to provide a stable power supply for the above test process control unit, communication interface, measurement unit, debugger unit and data storage unit; Perform initialization and set the test process control unit to initialize each module and configure the communication interface and measurement unit; Start the test, receive control instructions through the communication interface, and start the MCU in the embedded system under test; Instruction-by-instruction execution: the debugger unit controls the MCU to execute instructions one by one and pause after each instruction; Perform real-time measurement, where the measuring unit measures current and voltage in real time and sends the data to the data storage unit; Perform data recording and save the measured data to the data storage unit for subsequent analysis; End the test. After the test is completed, the test process control unit sends an end signal and feeds back the result to the control end through the communication interface.

2. The method for high-resolution measurement of embedded systems according to claim 1, characterized in that: The working process of the state machine includes: When the measurement system is started, the state machine is in the initialization state, and performs hardware and software initialization, including setting the clock of the MCU of the test process control unit, configuring GPIO, and initializing the measurement unit. After the initialization is completed, the state machine is ready to receive control commands and waits for the "receive control command" event. If a control command is received, the state machine switches to the control command receiving state. In this state, the measurement system parses and processes the received command and confirms the execution parameters. After processing the control command, the system triggers the "start measurement" event and switches to the next state. If the state machine receives the "start measurement" event, the state transitions to the measurement execution state. In this state, the system executes the measurement logic and starts real-time measurement of various performance indicators. After the measurement is completed, the system detects the "measurement completion" event and prepares to record data. If the "measurement completed" event is received, the state machine switches to the data recording state; in this state, the system saves all measurement results to the data storage unit; After data recording is completed, the system triggers the "test end" event and the test ends.

3. The method for high-resolution measurement of embedded systems as claimed in claim 2, characterized in that: The state process of performing measurement includes: State transition: When the state machine transitions from the "receiving control commands" state to the "executing measurement" state, the system begins to prepare for measurement. Prepare for measurement: Based on the control commands received previously, the system configures the measuring devices and sensors and sets the necessary parameters; if necessary, initializes the relevant measuring modules and sensors to ensure that they are in the correct working state. Single-step test process: Start measurement: The system starts the measurement process and enters the single-step test mode; Single-step execution: Using a debugger or internal control logic, the system executes measurement instructions one by one; after each measurement instruction is executed, it pauses and enters the measurement state to allow the measurement equipment to stabilize and collect data; Data collection: After each single-step execution, the system uses measurement equipment to collect current power consumption, voltage, frequency and other data; after data collection is completed, the results are stored in a temporary buffer for subsequent processing; Status check: After each single-step execution and data acquisition, check whether there is an interruption or error; if an abnormal situation is detected, jump to the error handling state or adjust the measurement parameters as needed; Continue measuring: If there is no abnormality, the system will continue to execute the next measurement instruction and repeat the single-step execution and data collection. When all measurement instructions are executed, the system will trigger the "measurement completed" event; End measurement: After all instructions have been executed, the system will process the collected measurement data, which may include calculating statistics such as average and maximum values. It is ready to enter the "recording data" state and store the measurement results in persistent storage; If the state machine receives the "test end" event, the state transitions to the end state; in this state, the system performs cleanup work, releases resources, closes each module, and ensures the safe exit of the system; at this point, the state machine's workflow is completed and enters the standby state, ready to receive instructions for the next test.

4. The method for high-resolution measurement of embedded systems according to claim 1, characterized in that: The test unit is configured to include a current sensor for performing current measurement.

5. The method for high-resolution measurement of embedded systems according to claim 1, characterized in that: The test unit is configured to include a voltage sensor for collecting voltage data using an analog-to-digital converter ADC.

6. The method for high-resolution measurement of embedded systems according to claim 1, characterized in that: The test unit is configured to include a frequency meter, which is used to count specific pulse signals using a timer or counter inside the MCU of the test unit to calculate the frequency.

7. The method for high-resolution measurement of embedded systems according to claim 1, characterized in that: The test unit is configured to include a thermocouple or a thermistor, which is used to obtain the MCU temperature value of the embedded system under test.

8. The method for high-resolution measurement of embedded systems according to claim 1, characterized in that: The working process of the debugger unit includes: Connect the debugger unit to the MCU of the embedded system under test through a dedicated interface; Initialize the debugger unit to start the debugger software and configure the test parameters; Load the firmware or control logic code to be debugged into the MCU of the embedded system under test; Set breakpoints in the debugger unit interface to pause program execution when a specific instruction is executed; Start single-step mode and execute instructions one by one; the debugger pauses after each instruction, allowing Developers can view the current register values, memory status and power consumption of each module; after each instruction is executed, Use the test unit to monitor the performance indicators of the embedded system under test in real time.

Citation Information

Cited By

  • Swing arm driving control device of high-precision vertical sorting machine

    CN121585060A