Skip to content

Commit b116f0a

Browse files
drensbercarlescufi
authored andcommitted
boards: Board definition for the Raspberry Pi Pico W.
Effort has been made to abstract the features that are common to both the Pico and Pico W into a shared file when possible. This commit does not include the addition of bluetooth or wifi drivers for the W's Infineon module. Signed-off-by: Dave Rensberger <[email protected]>
1 parent 7617046 commit b116f0a

File tree

11 files changed

+217
-109
lines changed

11 files changed

+217
-109
lines changed

boards/arm/rpi_pico/Kconfig.board

+4
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@
44
config BOARD_RPI_PICO
55
bool "Raspberry Pi Pico Board"
66
depends on SOC_RP2040
7+
8+
config BOARD_RPI_PICO_W
9+
bool "Raspberry Pi Pico W Board"
10+
depends on SOC_RP2040

boards/arm/rpi_pico/Kconfig.defconfig

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Copyright (c) 2021 Yonatan Schachter
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if BOARD_RPI_PICO
4+
if BOARD_RPI_PICO || BOARD_RPI_PICO_W
55

66
config BOARD
7-
default "rpi_pico"
7+
default "rpi_pico" if BOARD_RPI_PICO
8+
default "rpi_pico_w" if BOARD_RPI_PICO_W
89

910
config RP2_FLASH_W25Q080
1011
default y
@@ -16,4 +17,4 @@ config I2C_DW_CLOCK_SPEED
1617

1718
endif #I2C_DW
1819

19-
endif # BOARD_RPI_PICO
20+
endif # BOARD_RPI_PICO || BOARD_RPI_PICO_W
17.6 KB
Loading

boards/arm/rpi_pico/doc/index.rst

+20-6
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ Raspberry Pi Pico
66
Overview
77
********
88

9-
The Raspberry Pi Pico is a small, low-cost, versatile board from
10-
Raspberry Pi. It is equipped with an RP2040 SoC, an on-board LED,
11-
a USB connector, and an SWD interface. The USB bootloader allows it
12-
to be flashed without any adapter, in a drag-and-drop manner.
13-
It is also possible to flash and debug the Pico with its SWD interface,
9+
The Raspberry Pi Pico and Pico W are small, low-cost, versatile boards from
10+
Raspberry Pi. They are equipped with an RP2040 SoC, an on-board LED,
11+
a USB connector, and an SWD interface. The Pico W additionally contains an
12+
Infineon CYW43439 2.4 GHz Wi-Fi/Bluetoth module. The USB bootloader allows the
13+
ability to flash without any adapter, in a drag-and-drop manner.
14+
It is also possible to flash and debug the boards with their SWD interface,
1415
using an external adapter.
1516

1617
Hardware
@@ -28,13 +29,20 @@ Hardware
2829
- 8 Programmable I/O (PIO) for custom peripherals
2930
- On-board LED
3031
- 1 Watchdog timer peripheral
32+
- Infineon CYW43439 2.4 GHz Wi-Fi chip (Pico W only)
3133

3234

3335
.. figure:: img/rpi_pico.jpg
3436
:align: center
3537
:alt: Raspberry Pi Pico
3638

37-
Raspberry Pi Pico (Image courtesy of Raspberry Pi)
39+
40+
.. figure:: img/rpi_pico_w.jpg
41+
:align: center
42+
:alt: Raspberry Pi Pico W
43+
44+
Raspberry Pi Pico (above) and Pico W (below)
45+
(Images courtesy of Raspberry Pi)
3846

3947
Supported Features
4048
==================
@@ -92,6 +100,12 @@ The peripherals of the RP2040 SoC can be routed to various pins on the board.
92100
The configuration of these routes can be modified through DTS. Please refer to
93101
the datasheet to see the possible routings for each peripheral.
94102

103+
External pin mapping on the Pico W is identical to the Pico, but note that internal
104+
RP2040 GPIO lines 23, 24, 25, and 29 are routed to the Infineon module on the W.
105+
Since GPIO 25 is routed to the on-board LED on the Pico, but to the Infineon module
106+
on the Pico W, the "blinky" sample program does not work on the W (use hello_world for
107+
a simple test program instead).
108+
95109
Default Zephyr Peripheral Mapping:
96110
----------------------------------
97111

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
/*
2+
* Copyright (c) 2021 Yonatan Schachter
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <freq.h>
8+
9+
#include <rpi_pico/rp2040.dtsi>
10+
#include "rpi_pico-pinctrl.dtsi"
11+
#include <zephyr/dt-bindings/pwm/pwm.h>
12+
13+
#include <zephyr/dt-bindings/i2c/i2c.h>
14+
15+
16+
/ {
17+
chosen {
18+
zephyr,sram = &sram0;
19+
zephyr,flash = &flash0;
20+
zephyr,flash-controller = &ssi;
21+
zephyr,console = &uart0;
22+
zephyr,shell-uart = &uart0;
23+
zephyr,code-partition = &code_partition;
24+
};
25+
26+
xtal_clk: xtal-clk {
27+
compatible = "fixed-clock";
28+
clock-frequency = <12000000>;
29+
#clock-cells = <0>;
30+
};
31+
32+
aliases {
33+
watchdog0 = &wdt0;
34+
};
35+
};
36+
37+
&flash0 {
38+
reg = <0x10000000 DT_SIZE_M(2)>;
39+
40+
partitions {
41+
compatible = "fixed-partitions";
42+
#address-cells = <1>;
43+
#size-cells = <1>;
44+
45+
/* Reserved memory for the second stage bootloader */
46+
second_stage_bootloader: partition@0 {
47+
label = "second_stage_bootloader";
48+
reg = <0x00000000 0x100>;
49+
read-only;
50+
};
51+
52+
/*
53+
* Usable flash. Starts at 0x100, after the bootloader. The partition
54+
* size is 2MB minus the 0x100 bytes taken by the bootloader.
55+
*/
56+
code_partition: partition@100 {
57+
label = "code-partition";
58+
reg = <0x100 (DT_SIZE_M(2) - 0x100)>;
59+
read-only;
60+
};
61+
};
62+
};
63+
64+
&uart0 {
65+
current-speed = <115200>;
66+
status = "okay";
67+
pinctrl-0 = <&uart0_default>;
68+
pinctrl-names = "default";
69+
};
70+
71+
&gpio0 {
72+
status = "okay";
73+
};
74+
75+
&i2c0 {
76+
clock-frequency = <I2C_BITRATE_STANDARD>;
77+
status = "okay";
78+
pinctrl-0 = <&i2c0_default>;
79+
pinctrl-names = "default";
80+
};
81+
82+
&spi0 {
83+
clock-frequency = <DT_FREQ_M(8)>;
84+
status = "okay";
85+
pinctrl-0 = <&spi0_default>;
86+
pinctrl-names = "default";
87+
};
88+
89+
&wdt0 {
90+
status = "okay";
91+
};
92+
93+
&adc {
94+
status = "okay";
95+
pinctrl-0 = <&adc_default>;
96+
pinctrl-names = "default";
97+
};
98+
99+
zephyr_udc0: &usbd {
100+
status = "okay";
101+
};
102+
103+
&pwm {
104+
pinctrl-0 = <&pwm_ch4b_default>;
105+
pinctrl-names = "default";
106+
divider-int-0 = <255>;
107+
};
108+
109+
&vreg {
110+
regulator-always-on;
111+
regulator-allowed-modes = <REGULATOR_RPI_PICO_MODE_NORMAL>;
112+
};

boards/arm/rpi_pico/rpi_pico.dts

+1-100
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,9 @@
66

77
/dts-v1/;
88

9-
#include <freq.h>
10-
11-
#include <rpi_pico/rp2040.dtsi>
12-
#include "rpi_pico-pinctrl.dtsi"
13-
#include <zephyr/dt-bindings/pwm/pwm.h>
14-
15-
#include <zephyr/dt-bindings/i2c/i2c.h>
9+
#include "rpi_pico-common.dtsi"
1610

1711
/ {
18-
chosen {
19-
zephyr,sram = &sram0;
20-
zephyr,flash = &flash0;
21-
zephyr,flash-controller = &ssi;
22-
zephyr,console = &uart0;
23-
zephyr,shell-uart = &uart0;
24-
zephyr,code-partition = &code_partition;
25-
};
26-
2712
leds {
2813
compatible = "gpio-leds";
2914
led0: led_0 {
@@ -32,12 +17,6 @@
3217
};
3318
};
3419

35-
xtal_clk: xtal-clk {
36-
compatible = "fixed-clock";
37-
clock-frequency = <12000000>;
38-
#clock-cells = <0>;
39-
};
40-
4120
pwm_leds {
4221
compatible = "pwm-leds";
4322
status = "disabled";
@@ -49,84 +28,6 @@
4928

5029
aliases {
5130
led0 = &led0;
52-
watchdog0 = &wdt0;
5331
pwm-led0 = &pwm_led0;
5432
};
5533
};
56-
57-
&flash0 {
58-
reg = <0x10000000 DT_SIZE_M(2)>;
59-
60-
partitions {
61-
compatible = "fixed-partitions";
62-
#address-cells = <1>;
63-
#size-cells = <1>;
64-
65-
/* Reserved memory for the second stage bootloader */
66-
second_stage_bootloader: partition@0 {
67-
label = "second_stage_bootloader";
68-
reg = <0x00000000 0x100>;
69-
read-only;
70-
};
71-
72-
/*
73-
* Usable flash. Starts at 0x100, after the bootloader. The partition
74-
* size is 2MB minus the 0x100 bytes taken by the bootloader.
75-
*/
76-
code_partition: partition@100 {
77-
label = "code-partition";
78-
reg = <0x100 (DT_SIZE_M(2) - 0x100)>;
79-
read-only;
80-
};
81-
};
82-
};
83-
84-
&uart0 {
85-
current-speed = <115200>;
86-
status = "okay";
87-
pinctrl-0 = <&uart0_default>;
88-
pinctrl-names = "default";
89-
};
90-
91-
&gpio0 {
92-
status = "okay";
93-
};
94-
95-
&i2c0 {
96-
clock-frequency = <I2C_BITRATE_STANDARD>;
97-
status = "okay";
98-
pinctrl-0 = <&i2c0_default>;
99-
pinctrl-names = "default";
100-
};
101-
102-
&spi0 {
103-
clock-frequency = <DT_FREQ_M(8)>;
104-
status = "okay";
105-
pinctrl-0 = <&spi0_default>;
106-
pinctrl-names = "default";
107-
};
108-
109-
&wdt0 {
110-
status = "okay";
111-
};
112-
113-
&adc {
114-
status = "okay";
115-
pinctrl-0 = <&adc_default>;
116-
pinctrl-names = "default";
117-
};
118-
119-
zephyr_udc0: &usbd {
120-
status = "okay";
121-
};
122-
123-
&pwm {
124-
pinctrl-0 = <&pwm_ch4b_default>;
125-
pinctrl-names = "default";
126-
divider-int-0 = <255>;
127-
};
128-
129-
&vreg {
130-
regulator-always-on;
131-
regulator-allowed-modes = <REGULATOR_RPI_PICO_MODE_NORMAL>;
132-
};

boards/arm/rpi_pico/rpi_pico_defconfig

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
CONFIG_SOC_SERIES_RP2XXX=y
22
CONFIG_SOC_RP2040=y
3+
CONFIG_BOARD_RPI_PICO=y
34
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=125000000
45
CONFIG_SERIAL=y
56
CONFIG_CONSOLE=y

boards/arm/rpi_pico/rpi_pico_w.dts

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* Copyright (c) 2023 Dave Rensberger - Beechwoods Software
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include "rpi_pico-common.dtsi"

boards/arm/rpi_pico/rpi_pico_w.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
identifier: rpi_pico_w
2+
name: RaspberryPi-Pico-w
3+
type: mcu
4+
arch: arm
5+
flash: 2048
6+
ram: 264
7+
toolchain:
8+
- zephyr
9+
- gnuarmemb
10+
- xtools
11+
supported:
12+
- uart
13+
- gpio
14+
- adc
15+
- i2c
16+
- spi
17+
- hwinfo
18+
- watchdog
19+
- pwm
20+
- flash
21+
- dma
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
CONFIG_SOC_SERIES_RP2XXX=y
2+
CONFIG_SOC_RP2040=y
3+
CONFIG_BOARD_RPI_PICO_W=y
4+
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=125000000
5+
CONFIG_SERIAL=y
6+
CONFIG_CONSOLE=y
7+
CONFIG_UART_CONSOLE=y
8+
CONFIG_GPIO=y
9+
CONFIG_USE_DT_CODE_PARTITION=y
10+
CONFIG_BUILD_OUTPUT_UF2=y
11+
CONFIG_BUILD_OUTPUT_HEX=y
12+
CONFIG_UART_INTERRUPT_DRIVEN=y
13+
CONFIG_RESET=y

0 commit comments

Comments
 (0)