- Start with this raspberry pi image (Raspbian Buster Lite):
https://www.raspberrypi.org/downloads/raspbian/
2020-02-13-raspbian-buster-lite.img
- Enable WiFi by adding 'wpa_supplicant.conf' to the boot partition:
country=US ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1
network={ ssid="NETWORK-NAME" psk="NETWORK-PASSWORD" }
- Enable ssh by adding an empty 'ssh' file to the boot partition:
touch ssh
-
Boot the pi, and check the router to determine the IP address, then SSH into it
-
Use 'sudo raspi-config', and under the 'Interfacing Options' menu, enable SSH at boot.
-
Update packages and install git:
sudo apt update sudo apt upgrade apt install git autoconf libtool libusb-1.0-0-dev
- Download and build openocd
git clone git://git.code.sf.net/p/openocd/code openocd cd openocd
./bootstrap ./configure --enable-sysfsgpio --enable-bcm2835gpio make sudo make install
sudo openocd -f interface/raspberrypi2-native.cfg
-c "bindto 0.0.0.0; transport select swd"
-c "adapter speed 1000"
-f target/stm32f4x.cfg
Pin connections: Raspberry Pi: header pin: 23 (gpio 11) -> SWCLK header pin: 22 (gpio25) -> SWDIO header pin: 25 -> GND header pin: 26: (gpio7) -> RESET (trst)
NOTE: pin1 is on the opposite side of the board from the Ethernet port!
pinout diagram: https://www.raspberrypi.org/documentation/usage/gpio/
Note: For trst support:
cp /usr/local/share/openocd/scripts/interface/raspberrypi2-native.cfg raspberrypi2-native-trst.cfg
uncomment line 32, 'reset_config trst_only'
then run:
sudo openocd -f raspberrypi2-native-trst.cfg
-c "bindto 0.0.0.0; transport select swd"
-c "adapter speed 1000"
-f target/stm32f4x.cfg