Clone of official tools

Committer:
theotherjimmy
Date:
Tue Sep 25 13:43:09 2018 -0500
Revision:
43:2a7da56ebd24
Release 5.10.0

Who changed what in which revision?

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