Skip to content

rp2/boards: Add Waveshare rp2040 plus #10314

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 7 commits into
base: master
Choose a base branch
from
22 changes: 22 additions & 0 deletions ports/rp2/boards/WAVESHARE_RP2040_PLUS/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Waveshare RP2040-Plus

The Waveshare RP2040-Plus Board is based on the Raspberry Pi RP2040 and can be
purchased with 4/16 MiB of flash.

These boards are available from a number of resellers
Waveshare maintain the [Wiki:RP2040-Plus](https://www.waveshare.com/wiki/RP2040-Plus)
Wiki containing information on the board.

## Build notes

Builds can be configured with the `BOARD_VARIANT` parameter. Valid variants
can be displayed with the `query-variant` target. An example:

```bash
> cd ports/rp2
> make BOARD=WAVESHARE_RP2040_PLUS query-variants
VARIANTS: flash_4mb flash_16mb
> make BOARD=WAVESHARE_RP2040_PLUS BOARD_VARIANT=flash_16mb submodules all # Build the 16 MiB variant
```

`flash_4mb` is the default if `BOARD_VARIANT` is not supplied.
25 changes: 25 additions & 0 deletions ports/rp2/boards/WAVESHARE_RP2040_PLUS/board.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"deploy": [
"../deploy.md"
],
"docs": "",
"features": [
"Breadboard Friendly",
"Castellated Pads",
"SPI Flash",
"USB-C"
],
"id": "rp2-waveshare-rp2040-plus",
"images": [
"rp2040-plus-1_5.jpg"
],
"mcu": "rp2040",
"product": "RP2040 Plus",
"thumbnail": "",
"url": "https://www.waveshare.com/rp2040-plus.htm",
"variants": {
"flash_4mb": "4 MiB Flash",
"flash_16mb": "16 MiB Flash"
},
"vendor": "Waveshare"
}
11 changes: 11 additions & 0 deletions ports/rp2/boards/WAVESHARE_RP2040_PLUS/mpconfigboard.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# CMake file for Waveshare RP2040-Plus boards

# Provide different variants for the downloads page
set(BOARD_VARIANTS "flash_4mb flash_16mb")

# Select the 4MB variant as the default
set(PICO_BOARD "waveshare_rp2040_plus_4mb")

if("${BOARD_VARIANT}" STREQUAL "flash_16mb")
set(PICO_BOARD "waveshare_rp2040_plus_16mb")
endif()
4 changes: 4 additions & 0 deletions ports/rp2/boards/WAVESHARE_RP2040_PLUS/mpconfigboard.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#define MICROPY_HW_BOARD_NAME "Waveshare RP2040-Plus"

// Allow 1MB for the firmware image itself, allocate the remainder to the filesystem
#define MICROPY_HW_FLASH_STORAGE_BYTES (PICO_FLASH_SIZE_BYTES - (640 * 1024))