-
Notifications
You must be signed in to change notification settings - Fork 32
/
openocd_rs41.cfg
57 lines (49 loc) · 1.65 KB
/
openocd_rs41.cfg
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
55
56
57
# Copied and adapted from random internet sources.
# Unlocking is not needed, but every 1k block of Flash Ram is write protected
# - see: http://openocd.org/doc/html/Flash-Commands.html#flashprotect
# Typical usages:
# openocd -f ./openocd_rs41.cfg -c "init; halt; flash protect 0 0 31 off; exit"
# to unlock 64k of Flash for programming
# openocd -f ./openocd_rs41.cfg -c "program RS41ng.elf verify reset exit"
# to program the connected rs41
# openocd -f ./openocd_rs41.cfg -c "init; reset; exit"
# will reset the connected rs41
#
# Debugging with semihosting, use GDB commands:
# target remote localhost:3333
# monitor arm semihosting enable
# load build/src/RS41ng.elf
# monitor reset halt
# continue
# Normal use is with cheap STLINKv2 clone
source [find interface/stlink-v2.cfg]
# Alternative is to connect directly to a Raspberry Pi3
# Find AdaFruit tutorial to build and run OpenOCD on RPi:
# source [find interface/raspberrypi2-native.cfg]
# bcm2835gpio_swd_nums 25 24
# bcm2835gpio_speed_coeffs 194938 48
# bcm2835gpio_srst_num 18
# reset_config srst_only srst_push_pull
set WORKAREASIZE 0x2000
# RS41 uses stm32f1 cortex m3
source [find target/stm32f1x.cfg]
# example script:
proc RS41 {will_fail} {
init
sleep 200
reset
halt
wait_halt
stm32f1x unlock $will_fail
sleep 10
shutdown
}
#
# Uncommon usage:
# openocd -f ./openocd_rs41.cfg -c "init; halt; stm32f1x options_read 0; exit"
# check setings before changing them
# openocd -f ./openocd_rs41.cfg -c "init; halt; stm32f1x unlock 0; exit"
# is not needed just to re-program RS41
# openocd -f ./openocd_rs41.cfg -c "RS41 0"
# to run a macro written above
#