Supply current consumption acquisition synchronized with commissioning data tracking

Through the debugging probe working in the debugging system and the debugging instructions and power signal sampling of the microcontroller by the host computer, the problem of current draw and debugging tracking data alignment error in the existing technology is solved, and the accurate optimization of SOC operation efficiency is achieved .

CN118939500APending Publication Date: 2024-11-12STMICROELECTRONICS INT NV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311633415.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-12-14
Filing Date
2023-11-30
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

There are errors in the aligning current draw and debugging tracking data, which leads to difficulty in optimizing SOC operation efficiency and is unable to accurately identify the specific source of power consumption.

Method used

A system is designed to send debugging instructions to the microcontroller through the coordinated work of the debug probe and the host, generate tracking data and sample power signals, and use synchronization requests and intermediate synchronization requests to determine the power acquisition cycle number and timestamp. Based on ratio alignment tracking data and power signal samples, the delay is measured to ensure alignment accuracy.

Benefits of technology

The precise alignment of tracking data and power consumption data is achieved, the specific inference ability of SOC operation efficiency is improved, generalization inference is reduced, and the accuracy of power consumption optimization is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939500A_ABST
    Figure CN118939500A_ABST
Patent Text Reader

Abstract

The invention relates to supply current consumption acquisition synchronized with commissioning data tracking. More specifically, disclosed herein is a debug system comprising a host computer, a microcontroller, and a debug probe for interfacing therebetween to perform debug tracking operations. The debugging probe samples the current drawn by the microcontroller. The commissioning probe and the host computer cooperate to acquire and accurately align the tracking data and a sample of the current drawn by the microcontroller. Techniques for performing such alignment are described herein and enable accurate inference of the current drawn by the microcontroller during different program operations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of power consumption monitoring of components within a microcontroller, and in particular to a debug probe and associated firmware that is capable of accurately synchronizing debug tracing with measurement of current draw. Background Art

[0002] System on chip devices (SOC) are now widely used in electronic devices. SOCs typically include a processor, one or more modules, a memory device, and one or more system buses for communication between the processor, the modules, and the memory devices. Since multiple modules and their communications occur inside the chip, it is usually difficult to access this information when problems occur in software or hardware. Therefore, debugging on these systems is not simple. With the development of these SOCs, specialized debugging systems have been developed for monitoring performance on the chip and tracking information. Such systems typically include dedicated hardware or software, such as debugging tools and debugging software that access the processor via serial communication.

[0003] One of the various uses of these debug systems is to attempt to correlate supply current draw (e.g., power consumption) with debug data from debug traces. For example, this can be used to correlate SOC components and functions, processes, programs, and code sections with high power consumption. By establishing this correlation, suitable targets for power consumption or thermal management optimization can be identified.

[0004] Conventionally, a host computer in communication with a debug probe aligns the current draw and debug trace in a log that can be displayed to a user. Figure 1 The ideal situation is illustrated in , showing current values ​​over time (e.g., samples of current drawn by a microcontroller including a SOC) aligned with trace data about sensing operations over time from a debug trace (e.g., humidity, temperature, pressure, accelerometer) and associated current sample numbers (e.g., sample number of each current sample). With this alignment, the power draw of different types of sensing can be observed. For example, note that the current value during the period when humidity sensing is active (humidity display value is 80) is less than the current value when temperature sensing (temperature display value is 25) and pressure sensing (pressure display value is 990) are active, and much less than the current value when acceleration sensing (accelerometer display value is 100) is active.

[0005] It can be seen that acceleration sensing is a good target for power consumption optimization, while humidity sensing is already well optimized. This information helps developers identify where to spend development resources.

[0006] Assume that the current value and trace data can be Figure 1, then conventional debugging tools and techniques are effective. However, as mentioned above, Figure 1 is the ideal case. Using conventional techniques to perform alignment, the host computer typically does not align current draw and debug trace well because current draw and debug trace are recorded as they arrive. For example, the consumption (current value) may be shifted relative to the "SVCall" function within the trace data. This degree of misalignment is typical. While this will allow general inferences to be made about current draw and current SOC operation, the misalignment will make specific inferences difficult to draw - the closer the alignment, the more specific the inferences that can be drawn, and the larger the misalignment, the more general the inferences that can be drawn.

[0007] In the pursuit of SOC operating efficiency, this possibility of misalignment can be problematic. Thus, there is a need to further develop debug probes and their data processing to provide accurate, detailed inferences that can be used to improve SOC operating efficiency. Summary of the invention

[0008] A system is disclosed herein, comprising: a microcontroller including a microprocessor; a debug probe; and a host. The host is configured to send a debug instruction to the debug probe when the microcontroller is started, and the debug instruction, when executed by the microcontroller, starts to perform debug tracing in the microcontroller. The debug probe is configured to send a debug instruction to the microcontroller. The microcontroller is configured to perform debug tracing according to the debug instruction to generate tracing data, and the tracing data includes a tracing data timestamp.

[0009] The debug probe is further configured to receive a power signal from the host and sample the power signal and provide the power signal to the microcontroller, wherein each sampling of the power signal occurs during a different power harvesting cycle.

[0010] The host is also configured to periodically send synchronization requests to the debug probe.

[0011] The debug probe is further configured to, in response to receiving each synchronization request: retrieve a current power harvesting cycle number; generate an intermediate synchronization request; and send the intermediate synchronization request to the microcontroller.

[0012] The microcontroller is further configured to, in response to receiving each intermediate synchronization request, send a message to the debug probe, the message including a current execution cycle number of the microprocessor and an associated cycle number timestamp.

[0013] The debug probe is also configured to: send trace data to the host; send messages to the host; and send sampled power signals to the host.

[0014] The host is configured to: determine a trace data timestamp at which sampling of the power signal begins within the trace data; derive a frequency of the microprocessor from the trace data; determine a ratio between the sampling rate of the power signal and the frequency of the microprocessor; and align samples of the trace data and the power signal based on the ratio and the trace data timestamp at which sampling of the power signal begins within the trace data.

[0015] The debug probe may include a power harvesting circuit that samples the power signal.

[0016] The debug probe may include a protocol manager that retrieves a current power acquisition cycle number, generates an intermediate synchronization request, sends the intermediate synchronization request to a microcontroller, sends trace data to a host, sends a message to the host, and sends a sampled power signal to the host.

[0017] The protocol manager can send an intermediate synchronization request to the microcontroller via the serial wire debug (SWD) protocol. The microcontroller can send messages to the debug probe via the UART protocol (SWO) and send trace data to the debug probe via the SWD protocol.

[0018] The messages may be generated within an Instrument Trace Macrocell (ITM) within the microcontroller.

[0019] The debug probe may include a power harvesting circuit that samples the power signal. The microcontroller may also be configured to send a request acknowledgement to the debug probe upon receipt of each intermediate synchronization request. The synchronization manager may also be configured to measure the number of power harvesting cycles between the sending of each intermediate synchronization request and the receiving of each request acknowledgement, and determine a latency based thereon. The latency may indicate the accuracy of the alignment between the trace data and the samples of the power signal.

[0020] The present invention also discloses a method for aligning trace data and power consumption data in a debugging system. The method includes: sending a debugging instruction to a microcontroller in the debugging system, and when the debugging instruction is executed by the microcontroller, the debugging trace is started; receiving a power signal from a host in the debugging system; sampling the power signal and providing the power signal to the microcontroller, wherein each sampling of the power signal occurs during a different power collection cycle.

[0021] The method further includes, in response to receiving each of the plurality of periodic synchronization requests: retrieving a current power harvesting cycle number; generating an intermediate synchronization request; and sending the intermediate synchronization request to the microcontroller.

[0022] The method also includes: receiving trace data from the microcontroller, the trace data including a trace data timestamp; receiving a message from the microcontroller in response to each intermediate synchronization request, the message including a current execution cycle number of a microprocessor within the microcontroller and an associated cycle number timestamp; sending the trace data to a host, sending the message to the host, and sending the sampled power signal to the host, so that the host aligns the trace data and samples of the power signal based on the trace data timestamp at which sampling of the power signal within the trace data begins and a ratio between a sampling rate of the power signal and a frequency of the microprocessor.

[0023] The method may include deriving a frequency of the microprocessor from the tracking data.

[0024] The method may also include: receiving a request acknowledgement in response to sending each intermediate synchronization request to the microcontroller; measuring the number of power collection cycles between sending each intermediate synchronization request and receiving each request acknowledgement, and determining a latency based thereon. The accuracy of the alignment between the tracking data and the power signal samples may be determined based on the latency.

[0025] The present invention also discloses a method for aligning trace data and power consumption data in a debugging system. The method includes: when a microcontroller in the debugging system is started, sending a debugging instruction from a host in the debugging system to a debugging probe in the debugging system, and when the debugging instruction is executed by the microcontroller, the debugging instruction starts to execute debug tracing; transmitting the debugging instruction from the debugging probe to the microcontroller; executing debug tracing at the microcontroller according to the debugging instruction to generate tracing data, and the tracing data includes a tracing data timestamp; receiving a power signal from the host at the debugging probe; sampling the power signal at the debugging probe and providing the power signal to the microcontroller, and each sampling of the power signal occurs during a different power collection cycle; and periodically sending a synchronization request from the host to the debugging probe.

[0026] The method further includes, in response to receiving each synchronization request at the debug probe: retrieving a current power harvesting cycle number; generating an intermediate synchronization request; and sending the intermediate synchronization request from the debug probe to the microcontroller.

[0027] The method further includes, in response to receiving each intermediate synchronization request at the microcontroller, sending a message to the debug probe, the message including a current execution cycle number of a microprocessor within the microcontroller and an associated cycle number timestamp.

[0028] The method also includes: sending trace data from the debug probe to the host; sending a message from the debug probe to the host; sending a sampled power signal from the debug probe to the host; determining, at the host, a trace data timestamp at which sampling of the power signal begins within the trace data; deriving, at the host, a frequency of a microprocessor from the trace data; determining, at the host, a ratio between a sampling rate of the power signal and the frequency of the microprocessor; and aligning, at the host, samples of the trace data and the power signal based on the ratio and the trace data timestamp at which sampling of the power signal begins within the trace data.

[0029] The method may further include sending a request acknowledgement to the debug probe after each intermediate synchronization request is received at the microcontroller; and measuring the number of power harvesting cycles between sending each intermediate synchronization request and receiving each request acknowledgement at the debug probe and determining the latency based thereon.

[0030] The delay indicates the accuracy of the alignment between samples of the tracking data and power signals. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 is a diagram showing a rough attempt at alignment between debug trace data and power acquisition samples performed by a prior art system.

[0032] Figure 2 is a block diagram of the debugging system described in this article.

[0033] Figure 3 It is shown in Figure 2 A graph of relative start times of debug trace logging, synchronization message logging, and power consumption logging during debug operation of a debug system.

[0034] Figure 4 It is shown in Figure 2 A diagram of an example data flow received by a host computer during a debug operation of a debug system.

[0035] Figure 5 It is shown by Figure 2 A diagram of the debug system achieving precise alignment between debug trace data and power acquisition samples.

[0036] Figure 6 It is shown by Figure 2 A diagram of the alignment between power acquisition cycle numbers and debug trace timestamps achieved by a debug system when performing alignment between debug trace data and power acquisition samples.

[0037] Figure 7 It is shown by Figure 2 Figure 2. Measurement of synchronization quality achieved by a debugging system. DETAILED DESCRIPTION

[0038] The following disclosure enables those skilled in the art to make and use the subject matter disclosed herein. Without departing from the spirit and scope of the present disclosure, the general principles described herein can be applied to embodiments and applications other than those described in detail above. The present disclosure is not intended to be limited to the embodiments shown, but should conform to the widest scope consistent with the principles and features disclosed or suggested herein.

[0039] In general, the debug probe converts commands received from a host device (e.g., a PC) according to the protocol used by the microcontroller. The protocol used by the microcontroller can be based on the Joint Test Action Group (JTAG) protocol or based on the serial wire debug (SWD) protocol. It should be understood that the SWD protocol is specific to a microcontroller with an ARM-based central processing unit (CPU) and uses two lines / pins for data communication. The two lines / pins used by SWD are serial wire data input and output (SWDIO) (through which data is transmitted serially) and serial wire clock (SWCLK) (through which a clock signal is transmitted). SWD can optionally include a serial wire output (SWO) line / pin, through which the CPU can output specific data in a simplex manner according to a suitable protocol (e.g., Manchester, Universal Asynchronous Receiver Transmitter (UART)).

[0040] Real-time debugging (as opposed to breakpoint or single-step debugging) is typically performed in situations where the processor cannot be stopped or a system crash may occur, or when it is necessary to observe the characteristics of the microcontroller during real-time operation (e.g., power consumption). As the microcontroller executes the program, the debug "trace" follows the program's flow and data progression. An on-chip instrumentation trace macrocell (ITM) or embedded trace macrocell (ETM) can transmit the trace directly to the debug probe via SWD, or it can buffer the trace and then transmit the buffered trace to the debug probe. The debug probe, in turn, provides the trace to the host device.

[0041] As explained earlier in this document, it is desirable to synchronize the tracking data with the measurement of the current draw. Figure 2 A debug system 10 is described that includes a host device 12, a debug probe 14, and a microcontroller (MCU) 20 that is designed to provide synchronization between trace data (SWDIO, SWO) and current draw (PWR) measurements.

[0042] The host device 12 may be, for example, a computer, and provides a power output PWR to the debug probe 14 .

[0043] The debug probe 14 includes a power acquisition circuit 15 that receives the power output PWR from the host computer 12 and provides it to the microcontroller 20, while sampling the power consumed by the microcontroller 20. The power acquisition cycle is the period during which a single sample of the output power PWR is sampled. Note that the sampling rate of the output power PWR is different from the data transmission rate of the trace data (SWDIO, SWO).

[0044] The debug probe 14 further includes a synchronization manager 16, which receives a synchronization request SYNC REQ (SYNC REQ will be explained in detail below) from the host computer 12 and performs bidirectional communication with the power harvesting circuit 15 and the protocol manager 17. The protocol manager 17 receives SWDIO data and SWO data and a clock SWCLK, and provides the output thereof to the host computer 12. The protocol manager 17 also receives trace data TRACE_DATA and a trace clock TRACE_CLK, and provides the output thereof to the host computer 12.

[0045] The microcontroller 20 includes an ARM Cortex-M based microprocessor 30 , such as Cortex-M0, Cortex-M0+, Cortex-M1, Cortex-M3, Cortex-M4, Cortex-M7, Cortex-M23, Cortex-M33, Cortex-M35P, Cortex-M55, Cortex-M85, etc.

[0046] The microprocessor 30 includes at least one processing core 31, a data watchpoint and trace unit (DWT) 32, and an instrument trace macrocell (ITM) 33. The microcontroller 20 includes an embedded trace macrocell (ETM) 34, a trace funnel (ETF) 37, a trace port interface unit (TPIU) 35, and a CoreSight debug port (SWJ-DP, enabling communication via JTAG or SWD) 36 located outside the microprocessor 30.

[0047] Generally speaking, in operation, trace information is generated from the ETM 34, ITM 33 and DWT 32, and then collected by the trace funnel ETF 37. The TPIU 35 formats the data from these trace sources into packets and sends the data to the protocol manager 17 of the debug probe 14. The ITM 33 has the ability to provide a "printf" style console message interface to the debug probe 14, for example, via SWO. The ITM 33 also transmits messages of the DWT 32, and the ITM 33 can generate time stamp packets that are inserted into the trace stream. The DWT 32 has a variety of functions and provides profiling and timing verification, and can trigger the ETM 34.

[0048] The ETM 34 is used to provide instruction tracing. To reduce the amount of data generated, the ETM 34 does not always output exactly the address that the processing core 31 has reached / executed. The ETM 34 may output information about program flow, such as how many instructions have been executed or skipped since the last message, and may output a complete address or a change in address change.

[0049] The ETM 34 outputs are routed to the TPIU 35 which passes them to the protocol manager 17 of the debug probe 14. The TPIU 35 can support two output modes, namely: a double data rate clock mode which uses a parallel data output port with a clock speed equal to half the system core clock and a port width of up to 4 bits (on Cortex TM -M3 or M4 core microcontrollers, but may vary for other microcontroller families); and SWV (Serial Wire Viewer) mode, which uses a single-bit UART-style output through SWO.

[0050] The operation of synchronizing the trace data with the current draw measurement is as follows. Beginning at the start of the operation, the host computer 12 instructs the debug probe 14 to send instructions to the microcontroller 20 to begin performing debug tracing, wherein the debug trace timestamps are enabled. These instructions are sent from the host computer 12 to the protocol manager 17 within the microcontroller 20, which in turn transmits the instructions to the debug port 36 via the SWDIO pin. These instructions are in turn written to the ITM 33, thereby configuring debug tracing. Debug trace data flows from the DWT 32 to the ITM 33, to the TPIU 35, for transmission to the protocol manager 17 of the debug probe 14 via the SWO pin. The protocol manager 17 transmits trace data packets to the host 12, wherein each trace data packet includes the current debug trace timestamp. The debug trace operation is first started, as shown in FIG. Figure 5 as shown in .

[0051] The host computer 12 then starts to periodically (e.g., every 100 ms) send synchronization requests SYNC REQ to the synchronization manager 16 of the debug probe 14, and the synchronization manager 16 retrieves the current power collection cycle number from the power collection circuit 15—each sample of PWR is numbered sequentially, and the current power collection cycle number is the number of the current sample of PWR.

[0052] The synchronization manager 16 in turn sends the current power collection cycle number to the protocol manager 17, which assembles a synchronization request (including the current power collection cycle number) and transmits it via the SWDIO pin to the debug port 16 within the microcontroller 20. As each synchronization request is received by the debug port 36, a request confirmation is sent back to the protocol manager 17 via the SWDIO pin.

[0053] The synchronization manager 16 measures the number of power consumption samples between sending a synchronization request and an acknowledgement. The result of this measurement is the measured latency, which indicates the quality. The lower the latency, the more accurate the synchronization between the tracking data and the power consumption samples; the higher the latency, the less accurate the synchronization between the tracking data and the power consumption samples.

[0054] Synchronization requests and their confirmations (collectively referred to as synchronization recording) begin after debug trace recording begins, such as Figure 3 - Note that the sampling of the power consumption PWR is started by the power acquisition block 15 shortly after the debug trace recording starts, as shown in Figure 3 as shown in .

[0055] The synchronization request received at the debug port 16 is then written to a register within the ITM 33. In response to the synchronization request, the ITM 35 generates an ITM message containing the current power acquisition cycle and the associated debug trace timestamp. The ITM message is passed from the ITM 33 to the TPIU 35, which transmits the ITM message to the protocol manager 17 of the debug probe 14 via the SWO pin. These ITM messages are transmitted by the protocol manager 17 of the debug probe 14 to the host 12.

[0056] The protocol manager 17 receives the trace data packets as well as the ITM messages and passes them on to the host 12 upon receipt. This means that the data flow from the protocol manager 17 to the host 12 includes the ITM messages from the MCU 20 interleaved with the trace data packets. Figure 4 A sample data stream of ITM messages (starting with ITM0, indicating that the ITM messages are generated at ITM channel 0) interleaved with trace data packets (including timestamp TS and debug comparator output COMP0 from debug comparator 0) is shown. For example, observe ITM data packet ITM0 0x1295bd (and its associated timestamp TS 0x13866f44), which is interleaved between trace data packet COMP0 0x0 (and its associated timestamp TS 0x131f012f) and trace data packet COMP0 0x1 (and its associated timestamp TS 0x13a34c53).

[0057] The host 12 reads the received trace data / ITM messages. Initially after booting, the host 12 uses linear regression to calculate the exact timestamp in the trace data where the power consumption sampling by the power acquisition block 16 begins - the start time. The ratio between the sampling rate used by the power acquisition block 16 and the processing core 31 frequency (derived from the stream of debug trace timestamps) is calculated. The starting point and ratio are used to align the power data and trace data waveforms. Figure 5Aligned power data waveform and trace data waveform samples can be observed in the , illustrating the low latency situation.

[0058] These operations can be performed in Figure 6 It is observed in the figure. Note that when the debug probe 14 sends the first synchronization message to the microcontroller 20, the power consumption sampling has not yet started. This is because, as mentioned above, the generation of the synchronization message is performed before the power consumption sampling starts. Figure 6 In the example of , by sending the third synchronization message, the power consumption sampling has started. Thereafter, for each synchronization message, there is information of the current power collection cycle number and the current processing core cycle, and alignment is performed as described above.

[0059] Assuming the latency (as described above) is low, e.g. Figure 5 As shown in the example of , this alignment is accurate enough to allow the host 12 to draw precise inferences between power consumption and the execution of certain processes / programs / code snippets.

[0060] Waveforms showing various aspects of operation are included in Figure 7 For example, Figure 7 A measure of synchronization quality is shown, which can be derived from the delays as described above. As can be observed in this figure, the synchronization quality is high, which means that accurate alignment between the power data and the tracking data waveforms is achieved using the hardware and operating techniques described above. Finally, it is clear that modifications and variations can be made to what has been described and illustrated herein without departing from the scope of the present disclosure as defined in the appended claims.

[0061] While the present disclosure has been described with respect to a limited number of embodiments, those skilled in the art having benefit of this disclosure will appreciate that other embodiments can be conceived which do not depart from the scope of the present disclosure as disclosed herein. Accordingly, the scope of the present disclosure should be limited only by the appended claims.

Claims

1. A system, include: A microcontroller including a microprocessor; Debug probe; A host configured to send a debug instruction to the debug probe when the microcontroller is started, wherein the debug instruction, when executed by the microcontroller, starts to perform debug tracing in the microcontroller; wherein the debug probe is configured to send debug instructions to the microcontroller; wherein the microcontroller is configured to perform debug tracing according to the debug instruction to generate tracing data, the tracing data comprising a tracing data timestamp; The debug probe is further configured to: receive a power signal from the host; and sample the power signal and provide the power signal to the microcontroller, wherein each sampling of the power signal occurs during a different power collection cycle; Wherein the host is further configured to periodically send synchronization requests to the debug probe; Wherein the debug probe is further configured to, in response to receiving each synchronization request: retrieve a current power harvesting cycle number; generate an intermediate synchronization request; and send the intermediate synchronization request to the microcontroller; wherein the microcontroller is further configured to, in response to receiving each intermediate synchronization request, send a message to the debug probe, the message including the current execution cycle number of the microprocessor and an associated cycle number timestamp; Wherein the debug probe is further configured to: send trace data to the host; send messages to the host; and send sampled power signals to the host; Where the host is configured as; determining a trace data timestamp at which sampling of the power signal within the trace data begins; deriving the frequency of the microprocessor from the trace data; determining a ratio between a sampling rate of the power signal and a frequency of the microprocessor; as well as The samples of the trace data and the power signal are aligned based on the ratio and a trace data timestamp within the trace data at which sampling of the power signal begins.

2. The system of claim 1, wherein the debug probe comprises a power harvesting circuit for sampling the power signal.

3. The system of claim 1 , wherein the debug probe comprises a protocol manager that retrieves a current power acquisition cycle number, generates an intermediate synchronization request, sends the intermediate synchronization request to a microcontroller; sends trace data to a host, sends a message to the host, and sends a sampled power signal to the host.

4. The system of claim 3, wherein the protocol manager sends the intermediate synchronization request to the microcontroller via a serial wire debug (SWD) protocol; wherein the microcontroller sends the message to the debug probe via a UART protocol (SWO) and sends the trace data to the debug probe via the SWD protocol.

5. The system of claim 4, wherein the message is generated within an instrument trace macrocell (ITM) within a microcontroller.

6. The system of claim 3, wherein the debug probe comprises a power collection circuit for sampling the power signal ; wherein the microcontroller is further configured to send a request confirmation to the debug probe upon receipt of each intermediate synchronization request; wherein the synchronization manager is further configured to measure the number of power harvesting cycles between the sending of each intermediate synchronization request and the receiving of each request confirmation, and determine the latency based thereon; The latency indicates the accuracy of the alignment between the tracking data and the samples of the power signal.

7. A method for aligning trace data and power consumption data in a debugging system, the method include: Sending a debugging instruction to a microcontroller in the debugging system, wherein the debugging instruction starts to perform debugging tracing when executed by the microcontroller; receiving a power signal from a host computer in the debugging system; sampling the power signal and providing the power signal to the microcontroller, each sampling of the power signal occurs during a different power collection cycle; In response to receiving each of the plurality of periodic synchronization requests: retrieving a current power harvesting cycle number; Generate intermediate synchronization request; and sending an intermediate synchronization request to the microcontroller; receiving trace data from the microcontroller, the trace data including a trace data timestamp; receiving, in response to each sending of the intermediate synchronization request, a message from the microcontroller, the message including a current execution cycle number of a microprocessor within the microcontroller and an associated cycle number timestamp; as well as The tracing data is sent to the host, the message is sent to the host, and the sampled power signal is sent to the host so that the host aligns the samples of the tracing data and the power signal based on the tracing data timestamp at which the sampling of the power signal within the tracing data begins and the ratio between the sampling rate of the power signal and the frequency of the microprocessor.

8. The method of claim 7, further comprising deriving a frequency of the microprocessor from the trace data.

9. The method according to claim 7, further comprising: include: receiving a request acknowledgement in response to sending each intermediate synchronization request to the microcontroller; measuring the number of power harvesting cycles between the sending of each intermediate synchronization request and the receiving of each request acknowledgement and determining the latency based thereon; as well as The accuracy of the alignment between the tracking data and the power signal samples is determined based on the time delay.

10. A method for aligning trace data and power consumption data in a debugging system, the method include: When the microcontroller in the debugging system is started, a debugging instruction is sent from the host in the debugging system to the debugging probe in the debugging system, and when the debugging instruction is executed by the microcontroller, the debugging trace is started; Transfer debug instructions from the debug probe to the microcontroller; performing debug tracing at the microcontroller according to the debug instructions to generate trace data, the trace data including a trace data timestamp; receiving a power signal from a host at a debug probe; sampling a power signal at a debug probe and providing the power signal to a microcontroller, each sampling of the power signal occurring during a different power collection cycle; Periodically send synchronization requests from the host to the debug probe; In response to receiving each synchronization request at the debug probe: retrieving a current power harvesting cycle number; Generate intermediate synchronization request; and sending intermediate synchronization requests from the debug probe to the microcontroller; In response to receiving each intermediate synchronization request at the microcontroller, sending a message to the debug probe, the message including a current execution cycle number of a microprocessor within the microcontroller and an associated cycle number timestamp; Sends trace data from the debug probe to the host; Send messages from the debug probe to the host; sending a sampled power signal from the debug probe to a host; determining, at the host, a trace data timestamp at which a sampling of the power signal within the trace data begins; deriving, at the host computer, a frequency of the microprocessor from the trace data; determining, at the host computer, a ratio between a sampling rate of the power signal and a frequency of the microprocessor; as well as The trace data and samples of the power signal are aligned at the host based on the ratio and a trace data timestamp within the trace data at which sampling of the power signal begins.

11. The method according to claim 10, further comprising: include: After each intermediate synchronization request is received at the microcontroller, a request confirmation is sent to the debug probe; as well as measuring, at the debug probe, a number of power harvesting cycles between the sending of each intermediate synchronization request and the receiving of each request acknowledgement, and determining latency based thereon; The latency indicates the accuracy of the alignment between the tracking data and the samples of the power signal.

12. A system, include: A microcontroller including a microprocessor; Debug probe; Host; wherein the microcontroller is configured to perform debug tracing to generate trace data, the trace data comprising a trace data timestamp; Wherein the debug probe is further configured to: receive a power signal from the host; and sampling the power signal and providing the power signal to the microcontroller, each sampling of the power signal occurring during a different power collection cycle; Wherein the host is further configured to periodically send synchronization requests to the debug probe; Wherein the debug probe is further configured to, in response to receiving each synchronization request: retrieve a current power harvesting cycle number; generate an intermediate synchronization request; and send the intermediate synchronization request to the microcontroller; wherein the microcontroller is further configured to, in response to receiving each intermediate synchronization request, send a message to the debug probe, the message including the current execution cycle number of the microprocessor and an associated cycle number timestamp; Wherein the debug probe is further configured to: send trace data to the host; send messages to the host; and send sampled power signals to the host; as well as The host is configured to align samples of the trace data and the power signal based on a trace data timestamp at which a sample of the power signal begins within the trace data, the trace data, and a sampling rate of the power signal.

13. The system of claim 12, wherein the host is configured to align samples of the trace data and the power signal based on a ratio between a sampling rate of the power signal and a frequency of the microprocessor and based on a trace data timestamp at which sampling of the power signal begins within the trace data.

14. The system of claim 12, wherein the debug probe comprises a power harvesting circuit that samples the power signal.

15. The system of claim 12, wherein the debug probe comprises a protocol manager that retrieves a current power acquisition cycle number, generates an intermediate synchronization request, sends the intermediate synchronization request to the microcontroller; and sends trace data to the host, sends messages to the host, and sends sampled power signals to the host.

16. The system of claim 15, wherein the protocol manager sends the intermediate synchronization request to the microcontroller via a serial wire debug (SWD) protocol; wherein the microcontroller sends the message to the debug probe via a UART protocol (SWO) and sends the trace data to the debug probe via the SWD protocol.

17. The system of claim 16, wherein the message is generated within an instrument trace macrocell (ITM) within a microcontroller.

18. The system of claim 15, wherein the debug probe comprises a power collection circuit for sampling the power signal ; wherein the microcontroller is further configured to send a request confirmation to the debug probe upon receipt of each intermediate synchronization request; wherein the synchronization manager is further configured to measure the number of power harvesting cycles between the sending of each intermediate synchronization request and the receiving of each request confirmation, and determine the latency based thereon; The latency indicates the accuracy of the alignment between the tracking data and the samples of the power signal.