S-Domain Fault Handler

芯片:RTL8720CF
运行过程中出现Fault Handler错误,如下

S-Domain Fault Handler: msp=0x1003f998 psp=0x10019f90 lr=0xfffffff1 fault_id=1

Usage Fault: 
SCB Configurable Fault Status Reg = 0x00020000

Usage Fault Status: 
Invalid state UsageFault, the processor has attempted to execute an instruction that makes illegal use of the EPSR

S-domain exception from Handler mode, Standard Stack frame on S-MSP
Registers Saved to stack

Stacked: 
R0  = 0x100296dc
R1  = 0x00000000
R2  = 0x9b022507
R3  = 0x00000001
R4  = 0x10008b90
R5  = 0x00000000
R6  = 0x40001000
R7  = 0x1003fd2c
R8  = 0x00000001
R9  = 0xa5a5a5a5
R10 = 0xa5a5a5a5
R11 = 0xa5a5a5a5
R12 = 0xa5a5a5a5
LR  = 0x0001ed27
PC  = 0x10008c08
PSR = 0x80000013

Current: 
LR   = 0xfffffff1
MSP  = 0x1003f9b8
PSP  = 0x10019f90
xPSR = 0x80000006
CFSR  = 0x00020000
HFSR  = 0x00000000
DFSR  = 0x00000000
MMFAR = 0x00000000
BFAR  = 0x00000000
AFSR  = 0x00000000
PriMask = 0x00000000
SVC priority: 0x00
PendSVC priority: 0xe0
Systick priority: 0xe0

MSP Data:
1003F9B8:    100296DC    00000000    9B022507    00000001
1003F9C8:    A5A5A5A5    0001ED27    10008C08    80000013
1003F9D8:    E000ED04    FFFFFFFD    00000000    E000E014
1003F9E8:    E000E010    100005F8    10008C94    9B01480B
1003F9F8:    9B0144C4    21000000    FE56C9AB    42FB48D7
1003FA08:    8BBBF33E    3EC2E531    06E9B9D7    9944D7AA
1003FA18:    771BFCE6    CA092470    767F8FA7    088451B3
1003FA28:    9ADEF79C    5041012F    C2EC4EB6    9150C005
1003FA38:    B1CDCF2E    62C10244    F4A9B343    28F7475E
1003FA48:    BDE87F09    2203112E    3F789D3F    826B008B
1003FA58:    3795F8AC    0B49666E    F25CF137    40CD9B91
1003FA68:    1F7DAE72    2E5760FF    49B812FB    0A5D9532
1003FA78:    A455EB3B    1391A677    3DFE7D77    0E607222
1003FA88:    786C7599    1D7084E2    2E3D47BE    07390909
1003FA98:    052408E3    1C590A06    1FBED37B    301B3B9E
1003FAA8:    96DFE3F3    24A97EA5    C97F9B7D    82172C32

PSP Data:
10019F90:    00000000    10019EA0    100005F8    00000001
10019FA0:    A5A5A5A5    9B0131F3    9B012A46    61000000
10019FB0:    A5A5A5A5    9B0144CD    A5A5A5A5    A5A5A5A5
10019FC0:    00000000    80000058    10019F6C    10019EA8
10019FD0:    18DD8D7B    10008ABC    10008ABC    10019FC8
10019FE0:    10008AB4    0000000B    E15FAEF6    18B80CE9
10019FF0:    10019FC8    00000000    00000000    454C4449
1001A000:    3D3DDE00    B0030003    00000000    00000000
1001A010:    00000000    01641600    00000000    800002F8
1001A020:    1001A06C    1001A30C    1001A14C    1001A13C
1001A030:    00000000    1001A038    FFFFFFFF    1001A038
1001A040:    1001A038    00000001    1001A04C    FFFFFFFF
1001A050:    1001AB3C    1001AB3C    00000000    0000002A
1001A060:    00000010    AD3BFFFF    00000000    00000004
1001A070:    000003E8    10022370    00000000    00000004
1001A080:    000007D0    1001FA90    00000000    00000004

 == NS Dump ==
CFSR_NS  = 0x00000000
HFSR_NS  = 0x00000000
DFSR_NS  = 0x00000000
MMFAR_NS = 0x00000000
BFAR_NS  = 0x00000000
AFSR_NS  = 0x00000000
MSP_NS   = 0x00000000
PSP_NS   = 0x00000000
NS HardFault Status Reg = 0x00000000
SCB Configurable Fault Status Reg = 0x00000000


== Back Trace ==


msp=0x1003f9b8 psp=0x10019f90
Main stack back trace:

top=0x1003fa00 lim=0x1003ea00
10008c08 @ sp = 00000000

0001ed23 @ sp = 00000000

9b014807 @ sp = 1003f9f4

Backtrace information may not correct! Use this command to get C source level information:
arm-none-eabi-addr2line -e ELF_file -a -f 10008c08 0001ed23 9b014807 

我按照提示,执行了,最后一句代码,但是显示的内容,依然让我无法分析,请问发生这种类型错误,该如何定位代码位置,谢谢

arm-none-eabi-addr2line -e Debug/bin/application_is.axf -a -f 10008c08 0001ed23 9b014807
0x10008c08
__bss_start__
ip.c:?
0x0001ed23
??
??:0
0x9b014807
xPortStartScheduler
/home/fff/work/projects/rtl8720/project/realtek_amebaz2_v0_example/GCC-RELEASE/../../../component/os/freertos/freertos_v10.0.1/Source/portable/GCC/ARM_RTL8710C/port.c:407

Hi @wanglemao

请问运行的是什么程序? SDK是什么版本? RTL8720CF的开发板型号是什么呢?

一个支持wifi和蓝牙通信的软件,SDK: ambz2_sdk,博联的模组,我其实只是想知道如何根据提示,定位代码位置,因为代码量很大,不太容易发现问题点

主要可以看PC跟LR (呼叫這個函數之前上一個函數)
之後可以用arm-none-eabi-objdump -S xxx.elf > xxx.c
去看程式碼結果若有原始碼就會帶入

另外也可以透過 gdb 去做中斷處理

1 Like