RaspberryPi.md 1.17 KB
Newer Older
Sam Calisch's avatar
Sam Calisch committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
## Setting up a Raspberry Pi OpenOCD programmer

1. Set up SD card.  Either download image with openocd from this page (todo: add link), or download a vanilla raspian os from https://www.raspberrypi.org/downloads/raspbian/ This will involve building OpenOCD yourself.  To fit on a 4GB sd card, get the lite version.

1. https://www.raspberrypi.org/documentation/installation/installing-images/

```
diskutil unmountDisk diskn
sudo dd bs=1m if=~/Documents/2017-09-07-raspbian-stretch-lite.img of=/dev/rdiskn conv=sync
```

Wait.

2. Set up ssh.  We prefer over usb: https://www.thepolyglotdeveloper.com/2016/06/connect-raspberry-pi-zero-usb-cable-ssh/
Sam Calisch's avatar
Sam Calisch committed
15
16
17
18
19
20
21
```
sublime /Volumes/boot/config.txt
dtoverlay=dwc2
sublime /Volumes/boot/cmdline.txt
modules-load=dwc2,g_ether
touch /Volumes/boot/ssh
ssh pi@raspberrypi.local
Sam Calisch's avatar
Sam Calisch committed
22
23
24
25
26
27
28
29
30
31
32
raspberry
```

3. Change password.
```
passwd
```

4. Get OpenOCD with nrf52 patch.
5. Make and install.  You may need to install some things, and you might need to share internet from your PC over the usb connection.
```
Sam Calisch's avatar
Sam Calisch committed
33
sudo apt-get update
Sam Calisch's avatar
Sam Calisch committed
34
sudo apt-get install autoconf automake libtool git
Sam Calisch's avatar
Sam Calisch committed
35
36
37
38
```
```
cd openocd/
./bootstrap
Sam Calisch's avatar
Sam Calisch committed
39
./configure --enable-sysfsgpio --enable-bcm2835gpio
Sam Calisch's avatar
Sam Calisch committed
40
41
42
43
make
```