|
读取这个异常,这还不太会分析,这个黑盒子功能还没玩过,要好好研究一下来
2023-02-23 V1.0
写内存失败 0xE000EDF0
============================================================
=========寄存器值读取========================================
============================================================
写内存失败 0xE000EDF4
读内存失败 0xE000EDF0
读内存失败 0xE000EDF8
R0 = 0040bba6
写内存失败 0xE000EDF4
读内存失败 0xE000EDF0
读内存失败 0xE000EDF8
R1 = 0040bba6
写内存失败 0xE000EDF4
读内存失败 0xE000EDF0
读内存失败 0xE000EDF8
R2 = 0040bba6
写内存失败 0xE000EDF4
读内存失败 0xE000EDF0
读内存失败 0xE000EDF8
R3 = 0040bba6
写内存失败 0xE000EDF4
读内存失败 0xE000EDF0
读内存失败 0xE000EDF8
R4 = 0040bba6
写内存失败 0xE000EDF4
读内存失败 0xE000EDF0
读内存失败 0xE000EDF8
R5 = 0040bba6
写内存失败 0xE000EDF4
读内存失败 0xE000EDF0
读内存失败 0xE000EDF8
R6 = 0040bba6
写内存失败 0xE000EDF4
读内存失败 0xE000EDF0
读内存失败 0xE000EDF8
R7 = 0040bba6
写内存失败 0xE000EDF4
读内存失败 0xE000EDF0
读内存失败 0xE000EDF8
R8 = 0040bba6
写内存失败 0xE000EDF4
读内存失败 0xE000EDF0
读内存失败 0xE000EDF8
R9 = 0040bba6
写内存失败 0xE000EDF4
读内存失败 0xE000EDF0
读内存失败 0xE000EDF8
R10 = 0040bba6
写内存失败 0xE000EDF4
读内存失败 0xE000EDF0
读内存失败 0xE000EDF8
R11 = 0040bba6
写内存失败 0xE000EDF4
读内存失败 0xE000EDF0
读内存失败 0xE000EDF8
R12 = 0040bba6
写内存失败 0xE000EDF4
读内存失败 0xE000EDF0
读内存失败 0xE000EDF8
R13(SP) = 0040bba6
写内存失败 0xE000EDF4
读内存失败 0xE000EDF0
读内存失败 0xE000EDF8
R14(LR) = 0040bba6
写内存失败 0xE000EDF4
读内存失败 0xE000EDF0
读内存失败 0xE000EDF8
R15(PC) = 0040bba6
写内存失败 0xE000EDF4
读内存失败 0xE000EDF0
读内存失败 0xE000EDF8
xPSR = 0040bba6
写内存失败 0xE000EDF0
读内存失败 0xE000ED24
------------------------------------------------------------------
Read System Handler Control and State Register SHCSR = 0x0040bba6
------------------------------------------------------------------
MEMFAULTACT = 0
BUSFAULTACT = 1, BusFault 异常被触发
USGFAULTACT = 0
SVCALLACT = 1, SVC 中断被触发
MONITORACT = 1, Debug monitor 被触发
PENDSVACT = 0
SYSTICKACT = 1, SYSTICK 中断触发
USGFAULTPENDED = 1, UsageFault 异常挂起bit被设置
MEMFAULTPENDED = 1, Memory Management Fault 异常挂起bit被设置
BUSFAULTPENDED = 0
SVCALLPENDED = 1, SVC 中断挂起bit被设置
MEMFAULTENA = 0
BUSFAULTENA = 0
USGFAULTENA = 0
读内存失败 0xE000ED2C
------------------------------------------------------------------
Read HardFault Status Register HSFR Register = 0x0040bba6
------------------------------------------------------------------
VECTBL = 1, 中断向量表读取有Bus Fault
Indicates a Bus Fault on a vector table read during exception processing
When this bit is set, the PC value stacked for the exception return points
to the instruction that was preempted by the exception. This error is always
a Hard Fault
FORCED = 0, no forced Hard Fault
读内存失败 0xE000ED28
------------------------------------------------------------------
MemManage Status Register (MMFSR) = 0xa6
------------------------------------------------------------------
IACCVIOL = 0, 无指令访问冲突错误
DACCVIOL = 1, 有数据访问异常
the processor attempted a load or store at a location that does not permit the operation.
The PC value stacked for the exception return points to the faulting instruction. The processor
has loaded the MMFAR with the address of the attempted access
MUNSTKERR = 0, 出栈正常
MSTKERR = 0, 入栈正常
MLSPERR = 1, 浮点lazy stacking特性保存期间生故障
fault occurred during floating-point lazy state preservation
The PC value stacked for the exception return points to the faulting instruction. The processor
MemManage fault during floating point lazy state preservation, only Cortex-M with FPU
MMARVALID = 1, SCB->MMFAR寄存器记录了有效的异常地址
SCB->MMFAR holds a valid fault address
If a MemManage fault occurs and is escalated to a HardFault because of priority, the HardFault
handler must set this bit to 0. This prevents problems on return to a stacked active MemManage
fault handler whose SCB->MMFAR value has been overwritten
读内存失败 0xE000ED34
------------------------------------------------------------------
MemManage Address Register (MMFAR) = 0x0040bba6
------------------------------------------------------------------
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
读内存失败 0xE000ED29
------------------------------------------------------------------
BusFault Status Register (BFSR) = 0xa6
------------------------------------------------------------------
IBUSERR = 0, 指令总线正常
PRECISERR = 1, 精确的数据总线访问异常
a data bus error has occurred, and the PC value stacked for the exception return points to
the instruction that caused the fault.
When the processor sets this bit, it writes the faulting address to BFAR.
IMPRECISERR = 1, 不精确的数据总线访问异常
a data bus error has occurred, but the return address in the stack frame is not related to the
instruction that caused the error.
When the processor sets this bit it does not write a fault address to BFAR. This is an
asynchronous fault. Therefore, if it is detected when the priority of the current process is higher
than the BusFault priority, the BusFault becomes pending and becomes active only when the
processor returns from all higher priority processes. If a precise fault occurs before the
processor enters the handler for the imprecise BusFault, the handler detects both IMPRECISERR
set to 1 and one of the precise fault status bits set to 1
UNSTKERR = 0, 中断出栈时正常
STKERR = 0, 中断入栈时正常
LSPERR = 1, 浮点lazy stacking特性保存期间生故障
fault occurred during floating-point lazy state preservation
BusFault during floating point lazy state preservation (only when FPU present)
BFARVALID = 1, BFAR寄存器记录有效的异常地址
The processor sets this bit after a BusFault where the address is known. Other faults can set this
bit to 0, such as a MemManage fault occurring later. If a BusFault occurs and is escalated to a
HardFault because of priority, the HardFault handler must set this bit to 0. This prevents
problems if returning to a stacked active BusFault handler who is BFAR value has been
overwritten.
读内存失败 0xE000ED38
------------------------------------------------------------------
BusFault Address Register (BFAR) = 0x0040bba6
------------------------------------------------------------------
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
读内存失败 0xE000ED2A
------------------------------------------------------------------
UsageFault Status Register (UFSR) = 0xbba6
------------------------------------------------------------------
UNDEFINSTR = 0, 处理器访问指令正常
INVSTATE = 1, 无效状态
the processor has attempted to execute an instruction that makes illegal use of the
Execution Program Status Register (EPSR).
When this bit is set, the PC value stacked for the exception return points to the instruction that
attempted the illegal use of the EPSR. Potential reasons:
a) Loading a branch target address to PC with LSB=0.
b) Stacked PSR corrupted during exception or interrupt handling
c) Vector table contains a vector address with LSB=0.
INVPC = 1, 无效的PC加载
the processor has attempted to load an illegal EXC_RETURN value to the PC as a result of an
invalid context switch
When this bit is set, the PC value stacked for the exception return points to the instruction that
tried to perform the illegal load of the PC. Potential reasons:
a) Invalid return due to corrupted stack pointer, link register (LR), or stack content.
b) ICI/IT bit in PSR invalid for an instruction.
NOCP = 0, 访问协处理正常
UNALIGNED = 1, 内存非对齐访问异常
the processor has made an unaligned memory access
Enable trapping of unaligned accesses by setting the UNALIGN_TRP bit in the CCR. Unaligned
LDM, STM, LDRD, and STRD instructions always fault irrespective of the setting of UNALIGN_TRP bit
DIVBYZERO = 1, 除数为0时, 支持SDIV或者UDIV异常
the processor has executed an SDIV or UDIV instruction with a divisor of 0.
When the processor sets this bit to 1, the PC value stacked for the exception return points to the
instruction that performed the divide by zero. Enable trapping of divide by zero by setting the
DIV_0_TRP bit in the CCR to 1
============================================================
=========异常进一步分析======================================
============================================================
进入硬件异常前, 寄存器数值, 如果出现非精确异常, 这些值是不准确的:
读内存失败 0x0040BBA6
R0 = 0040bba6
读内存失败 0x0040BBAA
R1 = 0040bba6
读内存失败 0x0040BBAE
R2 = 0040bba6
读内存失败 0x0040BBB2
R3 = 0040bba6
读内存失败 0x0040BBB6
R12 = 0040bba6
读内存失败 0x0040BBBA
LR = 0040bba6
读内存失败 0x0040BBBE
PC = 0040bba6
读内存失败 0x0040BBC2
PSR = 0040bba6 |
|