Skip to content

Commit baef45f

Browse files
pyhyskartben
authored andcommitted
boards: Add Waveshare RP2040-GEEK board
Tested with the commands mentioned on the index.rst page. The product photo is from https://www.waveshare.com/img/devkit/RP2040-GEEK/RP2040-GEEK-details-13.jpgy Signed-off-by: Jonas Berg <[email protected]>
1 parent 730a1f6 commit baef45f

File tree

11 files changed

+424
-0
lines changed

11 files changed

+424
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025 Jonas Berg
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_RP2040_GEEK
5+
select RP2_FLASH_W25Q080
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2022 Peter Johanson
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if BOARD_RP2040_GEEK
5+
6+
if I2C_DW
7+
8+
config I2C_DW_CLOCK_SPEED
9+
default 125
10+
11+
endif # I2C_DW
12+
13+
config USB_SELF_POWERED
14+
default n
15+
16+
source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"
17+
18+
endif # BOARD_RP2040_GEEK
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025 Jonas Berg
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_RP2040_GEEK
5+
select SOC_RP2040
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright (c) 2023 TOKITA Hiroshi
3+
4+
board_runner_args(uf2 "--board-id=RPI-RP2")
5+
6+
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: rp2040_geek
3+
full_name: RP2040-GEEK
4+
vendor: waveshare
5+
socs:
6+
- name: rp2040
12.8 KB
Loading
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
.. zephyr:board:: rp2040_geek
2+
3+
Overview
4+
********
5+
6+
The `Waveshare RP2040-GEEK Development Board`_ is based on the RP2040 microcontroller from
7+
Raspberry Pi Ltd. It has an USB A connector, a color screen, a microSD card slot and several
8+
expansion connectors.
9+
10+
11+
Hardware
12+
********
13+
14+
- Microcontroller Raspberry Pi RP2040, with a max frequency of 133 MHz
15+
- Dual ARM Cortex M0+ cores
16+
- 264 kByte SRAM
17+
- 4 Mbyte QSPI flash
18+
- USB type A connector
19+
- BOOT button
20+
- 135x240 pixels 1.14 inch color LCD screen
21+
- microSD card slot
22+
- 4-pin I2C connector (Quiic / Stemma QT compatible)
23+
- 3-pin UART connector
24+
- 3-pin GPIO connector
25+
26+
27+
Default Zephyr Peripheral Mapping
28+
=================================
29+
30+
.. rst-class:: rst-columns
31+
32+
- Connector "UART" pin GP4, UART1 TX : GPIO4
33+
- Connector "UART" pin GP5, UART1 RX : GPIO5
34+
- Connector "DEBUG" pin GP2 : GPIO2
35+
- Connector "DEBUG" pin GP3 : GPIO3
36+
- Connector "I2C/ADC" pin GP28, I2C0 SDA : GPIO28
37+
- Connector "I2C/ADC" pin GP29, I2C0 SCL : GPIO29
38+
- microSD SCK, SPI0 SCK : GPIO18
39+
- microSD CMD, SPI0 MOSI : GPIO19
40+
- microSD DO, SPI0 MISO : GPIO20
41+
- microSD D1 : GPIO21
42+
- microSD D2 : GPIO22
43+
- microSD D3 (CS) : GPIO23
44+
- LCD DC (data/command): GPIO8
45+
- LCD SPI1 CS : GPIO9
46+
- LCD SPI1 SCK : GPIO10
47+
- LCD SPI1 MOSI : GPIO11
48+
- LCD RST (reset) : GPIO12
49+
- LCD BL (backlight): GPIO25
50+
51+
This board is intended to be used with a host computer via the USB A connector, why this board
52+
by default uses USB for terminal output.
53+
54+
See also `Waveshare P2040-GEEK wiki`_ and `schematic`_.
55+
56+
57+
Supported Features
58+
==================
59+
60+
.. zephyr:board-supported-hw::
61+
62+
63+
Programming and Debugging
64+
*************************
65+
66+
.. zephyr:board-supported-runners::
67+
68+
The board does not expose the SWDIO and SWCLK pins, so programming must be done via the
69+
USB port. Press and hold the BOOT button when connecting the RP2040-GEEK to your host computer,
70+
and the device will appear as a USB mass storage unit. Building your application will result in
71+
a :file:`build/zephyr/zephyr.uf2` file. Drag and drop the file to the USB mass storage
72+
unit, and the RP2040-GEEK will be reprogrammed.
73+
74+
For more details on programming RP2040-based boards, see :zephyr:board:`rpi_pico` and especially
75+
:ref:`rpi_pico_programming_and_debugging`.
76+
77+
78+
Flashing
79+
========
80+
81+
To run the :zephyr:code-sample:`dining-philosophers` sample to verify output on the USB console:
82+
83+
.. zephyr-app-commands::
84+
:zephyr-app: samples/philosophers/
85+
:board: rp2040_geek
86+
:goals: build flash
87+
88+
Try also the :zephyr:code-sample:`fs`, :zephyr:code-sample:`display`, :zephyr:code-sample:`lvgl`
89+
and :zephyr:code-sample:`uart-passthrough` samples.
90+
91+
Samples where text is printed only just at startup, for example :zephyr:code-sample:`hello_world`,
92+
are difficult to use as the text is already printed once you connect to the newly created
93+
USB console endpoint.
94+
95+
It is easy to connect a sensor shield via the I2C connector, for example
96+
the ``adafruit_lis3dh`` shield. Run the :zephyr:code-sample:`accel_polling` sample:
97+
98+
.. zephyr-app-commands::
99+
:zephyr-app: samples/sensor/accel_polling/
100+
:board: rp2040_geek
101+
:shield: adafruit_lis3dh
102+
:goals: build flash
103+
104+
To use the GPIO pins on the "DEBUG" connector:
105+
106+
.. zephyr-app-commands::
107+
:zephyr-app: samples/sensor/sensor_shell
108+
:board: rp2040_geek
109+
:gen-args: -DCONFIG_GPIO=y -DCONFIG_GPIO_SHELL=y
110+
:goals: build flash
111+
112+
and then in the device console:
113+
114+
.. code-block:: console
115+
116+
uart:~$ gpio conf gpio0 2 o
117+
uart:~$ gpio set gpio0 2 1
118+
119+
120+
References
121+
**********
122+
123+
.. target-notes::
124+
125+
.. _Waveshare RP2040-GEEK Development Board:
126+
https://www.waveshare.com/rp2040-geek.htm
127+
128+
.. _Waveshare P2040-GEEK wiki:
129+
https://www.waveshare.com/wiki/RP2040-GEEK
130+
131+
.. _schematic:
132+
https://files.waveshare.com/wiki/RP2040-GEEK/RP2040-GEEK-Schematic.pdf
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright (c) 2025 Jonas Berg
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <dt-bindings/pinctrl/rpi-pico-rp2040-pinctrl.h>
8+
9+
&pinctrl {
10+
uart1_default: uart1_default {
11+
group1 {
12+
pinmux = <UART1_TX_P4>;
13+
};
14+
15+
group2 {
16+
pinmux = <UART1_RX_P5>;
17+
input-enable;
18+
};
19+
};
20+
21+
i2c0_default: i2c0_default {
22+
group1 {
23+
pinmux = <I2C0_SDA_P28>, <I2C0_SCL_P29>;
24+
input-enable;
25+
};
26+
};
27+
28+
spi0_default: spi0_default {
29+
group1 {
30+
/* Pin GPIO23 is used as CS (no pinmux available) */
31+
pinmux = <SPI0_TX_P19>, <SPI0_SCK_P18>;
32+
};
33+
34+
group2 {
35+
pinmux = <SPI0_RX_P20>;
36+
input-enable;
37+
};
38+
};
39+
40+
spi1_default: spi1_default {
41+
group1 {
42+
pinmux = <SPI1_CSN_P9>, <SPI1_SCK_P10>, <SPI1_TX_P11>;
43+
};
44+
};
45+
};

0 commit comments

Comments
 (0)