Skip to content

Commit d1f5e9b

Browse files
committed
boards: pimoroni: pico_plus2: Add Pimoroni Pico Plus2 board
Pinoroni Pico Plus2 is an RP2350B based board that has more rich I/O, RAM, and Flash than the original Raspberry Pi Pico2. Signed-off-by: TOKITA Hiroshi <[email protected]>
1 parent c912994 commit d1f5e9b

28 files changed

+583
-5
lines changed

boards/pimoroni/index.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.. _boards-pimoroni:
2+
3+
Pimoroni Ltd.
4+
#############
5+
6+
.. toctree::
7+
:maxdepth: 1
8+
:glob:
9+
10+
**/*
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright (c) 2024 TOKITA Hiroshi
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if BOARD_PICO_PLUS2
5+
6+
config USB_SELF_POWERED
7+
default n
8+
9+
endif # BOARD_PICO_PLUS2
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2024 TOKITA Hiroshi
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_PICO_PLUS2
5+
select SOC_RP2350B_M33 if BOARD_PICO_PLUS2_RP2350B_M33
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
board_runner_args(openocd --cmd-pre-init "source [find interface/cmsis-dap.cfg]")
4+
board_runner_args(openocd --cmd-pre-init "source [find target/rp2350.cfg]")
5+
6+
# The adapter speed is expected to be set by interface configuration.
7+
# The Raspberry Pi's OpenOCD fork doesn't, so match their documentation at
8+
# https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html#debugging-with-swd
9+
board_runner_args(openocd --cmd-pre-init "set_adapter_speed_if_not_set 5000")
10+
11+
board_runner_args(uf2 "--board-id=RP2350")
12+
13+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
14+
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
board:
2+
name: pico_plus2
3+
full_name: Pimoroni Pico Plus2
4+
vendor: pimoroni
5+
socs:
6+
- name: rp2350b
28.9 KB
Loading
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
.. zephyr:board:: pico_plus2
2+
3+
Overview
4+
********
5+
6+
The `Pimoroni Pico Plus 2`_ is a compact and versatile board featuring the Raspberry Pi RP2350B SoC.
7+
It includes USB Type-C, Qwiic/STEMMA QT connectors, SP/CE connectors, a debug connector,
8+
a reset button, and a BOOT button.
9+
10+
Hardware
11+
********
12+
13+
- Dual Cortex-M33 or Hazard3 processors at up to 150MHz
14+
- 520KB of SRAM, and 4MB of on-board flash memory
15+
- 16MB of on-board QSPI flash (supports XiP)
16+
- 8MB of PSRAM
17+
- USB 1.1 with device and host support
18+
- Low-power sleep and dormant modes
19+
- Drag-and-drop programming using mass storage over USB
20+
- 48 multi-function GPIO pins including 8 that can be used for ADC
21+
- 2 SPI, 2 I2C, 2 UART, 3 12-bit 500ksps Analogue to Digital - Converter (ADC), 24 controllable PWM channels
22+
- 2 Timer with 4 alarms, 1 AON Timer
23+
- Temperature sensor
24+
- 3 Programmable IO (PIO) blocks, 12 state machines total for custom peripheral support
25+
- USB-C connector for power, programming, and data transfer
26+
- Qwiic/STEMMA QT(Qw/ST) connector
27+
- SP/CE connector
28+
- 3-pin debug connector, this can use with `Raspberry Pi Debug Probe`_.
29+
- Reset button and BOOT button (BOOT button also usable as a user switch)
30+
31+
Supported Features
32+
==================
33+
34+
The Pimoroni Pico Plus 2 supports the following hardware features:
35+
36+
.. list-table::
37+
:header-rows: 1
38+
39+
* - Peripheral
40+
- Kconfig option
41+
- Devicetree compatible
42+
* - NVIC
43+
- N/A
44+
- :dtcompatible:`arm,v8m-nvic`
45+
* - ADC
46+
- :kconfig:option:`CONFIG_ADC`
47+
- :dtcompatible:`raspberrypi,pico-adc`
48+
* - Clock controller
49+
- :kconfig:option:`CONFIG_CLOCK_CONTROL`
50+
- :dtcompatible:`raspberrypi,pico-clock-controller`
51+
* - Counter
52+
- :kconfig:option:`CONFIG_COUNTER`
53+
- :dtcompatible:`raspberrypi,pico-timer`
54+
* - DMA
55+
- :kconfig:option:`CONFIG_DMA`
56+
- :dtcompatible:`raspberrypi,pico-dma`
57+
* - GPIO
58+
- :kconfig:option:`CONFIG_GPIO`
59+
- :dtcompatible:`raspberrypi,pico-gpio`
60+
* - HWINFO
61+
- :kconfig:option:`CONFIG_HWINFO`
62+
- N/A
63+
* - I2C
64+
- :kconfig:option:`CONFIG_I2C`
65+
- :dtcompatible:`snps,designware-i2c`
66+
* - PWM
67+
- :kconfig:option:`CONFIG_PWM`
68+
- :dtcompatible:`raspberrypi,pico-pwm`
69+
* - SPI
70+
- :kconfig:option:`CONFIG_SPI`
71+
- :dtcompatible:`raspberrypi,pico-spi`
72+
* - UART
73+
- :kconfig:option:`CONFIG_SERIAL`
74+
- :dtcompatible:`raspberrypi,pico-uart`
75+
* - USB Device
76+
- :kconfig:option:`CONFIG_USB_DEVICE_STACK`
77+
- :dtcompatible:`raspberrypi,pico-usbd`
78+
* - Watchdog Timer (WDT)
79+
- :kconfig:option:`CONFIG_WATCHDOG`
80+
- :dtcompatible:`raspberrypi,pico-watchdog`
81+
82+
You can use peripherals that are made by using the PIO.
83+
See :ref:`rpi_pico_pio_based_features`
84+
85+
86+
Programming and Debugging
87+
*************************
88+
89+
The overall explanation regarding flashing and debugging is the same as or ``rpi_pico``.
90+
See :ref:`rpi_pico_flashing_using_openocd` and :ref:`rpi_pico_flashing_using_uf2`
91+
in ``rpi_pico`` documentation.
92+
93+
.. zephyr-app-commands::
94+
:zephyr-app: samples/basic/blinky
95+
:board: pico_plus2
96+
:goals: build flash
97+
:gen-args: -DOPENOCD=/usr/local/bin/openocd
98+
99+
.. target-notes::
100+
101+
.. _Pimoroni Pico Plus 2:
102+
https://shop.pimoroni.com/products/pimoroni-pico-plus-2
103+
104+
.. _Raspberry Pi Debug Probe:
105+
https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Copyright (c) 2024 TOKITA Hiroshi
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <zephyr/dt-bindings/pinctrl/rpi-pico-rp2350b-pinctrl.h>
7+
8+
&pinctrl {
9+
uart0_default: uart0_default {
10+
group1 {
11+
pinmux = <UART0_TX_P0>;
12+
};
13+
group2 {
14+
pinmux = <UART0_RX_P1>;
15+
input-enable;
16+
};
17+
};
18+
19+
i2c0_default: i2c0_default {
20+
group1 {
21+
pinmux = <I2C0_SDA_P4>, <I2C0_SCL_P5>;
22+
input-enable;
23+
input-schmitt-enable;
24+
};
25+
};
26+
27+
spi0_default: spi0_default {
28+
group1 {
29+
pinmux = <SPI0_CSN_P17>, <SPI0_SCK_P18>, <SPI0_TX_P19>;
30+
};
31+
group2 {
32+
pinmux = <SPI0_RX_P16>;
33+
input-enable;
34+
};
35+
};
36+
37+
pwm_ch4b_default: pwm_ch4b_default {
38+
group1 {
39+
pinmux = <PWM_4B_P25>;
40+
};
41+
};
42+
43+
adc_default: adc_default {
44+
group1 {
45+
pinmux = <ADC_CH0_P40>, <ADC_CH1_P41>, <ADC_CH2_P42>, <ADC_CH3_P43>;
46+
input-enable;
47+
};
48+
};
49+
};
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
/*
2+
* Copyright (c) 2024 TOKITA Hiroshi
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <freq.h>
8+
9+
#include <zephyr/dt-bindings/i2c/i2c.h>
10+
#include <zephyr/dt-bindings/pwm/pwm.h>
11+
#include <zephyr/dt-bindings/input/input-event-codes.h>
12+
13+
#include "pico_plus2-pinctrl.dtsi"
14+
15+
/ {
16+
chosen {
17+
zephyr,sram = &sram0;
18+
zephyr,flash = &flash0;
19+
zephyr,console = &uart0;
20+
zephyr,shell-uart = &uart0;
21+
zephyr,code-partition = &code_partition;
22+
};
23+
24+
aliases {
25+
watchdog0 = &wdt0;
26+
led0 = &led0;
27+
pwm-led0 = &pwm_led0;
28+
sw0 = &user_sw;
29+
};
30+
31+
leds {
32+
compatible = "gpio-leds";
33+
led0: led_0 {
34+
gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>;
35+
label = "LED";
36+
};
37+
};
38+
39+
pwm_leds {
40+
compatible = "pwm-leds";
41+
status = "disabled";
42+
pwm_led0: pwm_led_0 {
43+
pwms = <&pwm 9 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
44+
label = "PWM_LED";
45+
};
46+
};
47+
48+
buttons {
49+
compatible = "gpio-keys";
50+
user_sw: user_sw {
51+
gpios = <&gpio0_hi 13 (GPIO_ACTIVE_LOW)>;
52+
zephyr,code = <INPUT_KEY_0>;
53+
};
54+
};
55+
56+
pico_header: connector {
57+
compatible = "raspberrypi,pico-header";
58+
#gpio-cells = <2>;
59+
gpio-map-mask = <0xffffffff 0xffffffc0>;
60+
gpio-map-pass-thru = <0 0x3f>;
61+
gpio-map = <0 0 &gpio0 0 0>, /* GP0 */
62+
<1 0 &gpio0 1 0>, /* GP1 */
63+
<2 0 &gpio0 2 0>, /* GP2 */
64+
<3 0 &gpio0 3 0>, /* GP3 */
65+
<4 0 &gpio0 4 0>, /* GP4 */
66+
<5 0 &gpio0 5 0>, /* GP5 */
67+
<6 0 &gpio0 6 0>, /* GP6 */
68+
<7 0 &gpio0 7 0>, /* GP7 */
69+
<8 0 &gpio0 8 0>, /* GP8 */
70+
<9 0 &gpio0 9 0>, /* GP9 */
71+
<10 0 &gpio0 10 0>, /* GP10 */
72+
<11 0 &gpio0 11 0>, /* GP11 */
73+
<12 0 &gpio0 12 0>, /* GP12 */
74+
<13 0 &gpio0 13 0>, /* GP13 */
75+
<14 0 &gpio0 14 0>, /* GP14 */
76+
<15 0 &gpio0 15 0>, /* GP15 */
77+
<16 0 &gpio0 16 0>, /* GP16 */
78+
<17 0 &gpio0 17 0>, /* GP17 */
79+
<18 0 &gpio0 18 0>, /* GP18 */
80+
<19 0 &gpio0 19 0>, /* GP19 */
81+
<20 0 &gpio0 20 0>, /* GP20 */
82+
<21 0 &gpio0 21 0>, /* GP21 */
83+
<22 0 &gpio0 22 0>, /* GP22 */
84+
<26 0 &gpio0 26 0>, /* GP26 */
85+
<27 0 &gpio0 27 0>, /* GP27 */
86+
<28 0 &gpio0 28 0>; /* GP28 */
87+
};
88+
};
89+
90+
&flash0 {
91+
reg = <0x10000000 DT_SIZE_M(16)>;
92+
93+
partitions {
94+
compatible = "fixed-partitions";
95+
#address-cells = <1>;
96+
#size-cells = <1>;
97+
98+
/* Reserved memory for an image definition block. The block is much
99+
* smaller than 256 bytes, but in practice the linker places the vector
100+
* table at a much larger alignment offset.
101+
*/
102+
image_def: partition@0 {
103+
label = "image_def";
104+
reg = <0x00000000 0x100>;
105+
read-only;
106+
};
107+
108+
/*
109+
* Usable flash. Starts at 0x100, after the image definition block.
110+
* The partition size is 16MB minus the 0x100 bytes taken by the
111+
* image definition.
112+
*/
113+
code_partition: partition@100 {
114+
label = "code-partition";
115+
reg = <0x100 (DT_SIZE_M(16) - 0x100)>;
116+
read-only;
117+
};
118+
};
119+
};
120+
121+
&uart0 {
122+
current-speed = <115200>;
123+
status = "okay";
124+
pinctrl-0 = <&uart0_default>;
125+
pinctrl-names = "default";
126+
};
127+
128+
gpio0_lo: &gpio0 {
129+
status = "okay";
130+
};
131+
132+
&gpio0_hi {
133+
status = "okay";
134+
};
135+
136+
&spi0 {
137+
clock-frequency = <DT_FREQ_M(8)>;
138+
pinctrl-0 = <&spi0_default>;
139+
pinctrl-names = "default";
140+
status = "okay";
141+
};
142+
143+
&i2c0 {
144+
clock-frequency = <I2C_BITRATE_STANDARD>;
145+
pinctrl-0 = <&i2c0_default>;
146+
pinctrl-names = "default";
147+
status = "okay";
148+
};
149+
150+
&adc {
151+
pinctrl-0 = <&adc_default>;
152+
pinctrl-names = "default";
153+
status = "okay";
154+
};
155+
156+
&pwm {
157+
pinctrl-0 = <&pwm_ch4b_default>;
158+
pinctrl-names = "default";
159+
divider-int-0 = <255>;
160+
};
161+
162+
&timer0 {
163+
status = "okay";
164+
};
165+
166+
zephyr_udc0: &usbd {
167+
status = "okay";
168+
};
169+
170+
171+
pico_spi: &spi0 {};
172+
pico_i2c0: &i2c0 {};
173+
pico_i2c1: &i2c1 {};
174+
pico_serial: &uart0 {};
175+
stemma_qt_i2c: &i2c0 {};

0 commit comments

Comments
 (0)