From 05e3b736989c6278fafc2ab5af895da472c72138 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Fri, 20 Dec 2024 09:44:34 -0800 Subject: [PATCH] PICO_BOARD can be overriden with "pico2_w" --- docs/plat_picow.md | 2 ++ examples/pico_w/CMakeLists.txt | 7 ++++--- examples/pico_w/README.md | 12 +++++++++++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/docs/plat_picow.md b/docs/plat_picow.md index 6f1ad122..ae3b3a42 100644 --- a/docs/plat_picow.md +++ b/docs/plat_picow.md @@ -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: ```sh diff --git a/examples/pico_w/CMakeLists.txt b/examples/pico_w/CMakeLists.txt index 6f94a1f5..e06ea248 100644 --- a/examples/pico_w/CMakeLists.txt +++ b/examples/pico_w/CMakeLists.txt @@ -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() diff --git a/examples/pico_w/README.md b/examples/pico_w/README.md index 63e6ffa1..af5eb026 100644 --- a/examples/pico_w/README.md +++ b/examples/pico_w/README.md @@ -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 @@ -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: @@ -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. - \ No newline at end of file