-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |