|
|

楼主 |
发表于 2025-10-7 13:42:16
|
显示全部楼层
2023-02-23 V1.0
============================================================
=========寄存器值读取========================================
============================================================
R0 = 00000000
R1 = 00000000
R2 = 00000000
R3 = 00000000
R4 = 00000000
R5 = 00000000
R6 = 00000000
R7 = 00000000
R8 = 00000000
R9 = 00000000
R10 = 00000000
R11 = 00000000
R12 = 00000000
R13(SP) = 4c05b4f0
R14(LR) = fffffff9
R15(PC) = f3af4804
xPSR = 00000003
------------------------------------------------------------------
Read System Handler Control and State Register SHCSR = 0x00000000
------------------------------------------------------------------
MEMFAULTACT = 0
BUSFAULTACT = 0
USGFAULTACT = 0
SVCALLACT = 0
MONITORACT = 0
PENDSVACT = 0
SYSTICKACT = 0
USGFAULTPENDED = 0
MEMFAULTPENDED = 0
BUSFAULTPENDED = 0
SVCALLPENDED = 0
MEMFAULTENA = 0
BUSFAULTENA = 0
USGFAULTENA = 0
------------------------------------------------------------------
Read HardFault Status Register HSFR Register = 0x40000000
------------------------------------------------------------------
VECTBL = 0, 中断向量表无Bus Fault
FORCED = 1, forced Hard Fault
Indicates a forced Hard Fault, generated by escalation of a fault with configurable
priority that cannot be handled, either because of priority or because it is disabled
When this bit is set, the Hard Fault handler must read the other fault status registers
to find the cause of the fault
------------------------------------------------------------------
MemManage Status Register (MMFSR) = 0x01
------------------------------------------------------------------
IACCVIOL = 1, 有指令访问冲突错误
the processor attempted an instruction fetch from a location that does
not permit execution. The PC value stacked for the exception return points to the faulting
instruction. The processor has not written a fault address to the MMFAR. This fault condition
occurs on any attempt of instruction fetches to an XN (eXecute Never) region, even when the MPU
is disabled or not present. Potential reasons
a) Branch to regions that are not defined in the MPU or defined as non-executable.
b) Invalid return due to corrupted stack content.
c) Incorrect entry in the exception vector table.
DACCVIOL = 0, 无数据访问异常
MUNSTKERR = 0, 出栈正常
MSTKERR = 0, 入栈正常
MLSPERR = 0, 浮点lazy stacking特性保存期间未发生故障
MMARVALID = 0, SCB->MMFAR寄存器没有记录异常地址
------------------------------------------------------------------
MemManage Address Register (MMFAR) = 0xe000edf8
------------------------------------------------------------------
Data address for a MemManage fault. This register is updated with the address of a location
that produced a MemManage fault. The MMFSR shows the cause of the fault. This field is valid
only when MMFSR.MMARVALID is set. In implementations without unique BFAR and MMFAR
registers, the value of this register is UNKNOWN if BFSR.BFARVALID is set
------------------------------------------------------------------
BusFault Status Register (BFSR) = 0x10
------------------------------------------------------------------
IBUSERR = 0, 指令总线正常
PRECISERR = 0, 数据总线正常
IMPRECISERR = 0, 数据总线正常
UNSTKERR = 0, 中断出栈时正常
STKERR = 1, 中断入栈时异常
stacking for an exception entry has caused one or more BusFaults
When the processor sets this bit, the SP is still adjusted but the values in the context area on the
stack might be incorrect. The processor does not write a fault address to the BFAR. Potential
reasons:
a) Stack pointer is corrupted or not initialized
b) Stack is reaching an undefined memory region.
LSPERR = 0, 浮点lazy stacking特性保存期间未生故障
BFARVALID = 0, BFAR寄存器未记录有效的异常地址
------------------------------------------------------------------
BusFault Address Register (BFAR) = 0xe000edf8
------------------------------------------------------------------
Data address for a precise BusFault. This register is updated with the address of a location that
produced a BusFault. The BFSR shows the reason for the fault. This field is valid only when
BFSR.BFARVALID is set. In implementations without unique BFAR and MMFAR registers, the
value of this register is UNKNOWN if MMFSR.MMARVALID is set
------------------------------------------------------------------
UsageFault Status Register (UFSR) = 0x0000
------------------------------------------------------------------
UNDEFINSTR = 0, 处理器访问指令正常
INVSTATE = 0, 没有无效状态
INVPC = 0, PC加载正常
NOCP = 0, 访问协处理正常
UNALIGNED = 0, 内存对齐访问正常
DIVBYZERO = 0, 无除数为0的异常, 或者没有使能除数为0的异常
============================================================
=========异常进一步分析======================================
============================================================
进入和退出中断使用MSP, 返回线程模式, 进入中断前没有使用硬件浮点单元
进入硬件异常前, 寄存器数值, 如果出现非精确异常, 这些值是不准确的:
读内存失败 0x4C05B4F0
R0 = 0040bc12
读内存失败 0x4C05B4F4
R1 = 0040bc12
读内存失败 0x4C05B4F8
R2 = 0040bc12
读内存失败 0x4C05B4FC
R3 = 0040bc12
读内存失败 0x4C05B500
R12 = 0040bc12
读内存失败 0x4C05B504
LR = 0040bc12
读内存失败 0x4C05B508
PC = 0040bc12
读内存失败 0x4C05B50C
PSR = 0040bc12
|
|