Skip to content

Commit b587b54

Browse files
will-v-pilurch
andauthored
README.md fixups (#56)
Co-authored-by: Andrew Scheller <andrew.scheller@raspberrypi.com>
1 parent 7ee8a6c commit b587b54

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ Depending on the board you're using (eg pico2), replace `build_pico` with the re
2727
> cmake -S . -B build_$board -GNinja -DPICO_BOARD=$board -DCMAKE_BUILD_TYPE=Debug
2828
> ```
2929
30-
To build the blink example, run the following command:
30+
To build the blink example, run the following command:
3131
```bash
3232
cmake --build build_pico --target blink
3333
```
34-
This builds the specified target `blink` in the build folder `build_pico`
34+
This builds the specified target `blink` in the build folder `build_pico` - it will probably display `no work to do` because `blink` was built earlier by `pico_setup.sh`
3535

3636
Then to run it, attach a Pico-series microcontroller in BOOTSEL mode, and run:
3737
```bash
@@ -43,7 +43,7 @@ You should now have a blinking LED on your board! For more info on the `picotool
4343

4444
## Console Input/Output
4545

46-
To view console output, you can either connect the UART output to a [Debug Probe](https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html#getting-started) (or similar) and use `stdio_uart` (see the hello_serial example), or you can use `stdio_usb` (see the hello_usb example).
46+
To view console output, you can either connect the UART output to a [Debug Probe](https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html#getting-started) (or similar) and use `stdio_uart` (see the [hello_serial example](https://github.com/raspberrypi/pico-examples/blob/master/hello_world/serial)), or you can use `stdio_usb` (see the [hello_usb example](https://github.com/raspberrypi/pico-examples/blob/master/hello_world/usb)).
4747

4848
First, build & run the example for your `stdio` choice on your Pico-series microcontroller with the same commands as before:
4949
```bash
@@ -61,7 +61,7 @@ To exit minicom, type Ctrl+A then X
6161

6262
## Debugging with OpenOCD and GDB
6363

64-
To debug programs on the Pico-series microcontroller, you first need to attach a debugger such as the [Debug Probe](https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html#getting-started). Once that's done, you can attach OpenOCD to your Pico-series microcontroller with this command (replace `rp2040.cfg` with `rp2350.cfg`, if using an RP2350-bashed board like a Pico 2):
64+
To debug programs on the Pico-series microcontroller, you first need to attach a debugger such as the [Debug Probe](https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html#getting-started). Once that's done, you can attach OpenOCD to your Pico-series microcontroller with this command (replace `rp2040.cfg` with `rp2350.cfg`, if using an RP2350-based board like a Pico 2):
6565
```bash
6666
openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000"
6767
```
@@ -142,7 +142,7 @@ Then follow the [manual setup instructions](#setup-sdk--picotool). You will need
142142

143143
#### MacOS
144144

145-
Install [Homebrew](https://brew.sh/) and run these commands
145+
Install [Homebrew](https://brew.sh/) and run these commands:
146146
```
147147
xcode-select --install
148148
brew install cmake ninja
@@ -186,9 +186,9 @@ git clone https://github.com/raspberrypi/picotool.git
186186
Then install libusb
187187
* On Windows, download and extract libUSB from here https://libusb.info/ (hover over Downloads, and click Latest Windows Binaries), and set LIBUSB_ROOT environment variable to the extracted directory.
188188
* On MacOS `brew install libusb`
189-
* On Linux `apt install libusb-1.0-0-dev`
189+
* On Linux `sudo apt install libusb-1.0-0-dev`
190190

191-
Then build and install picotool using these commands
191+
Then build and install picotool using these commands:
192192
```bash
193193
cd picotool
194194
cmake -S . -B build
@@ -201,20 +201,22 @@ To use picotool without sudo on Linux, you'll also need to install the picotool
201201
For more details on building & installing picotool, see its [README](https://github.com/raspberrypi/picotool?tab=readme-ov-file#readme)
202202

203203
### Test it's working with pico-examples
204-
Clone pico-examples
204+
Clone pico-examples:
205205
```bash
206206
git clone https://github.com/raspberrypi/pico-examples.git
207207
cd pico-examples
208208
```
209209

210-
Build them, replacing `$board` with the pico board you are using
210+
Build them all, replacing all occurences of `$board` with the pico board you are using:
211211
```bash
212212
cmake -S . -B build_$board -GNinja -DPICO_BOARD=$board -DCMAKE_BUILD_TYPE=Debug
213-
cmake --build build
213+
cmake --build build_$board
214214
```
215+
> The cmake `-S` flag indicates the source directory, and the `-B` flag tells cmake the
216+
> name of the output-directory to create, which is then supplied to the `--build` flag
215217
216218
Put your board in BOOTSEL mode and use `picotool` to load the blink example:
217219
```bash
218-
picotool load build/blink/blink.uf2 -vx
220+
picotool load build_$board/blink/blink.uf2 -vx
219221
```
220-
You should now have a blinking LED on your board
222+
You should now have a blinking LED on your board.

0 commit comments

Comments
 (0)