初级会员
- 积分
- 132
- 金钱
- 132
- 注册时间
- 2019-12-2
- 在线时间
- 27 小时
|
本帖最后由 lbin719 于 2024-3-19 14:39 编辑
死机打印的日志如下:LR :0007a18f PC :0005c7e0
Memory management fault is caused by data access violation
The memory management fault occurred address is 1100b2e4
Thread data
r0 = 0x1000b2cc
r1 = 0x643b0010
r2 = 0x1100b2cc
r3 = 0x00000002
r4 = 0x1100a144
r5 = 0x1000db70
r6 = 0x14600b04
r7 = 0x14600aac
r8 = 0x00000001
r9 = a5a5a5a5a5
r10 = 0xa5a5a5a5
r11 = 0xa5a5a5a5r
12 = 0x0006e6f3
lr = 0x0007a18f
pc = 0x0005c7e0
r14 = 0x00000000
发生死机时的代码位置:
该函数对应的汇编代码:
0005c7a0 <am_hal_mspi_configure>:
am_hal_mspi_configure():
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1337
5c7a0: 6803 ldr r3, [r0, #0]
5c7a2: 4a2f ldr r2, [pc, #188] ; (5c860 <am_hal_mspi_configure+0xc0>)
5c7a4: f023 437e bic.w r3, r3, #4261412864 ; 0xfe000000
5c7a8: 4293 cmp r3, r2
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1328
5c7aa: b5f0 push {r4, r5, r6, r7, lr}
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1337
5c7ac: d153 bne.n 5c856 <am_hal_mspi_configure+0xb6>
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1345
5c7ae: 78c4 ldrb r4, [r0, #3]
5c7b0: f014 0402 ands.w r4, r4, #2
5c7b4: d151 bne.n 5c85a <am_hal_mspi_configure+0xba>
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1332
5c7b6: 6843 ldr r3, [r0, #4]
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1355
5c7b8: f503 2280 add.w r2, r3, #262144 ; 0x40000
5c7bc: 3260 adds r2, #96 ; 0x60
5c7be: 0312 lsls r2, r2, #12
5c7c0: f8d2 5090 ldr.w r5, [r2, #144] ; 0x90
5c7c4: f364 0500 bfi r5, r4, #0, #1
5c7c8: f8c2 5090 str.w r5, [r2, #144] ; 0x90
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1360
5c7cc: f8c2 409c str.w r4, [r2, #156] ; 0x9c
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1361
5c7d0: f8c2 4080 str.w r4, [r2, #128] ; 0x80
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1363
5c7d4: 4c23 ldr r4, [pc, #140] ; (5c864 <am_hal_mspi_configure+0xc4>)
5c7d6: 684d ldr r5, [r1, #4]
5c7d8: f640 02c4 movw r2, #2244 ; 0x8c4
5c7dc: fb02 4203 mla r2, r2, r3, r4
5c7e0: 6195 str r5, [r2, #24]
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1364
5c7e2: 680d ldr r5, [r1, #0]
5c7e4: 6155 str r5, [r2, #20]
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1365
5c7e6: 6985 ldr r5, [r0, #24]
5c7e8: b34d cbz r5, 5c83e <am_hal_mspi_configure+0x9e>
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1367
5c7ea: 6946 ldr r6, [r0, #20]
5c7ec: 4f1e ldr r7, [pc, #120] ; (5c868 <am_hal_mspi_configure+0xc8>)
5c7ee: 00b2 lsls r2, r6, #2
5c7f0: eb05 0686 add.w r6, r5, r6, lsl #2
5c7f4: 42be cmp r6, r7
5c7f6: bf94 ite ls
5c7f8: 2601 movls r6, #1
5c7fa: 2600 movhi r6, #0
5c7fc: f880 68c0 strb.w r6, [r0, #2240] ; 0x8c0
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1368
5c800: d90a bls.n 5c818 <am_hal_mspi_configure+0x78>
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1370
5c802: f105 060f add.w r6, r5, #15
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1371
5c806: f005 050f and.w r5, r5, #15
5c80a: 1b52 subs r2, r2, r5
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1375
5c80c: 0912 lsrs r2, r2, #4
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1370
5c80e: f026 060f bic.w r6, r6, #15
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1375
5c812: 0092 lsls r2, r2, #2
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1374
5c814: 6186 str r6, [r0, #24]
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1375
5c816: 6142 str r2, [r0, #20]
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1379
5c818: 6942 ldr r2, [r0, #20]
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1380
5c81a: f644 0547 movw r5, #18503 ; 0x4847
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1379
5c81e: 3a08 subs r2, #8
5c820: 0090 lsls r0, r2, #2
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1380
5c822: ebb5 0f82 cmp.w r5, r2, lsl #2
5c826: f640 02c4 movw r2, #2244 ; 0x8c4
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1382
5c82a: fb02 4203 mla r2, r2, r3, r4
5c82e: bf32 itee cc
5c830: f44f 7080 movcc.w r0, #256 ; 0x100
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1379
5c834: 2548 movcs r5, #72 ; 0x48
5c836: fbb0 f0f5 udivcs r0, r0, r5
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1382
5c83a: f8c2 0858 str.w r0, [r2, #2136] ; 0x858
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1385
5c83e: f640 02c4 movw r2, #2244 ; 0x8c4
5c842: fb02 4303 mla r3, r2, r3, r4
5c846: 7a0a ldrb r2, [r1, #8]
5c848: 725a strb r2, [r3, #9]
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1386
5c84a: 2201 movs r2, #1
5c84c: 721a strb r2, [r3, #8]
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1389
5c84e: 2216 movs r2, #22
5c850: 729a strb r2, [r3, #10]
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1390
5c852: 2000 movs r0, #0
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1391
5c854: bdf0 pop {r4, r5, r6, r7, pc}
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1339
5c856: 2002 movs r0, #2
5c858: e7fc b.n 5c854 <am_hal_mspi_configure+0xb4>
/home/user/workspace/build/..//sdk/hal/mcu/hal/mcu/am_hal_mspi.c:1347
5c85a: 2007 movs r0, #7
5c85c: e7fa b.n 5c854 <am_hal_mspi_configure+0xb4>
5c85e: bf00 nop
5c860: 01bebebe .word 0x01bebebe
5c864: 1000a144 .word 0x1000a144
5c868: 1005ffff .word 0x1005ffff
有死机打印的日志,死机原因是pc发生非法访问,可以看到死机时各register值。
列出了发生死机时的C代码,死机位置为:g_MSPIState[ui32Module].pTCB = pConfig->pTCB;//pc指向的位置,发生非法访问
并对该函数进行反汇编(需要从反汇编代码中才能看出问题)。
|
|