出现硬foult后,我查了下Hard Fault Status:HFAULTSTAT=0x6000_0000,Configurable Fault Status :FAULTSTAT=0x0002_0000,按这个错误提示好像是EPSR中的THUMB位改变了引起的硬件foult。但是在调试的时候THUMB一直是1。
THUMB 1 EPSR Thumb State. This bit indicates the Thumb state and should always be set. The following can clear the THUMB bit:
• The BLX, BX and POP{PC} instructions
• Restoration from the stacked xPSR value on an exception return
• Bit 0 of the vector value on an exception entry
Attempting to execute instructions when this bit is clear results in a fault or lockup. See “Lockup” on
page 116 for more information.
The value of this bit is only meaningful when accessing PSR or EPSR.
上面这段是EPSR.THUMB位的说明,难道用了BLX, BX, POP{PC}都会出现这个问题,那不是子程序都返回不了了?