-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgdbscript
54 lines (42 loc) · 1.09 KB
/
gdbscript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# -*- GDB-Script -*-
# "file" should place before "target"
# gdb-multiarch -x gdbscript
set debug arm
build/zephyr/zephyr.elf
target remote localhost:3333
# breakpoint 1
# west/modules/lib/gui/lvgl/src/lv_misc/lv_task.c
# if(lv_task_exec(LV_GC_ROOT(_lv_task_act)))
b lv_task.c:142
# breakpoint 2
# zephyr/drivers/i2c/i2c_ll_stm32.c
# k_sem_give(&data->bus_mutex);
# # where the program stops
b i2c_ll_stm32.c:167
# breakpoint 3
b z_arm_usage_fault
# breakpoint 4
b fault.c:1004
# breakpoint 5
b zephyr/arch/arm/core/aarch32/swap.c:41
# breakpoint 6
# command
# stop 2 times at breakpoint 1 and continue until the last function before
disable
enable 1
c
enable
c
c
c
# DWT_CTRL bit 17, CPIEVTENA, Enables CPI count event.
# set *0xE0001000=(*0xE0001000) & (0x20000)
set *0xE0001000 = 0x20001
# reset DWT_CYCCNT value, Cycle count register
set *0xE0001004 = (long int)0x0
# DWT_CPICNT, Instruction cycle count event register
set *0xE0001008 = (long int)0x0
# press c again to enter the fault and check the clock count
# it's 90 on my computer
# c
# p/d *0xE0001004