Skip to content

Commit

Permalink
PICO_BOARD can be overriden with "pico2_w"
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoquesada committed Dec 20, 2024
1 parent 50be465 commit 05e3b73
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
2 changes: 2 additions & 0 deletions docs/plat_picow.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ You need to install Pico SDK. The instructions are different for Linux/macOS and

=== "Pico SDK for Linux / macOS"

Recommended: Use Pico SDK v2.1.0 or newer.

Clone Pico SDK from Github: <https://github.com/raspberrypi/pico-sdk>

```sh
Expand Down
7 changes: 4 additions & 3 deletions examples/pico_w/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
cmake_minimum_required(VERSION 3.13)

# PICO_BOARD should be set to 'pico_w', or not set at all.
if(DEFINED PICO_BOARD AND NOT ${PICO_BOARD} STREQUAL "pico_w")
message(FATAL_ERROR "PICO_BOARD must be set to 'pico_w' or not set at all")
# PICO_BOARD should be set to 'pico_w', 'pico2_w' or not set at all.
if(DEFINED PICO_BOARD)
message(DEBUG, "Using PICO_BOARD ${PICO_BOARD}")
else()
message(VERBOSE, "PICO_BOARD not defined. Using 'pico_w'")
set(PICO_BOARD "pico_w")
endif()

Expand Down
12 changes: 11 additions & 1 deletion examples/pico_w/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

You need to install Pico SDK. The instructions are different for Linux/macOS and Windows.

Recommended: Use Pico SDK 2.1 or newer.

### Pico SDK for Linux / macOS

Install Pico SDK: https://github.com/raspberrypi/pico-sdk
Expand Down Expand Up @@ -32,6 +34,14 @@ cmake ..
make -j
```

If `PICO_BOARD` is not specified, it will use `pico_w`. To compile it for Pico 2 W, do:

```sh
# From the recently crated "build" folder
cmake -DPICO_BOARD=pico2_w ..
make -j
```

Copy `build/bluepad32_picow_example_app.uf2` to Pico W.

Use this guide if you are not sure how to do it:
Expand All @@ -43,5 +53,5 @@ Use this guide if you are not sure how to do it:
- Example code: licensed under Public Domain.
- Bluepad32: licensed under Apache 2.
- BTstack:
- Commercial license is already paid by the Raspberry Pi foundation, but only when used in a Pico W.
- Commercial license is already paid by the Raspberry Pi foundation, but only when used in a Pico W or Pico 2 W.
- <https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2_common/pico_btstack/LICENSE.RP>

0 comments on commit 05e3b73

Please sign in to comment.