# Analysis tool for mcu **Repository Path**: wangrenai/analysis-tool-for-mcu ## Basic Information - **Project Name**: Analysis tool for mcu - **Description**: 用于调试单片机程序死机跑飞问题,比如触发ARM单片机Hardfault,通过分析调用栈定位是哪个函数哪一行代码导致的。 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 14 - **Created**: 2024-11-18 - **Last Updated**: 2024-11-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # MCU Analysis Tool #### Introduction This tool is designed for debugging MCU (Microcontroller Unit) issues like program crashes or runaway problems. For example, it helps analyze ARM MCU Hardfaults by tracing the call stack to locate the specific function and code line that caused the fault. #### Software Architecture The software is structured as follows: - `GUI.py`: Main interface program responsible for processing input information, displaying output, and handling callback functions for various GUI components. - `jlink_operations.py`: Contains the main functions that interact with the Jlink library, primarily to drive Jlink and access MCU register information. - `stack_tracer.py`: Main implementation of stack tracing. It analyzes MCU register information and compiled output to trace the call stack and obtain stack trace information. #### Installation Instructions This is a packaged executable with a GUI interface that does not require installation. Simply run the program directly. #### Usage Instructions 1. Select the DLL file: Click the "Browse" button and navigate to the Jlink driver installation path to open “JLink_x64.dll”. 2. Select the `.axf` file: Go to the "Object" folder in the project build directory and open the corresponding `.axf` file. 3. Select the `.map` file: Go to the "Listings" folder in the project build directory and open the corresponding `.map` file. 4. Configure the stack analysis start address and the length to be analyzed, if needed. The default address is `0x20000000`, with a length of `0x4000`. 5. Click "Extract" to retrieve register information. The log output window will display corresponding start-up process information and register details, and the register data will be saved. 6. Click "Analyze" to examine the cause using register information and the `.axf` and `.map` files. The analysis results and process information will also appear in the log output. #### Contributing 1. Fork this repository. 2. Create a new branch, Feat_xxx. 3. Commit your code. 4. Create a Pull Request.