Instruction Trace Analysis and Enhanced Debugging in Embedded Systems

In many applications microcontrollers run preemptive real-time operating systems and have to fulfill high reliability and performance requirements. Debugging and an evaluation of such systems require low-level access to the microcontroller state at every execution point. The modern MCU architectures contain special hardware modules, which generate the instruction trace and transmit it via specific physical interfaces. The execution traces provide accurate details of the program’s dynamic behavior. The trace information allows recreating the software context of the each executed instruction including instruction address, type of instruction, sometimes instruction arguments or the relevant branch target address. The collected data can be used for tracing the program control flow, verification of operating system operations or reliability metrics measurement (including code coverage or availability). The paper presents the original low-cost trace analyzing system for cortex-m microcontrollers. The author proposes a new methodology for the automatic trace collection during multiple test executions. The developed system provides several types of the program trace analysis. One of them is an anomaly detection of a firmware execution. The anomaly detection is based on a commonly known clustering algorithm with the distance metric designed by the author and the trace data preparation method. The usefulness of the system has been experimentally verified while testing an original embedded system.

Author: Kazimierz Krosman
Conference: Title