Skip to content

Commit

Permalink
write a long treatise on code dev
Browse files Browse the repository at this point in the history
  • Loading branch information
catvw committed Mar 7, 2024
1 parent 31d9112 commit a80c3d7
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions docs/src/programming-her.md
Original file line number Diff line number Diff line change
@@ -1 +1,84 @@
# Programming Her

Oh joy! `ssh` into the Pi for all of this.

## Packages You'll Need

This is what you'll need (probably):
```bash
apt update

# for docker (obvs)
apt install docker.io

# for pico sdk
apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential

# for openocd
apt install libtool pkg-config autoconf automake texinfo
```

## Cloning the Repo

To clone the repo and initialize all the submodules:
```bash
git clone [email protected]:CooperUnion/carrie.git # if you have repo access
cd carrie/
git submodule update --init
```

## Creating & Using the Docker Image

There are some convenience scripts available for your convenience.
```bash
cd pi/
./container-init.sh # once, to create the container
./container-run.sh # whenever you need to use it
```

## Building OpenOCD
You'll have to use a custom-built version of OpenOCD, alas, to get things
working on the Pi. See [here](https://github.com/raspberrypi/openocd) for the
original instructions.
```bash
cd pico/openocd/
./bootstrap
./configure --enable-ftdi --enable-sysfsgpio --enable-bcm2835gpio
make
sudo make install
```

## Building the Firmware
There are more convenient convenience scripts for your convenience here, too!
```bash
cd pico/firmware/
./compile.sh
```

## Loading Code & Debugging

You'll want to be in a `tmux` session with a few panes for this.

In one pane, run the OpenOCD server. This allows for loading code & debugging
the Pico via SWD.
```bash
./openocd-server.sh
```

In another pane, start `gdb`:
```bash
./debug.sh
```

The `gdb` pane gives you full debugging power, live. To load new code onto the
Pico, compile the project, then run the following inside `gdb` (possibly after
pressing Ctrl-C to stop the Pico running):
```
(gdb) load
(gdb) monitor reset init
(gdb) continue
```

## Working with ROS

This could be (unfortunately) a book in itself.

0 comments on commit a80c3d7

Please sign in to comment.