![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Color Oled(SSD1331) connect to STMicroelectronics Nucleo-F466
mbed-os/tools/debug_tools/crash_log_parser/README.md@0:8fdf9a60065b, 2018-10-10 (annotated)
- Committer:
- kadonotakashi
- Date:
- Wed Oct 10 00:33:53 2018 +0000
- Revision:
- 0:8fdf9a60065b
how to make mbed librry
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kadonotakashi | 0:8fdf9a60065b | 1 | ## Crash Log Parser Tool |
kadonotakashi | 0:8fdf9a60065b | 2 | This post-processing tool can be used to parse crash log generated by Mbed-OS when an exception happens. |
kadonotakashi | 0:8fdf9a60065b | 3 | |
kadonotakashi | 0:8fdf9a60065b | 4 | ## Capturing crash log |
kadonotakashi | 0:8fdf9a60065b | 5 | When an exception happens Mbed-OS will print out the crash information to STDOUT. |
kadonotakashi | 0:8fdf9a60065b | 6 | The crash information contains register context at the time exception and current threads in the system. |
kadonotakashi | 0:8fdf9a60065b | 7 | The information printed out to STDOUT will be similar to below. Registers captured depends on specific |
kadonotakashi | 0:8fdf9a60065b | 8 | Cortex-M core you are using. For example, if your target is using Cortex-M0, some registers like |
kadonotakashi | 0:8fdf9a60065b | 9 | MMFSR, BFSR, UFSR may not be available and will not appear in the crash log. |
kadonotakashi | 0:8fdf9a60065b | 10 | |
kadonotakashi | 0:8fdf9a60065b | 11 | ++ MbedOS Fault Handler ++ |
kadonotakashi | 0:8fdf9a60065b | 12 | |
kadonotakashi | 0:8fdf9a60065b | 13 | FaultType: HardFault |
kadonotakashi | 0:8fdf9a60065b | 14 | |
kadonotakashi | 0:8fdf9a60065b | 15 | Context: |
kadonotakashi | 0:8fdf9a60065b | 16 | R0 : 0000AAA3 |
kadonotakashi | 0:8fdf9a60065b | 17 | R1 : 20002070 |
kadonotakashi | 0:8fdf9a60065b | 18 | R2 : 00009558 |
kadonotakashi | 0:8fdf9a60065b | 19 | R3 : 00412A02 |
kadonotakashi | 0:8fdf9a60065b | 20 | R4 : E000ED14 |
kadonotakashi | 0:8fdf9a60065b | 21 | R5 : 00000000 |
kadonotakashi | 0:8fdf9a60065b | 22 | R6 : 00000000 |
kadonotakashi | 0:8fdf9a60065b | 23 | R7 : 00000000 |
kadonotakashi | 0:8fdf9a60065b | 24 | R8 : 00000000 |
kadonotakashi | 0:8fdf9a60065b | 25 | R9 : 00000000 |
kadonotakashi | 0:8fdf9a60065b | 26 | R10 : 00000000 |
kadonotakashi | 0:8fdf9a60065b | 27 | R11 : 00000000 |
kadonotakashi | 0:8fdf9a60065b | 28 | R12 : 0000BCE5 |
kadonotakashi | 0:8fdf9a60065b | 29 | SP : 20002070 |
kadonotakashi | 0:8fdf9a60065b | 30 | LR : 00009E75 |
kadonotakashi | 0:8fdf9a60065b | 31 | PC : 00009512 |
kadonotakashi | 0:8fdf9a60065b | 32 | xPSR : 01000000 |
kadonotakashi | 0:8fdf9a60065b | 33 | PSP : 20002008 |
kadonotakashi | 0:8fdf9a60065b | 34 | MSP : 2002FFD8 |
kadonotakashi | 0:8fdf9a60065b | 35 | CPUID: 410FC241 |
kadonotakashi | 0:8fdf9a60065b | 36 | HFSR : 40000000 |
kadonotakashi | 0:8fdf9a60065b | 37 | MMFSR: 00000000 |
kadonotakashi | 0:8fdf9a60065b | 38 | BFSR : 00000000 |
kadonotakashi | 0:8fdf9a60065b | 39 | UFSR : 00000100 |
kadonotakashi | 0:8fdf9a60065b | 40 | DFSR : 00000008 |
kadonotakashi | 0:8fdf9a60065b | 41 | AFSR : 00000000 |
kadonotakashi | 0:8fdf9a60065b | 42 | SHCSR: 00000000 |
kadonotakashi | 0:8fdf9a60065b | 43 | |
kadonotakashi | 0:8fdf9a60065b | 44 | Thread Info: |
kadonotakashi | 0:8fdf9a60065b | 45 | Current: |
kadonotakashi | 0:8fdf9a60065b | 46 | State: 00000002 EntryFn: 0000ADF5 Stack Size: 00001000 Mem: 20001070 SP: 20002030 |
kadonotakashi | 0:8fdf9a60065b | 47 | Next: |
kadonotakashi | 0:8fdf9a60065b | 48 | State: 00000002 EntryFn: 0000ADF5 Stack Size: 00001000 Mem: 20001070 SP: 20002030 |
kadonotakashi | 0:8fdf9a60065b | 49 | Wait Threads: |
kadonotakashi | 0:8fdf9a60065b | 50 | State: 00000083 EntryFn: 0000AA1D Stack Size: 00000300 Mem: 20000548 SP: 200007D8 |
kadonotakashi | 0:8fdf9a60065b | 51 | Delay Threads: |
kadonotakashi | 0:8fdf9a60065b | 52 | Idle Thread: |
kadonotakashi | 0:8fdf9a60065b | 53 | State: 00000001 EntryFn: 00009F59 Stack Size: 00000200 Mem: 20000348 SP: 20000508 |
kadonotakashi | 0:8fdf9a60065b | 54 | |
kadonotakashi | 0:8fdf9a60065b | 55 | -- MbedOS Fault Handler -- |
kadonotakashi | 0:8fdf9a60065b | 56 | |
kadonotakashi | 0:8fdf9a60065b | 57 | |
kadonotakashi | 0:8fdf9a60065b | 58 | To generate more information copy and save this crash information to a text file and run the crash_log_parser.py tool as below. |
kadonotakashi | 0:8fdf9a60065b | 59 | NOTE: Make sure you copy the section with text "MbedOS Fault Handler" as the this tool looks for that header. |
kadonotakashi | 0:8fdf9a60065b | 60 | |
kadonotakashi | 0:8fdf9a60065b | 61 | ## Running the Crash Log Parser |
kadonotakashi | 0:8fdf9a60065b | 62 | crash_log_parser.py <Path to Crash log> <Path to Elf/Axf file of the build> <Path to Map file of the build> |
kadonotakashi | 0:8fdf9a60065b | 63 | For example: |
kadonotakashi | 0:8fdf9a60065b | 64 | crashlogparse.py crash.log C:\MyProject\BUILD\k64f\arm\mbed-os-hf-handler.elf C:\MyProject\BUILD\k64f\arm\mbed-os-hf-handler.map |
kadonotakashi | 0:8fdf9a60065b | 65 | |
kadonotakashi | 0:8fdf9a60065b | 66 | An example output from running crash_log_parser is shown below. |
kadonotakashi | 0:8fdf9a60065b | 67 | |
kadonotakashi | 0:8fdf9a60065b | 68 | Parsed Crash Info: |
kadonotakashi | 0:8fdf9a60065b | 69 | Crash location = zero_div_test() [0000693E] |
kadonotakashi | 0:8fdf9a60065b | 70 | Caller location = $Super$$main [00009E99] |
kadonotakashi | 0:8fdf9a60065b | 71 | Stack Pointer at the time of crash = [20001CC0] |
kadonotakashi | 0:8fdf9a60065b | 72 | Target/Fault Info: |
kadonotakashi | 0:8fdf9a60065b | 73 | Processor Arch: ARM-V7M or above |
kadonotakashi | 0:8fdf9a60065b | 74 | Processor Variant: C24 |
kadonotakashi | 0:8fdf9a60065b | 75 | Forced exception, a fault with configurable priority has been escalated to HardFault |
kadonotakashi | 0:8fdf9a60065b | 76 | Divide by zero error has occurred |
kadonotakashi | 0:8fdf9a60065b | 77 | |
kadonotakashi | 0:8fdf9a60065b | 78 | Done parsing... |
kadonotakashi | 0:8fdf9a60065b | 79 |