-
Notifications
You must be signed in to change notification settings - Fork 9
/
openocd.cfg
46 lines (41 loc) · 1.66 KB
/
openocd.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
# *********************************************************************************************
# This script has the settings for using a RaspberryPi 2/3 as a SWD controller for a Blue Pill
# microcontroller. To use it, run openocd in this directory as:
#
# sudo openocd -f openocd.cfg
#
# Once you've run that command, you can then open another shell on the Pi, and run:
#
# telnet localhost 4444
#
# This will drop you into an OpenOCD command shell. There you can stop, run, and flash the
# chip, using commands like:
#
# reset halt
#
# This restarts the chip, and stops at the first instruction. You need to do this before you
# flash a new program.
#
# flash write_image erase gen_blink_main.bin 0x08000000
#
# Writes the program into flash, so that it's run at next restart.
#
# reset
#
# Restarts the chip, and runs whatever's in flash.
# *********************************************************************************************
# Should be installed by OpenOCD as one of its bundled scripts.
source [find interface/raspberrypi2-native.cfg]
# Because we're following the GPIO pin wiring suggested by AdaFruit in their article
# https://learn.adafruit.com/programming-microcontrollers-using-openocd-on-raspberry-pi/wiring-and-test
# we need to change port numbers from the defaults used in the OpenOCD script.
bcm2835gpio_swd_nums 25 24
transport select swd
set CHIPNAME stm32f1x
# Another script that OCD installs, containing information on the STM32 we're using.
source [find target/stm32f1x.cfg]
reset_config srst_nogate
init
# Enable logging output from the device to OpenOCD's console stream. See LogString() in
# include/log.h for an example of using this.
arm semihosting enable