Skip to content

README.md fixups #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ Depending on the board you're using (eg pico2), replace `build_pico` with the re
> cmake -S . -B build_$board -GNinja -DPICO_BOARD=$board -DCMAKE_BUILD_TYPE=Debug
> ```

To build the blink example, run the following command:
To build the blink example, run the following command:
```bash
cmake --build build_pico --target blink
```
This builds the specified target `blink` in the build folder `build_pico`
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`

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

## Console Input/Output

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).
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)).

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

## Debugging with OpenOCD and GDB

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):
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):
```bash
openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000"
```
Expand Down Expand Up @@ -142,7 +142,7 @@ Then follow the [manual setup instructions](#setup-sdk--picotool). You will need

#### MacOS

Install [Homebrew](https://brew.sh/) and run these commands
Install [Homebrew](https://brew.sh/) and run these commands:
```
xcode-select --install
brew install cmake ninja
Expand Down Expand Up @@ -186,9 +186,9 @@ git clone https://github.com/raspberrypi/picotool.git
Then install libusb
* 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.
* On MacOS `brew install libusb`
* On Linux `apt install libusb-1.0-0-dev`
* On Linux `sudo apt install libusb-1.0-0-dev`

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

### Test it's working with pico-examples
Clone pico-examples
Clone pico-examples:
```bash
git clone https://github.com/raspberrypi/pico-examples.git
cd pico-examples
```

Build them, replacing `$board` with the pico board you are using
Build them all, replacing all occurences of `$board` with the pico board you are using:
```bash
cmake -S . -B build_$board -GNinja -DPICO_BOARD=$board -DCMAKE_BUILD_TYPE=Debug
cmake --build build
cmake --build build_$board
```

Put your board in BOOTSEL mode and use `picotool` to load the blink example:
```bash
picotool load build/blink/blink.uf2 -vx
picotool load build_$board/blink/blink.uf2 -vx
```
You should now have a blinking LED on your board
You should now have a blinking LED on your board.