Advanced fault backtrace library for ARM Cortex-M series MCU logo

Advanced fault backtrace library for ARM Cortex-M series MCU

Free

Advanced fault backtrace library for ARM Cortex-M series MCU

FreeFree tier
Type
Open Source

About Advanced fault backtrace library for ARM Cortex-M series MCU

CmBacktrace (Cortex Microcontroller Backtrace) is an open source library for ARM Cortex-M series MCUs that automatically tracks and locates error codes and analyzes the causes of faults. It supports faults such as Assert, Hard Fault, Memory Management Fault, Bus Fault, Usage Fault, and Debug Fault. The library automatically diagnoses the failure reason, outputs the function call stack of the error site (requires addr2line tool for precise positioning), and restores the field information when the error occurred. It supports bare metal and RTOS platforms including RT-Thread, UCOS, and FreeRTOS (with source modification). Fault diagnosis information is available in multiple languages (Simplified Chinese and English). It adapts to Cortex-M0/M3/M4/M7 MCUs and supports IAR, KEIL, and GCC compilers.

Key Features

Automatic fault diagnosis for Hard Fault, Memory Management Fault, Bus Fault, Usage Fault, Debug Fault, and Assert
Outputs function call stack of the error site when used with addr2line tool
Supports bare metal and RTOS: RT-Thread, UCOS, FreeRTOS (with source modification)
Multi-language fault diagnosis (Simplified Chinese and English)
Adapts to Cortex-M0/M3/M4/M7 MCUs
Supports IAR, KEIL, GCC compilers
Can be used under normal conditions to retrieve current function call stack
Outputs corresponding thread stack or C main stack based on error scene status

Pros & Cons

Pros
  • Automatically analyzes failure cause without manual register inspection
  • Supports multiple RTOS and bare metal environments
  • Works with common compilers and MCU families
  • Open source and free to use
  • Provides clear call stack and fault register dump for quick debugging
Cons
  • Precise stack trace requires external addr2line tool for symbol resolution
  • FreeRTOS support requires source code modification
  • Limited to ARM Cortex-M series MCUs; not applicable to other architectures
  • Documentation primarily in Chinese, though English version is available

Best For

Debugging hard faults and other ARM Cortex-M exceptions without an emulatorLocating the exact code address and function call chain when a crash occursAnalyzing complex, hard-to-reproduce bugs in embedded systemsProviding error logging for post-crash analysis (e.g., via EasyFlash)Helping newcomers transition from simple MCUs to ARM Cortex-M