Skip to content

Commit 6d0a67d

Browse files
committed
Boards: Add Adafruit RP2040 Adalogger
Add the Adafruit RP2040 Adalogger board. The board image is from the Adafruit product page. Signed-off-by: Jonas Berg <[email protected]>
1 parent 62f62db commit 6d0a67d

12 files changed

+549
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2022 Peter Johanson
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_ADAFRUIT_FEATHER_ADALOGGER_RP2040
5+
select RP2_FLASH_W25Q080
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_ADAFRUIT_FEATHER_ADALOGGER_RP2040
5+
select SOC_RP2040
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) 2022 Peter Johanson
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if BOARD_ADAFRUIT_FEATHER_ADALOGGER_RP2040
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+
endif # BOARD_ADAFRUIT_FEATHER_ADALOGGER_RP2040
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#include <dt-bindings/pinctrl/rpi-pico-rp2040-pinctrl.h>
2+
3+
4+
&pinctrl {
5+
uart0_default: uart0_default {
6+
group1 {
7+
pinmux = <UART0_TX_P0>;
8+
};
9+
group2 {
10+
pinmux = <UART0_RX_P1>;
11+
input-enable;
12+
};
13+
};
14+
15+
i2c1_default: i2c1_default {
16+
group1 {
17+
pinmux = <I2C1_SDA_P2>;
18+
input-enable;
19+
};
20+
group2 {
21+
pinmux = <I2C1_SCL_P3>;
22+
input-enable;
23+
};
24+
};
25+
26+
spi0_default: spi0_default {
27+
group1 {
28+
pinmux = <SPI0_TX_P19>;
29+
};
30+
group2 {
31+
pinmux = <SPI0_RX_P20>;
32+
input-enable;
33+
};
34+
group3 {
35+
pinmux = <SPI0_SCK_P18>;
36+
};
37+
};
38+
39+
spi1_default: spi1_default {
40+
group1 {
41+
pinmux = <SPI1_TX_P15>;
42+
};
43+
group2 {
44+
pinmux = <SPI1_RX_P8>;
45+
input-enable;
46+
};
47+
group3 {
48+
pinmux = <SPI1_SCK_P14>;
49+
};
50+
};
51+
52+
adc_default: adc_default {
53+
group1 {
54+
pinmux = <ADC_CH0_P26>, <ADC_CH1_P27>, <ADC_CH2_P28>, <ADC_CH3_P29>;
55+
input-enable;
56+
};
57+
};
58+
59+
ws2812_pio0_default: ws2812_pio0_default {
60+
ws2812 {
61+
pinmux = <PIO0_P17>;
62+
};
63+
};
64+
65+
};
Lines changed: 250 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,250 @@
1+
/*
2+
* Copyright (c) 2021 Yonatan Schachter
3+
* Copyright (c) 2022 Peter Johanson
4+
* Copyright (c) 2025 Jonas Berg
5+
*
6+
* SPDX-License-Identifier: Apache-2.0
7+
*/
8+
9+
/dts-v1/;
10+
11+
#include <raspberrypi/rpi_pico/rp2040.dtsi>
12+
#include <dt-bindings/pinctrl/rpi-pico-rp2040-pinctrl.h>
13+
#include <zephyr/dt-bindings/input/input-event-codes.h>
14+
#include <zephyr/dt-bindings/led/led.h>
15+
#include "adafruit_feather_adalogger_rp2040-pinctrl.dtsi"
16+
#include "feather_connector.dtsi"
17+
18+
/ {
19+
model = "Adafruit Feather RP2040 Adalogger";
20+
compatible = "adafruit,feather_adalogger_rp2040";
21+
22+
chosen {
23+
zephyr,sram = &sram0;
24+
zephyr,flash = &flash0;
25+
zephyr,flash-controller = &ssi;
26+
zephyr,console = &uart0;
27+
zephyr,shell-uart = &uart0;
28+
zephyr,code-partition = &code_partition;
29+
};
30+
31+
aliases {
32+
watchdog0 = &wdt0;
33+
led-strip = &ws2812;
34+
led0 = &red_led;
35+
sdhc0 = &sdhc0;
36+
sw0 = &user_button;
37+
};
38+
39+
zephyr,user {
40+
io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>;
41+
};
42+
43+
gpio_keys {
44+
compatible = "gpio-keys";
45+
46+
/* User BOOTSEL button GPIO7 */
47+
user_button: button {
48+
label = "User";
49+
gpios = <&gpio0 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
50+
zephyr,code = <INPUT_KEY_0>;
51+
};
52+
};
53+
54+
leds: leds {
55+
compatible = "gpio-leds";
56+
57+
/* Red LED GPIO13 */
58+
red_led: red_led {
59+
gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
60+
label = "Red LED";
61+
};
62+
};
63+
64+
stemma_connector: stemma_connector {
65+
compatible = "stemma-qt-connector";
66+
#gpio-cells = <2>;
67+
gpio-map-mask = <0xffffffff 0xffffffc0>;
68+
gpio-map-pass-thru = <0 0x3f>;
69+
gpio-map = <0 0 &gpio0 3 0>, /* SCL */
70+
<1 0 &gpio0 2 0>; /* SDA */
71+
};
72+
};
73+
74+
&flash0 {
75+
reg = <0x10000000 DT_SIZE_M(8)>;
76+
77+
partitions {
78+
compatible = "fixed-partitions";
79+
#address-cells = <1>;
80+
#size-cells = <1>;
81+
82+
/* Reserved memory for the second stage bootloader */
83+
second_stage_bootloader: partition@0 {
84+
label = "second_stage_bootloader";
85+
reg = <0x00000000 0x100>;
86+
read-only;
87+
};
88+
89+
/*
90+
* Usable flash. Starts at 0x100, after the bootloader. The partition
91+
* size is 8 MB minus the 0x100 bytes taken by the bootloader.
92+
*/
93+
code_partition: partition@100 {
94+
label = "code-partition";
95+
reg = <0x100 (DT_SIZE_M(8) - 0x100)>;
96+
read-only;
97+
};
98+
};
99+
};
100+
101+
&gpio0 {
102+
status = "okay";
103+
};
104+
105+
/* TX GPIO0
106+
* RX GPIO1
107+
*/
108+
&uart0 {
109+
current-speed = <115200>;
110+
status = "okay";
111+
pinctrl-0 = <&uart0_default>;
112+
pinctrl-names = "default";
113+
};
114+
115+
/* I2C SDA GPIO2
116+
* I2C SCL GPIO3
117+
* Also available in the STEMMA QT connector
118+
*/
119+
zephyr_i2c: &i2c1 {
120+
status = "okay";
121+
pinctrl-0 = <&i2c1_default>;
122+
pinctrl-names = "default";
123+
clock-frequency = <I2C_BITRATE_FAST>;
124+
};
125+
126+
/* SD-card
127+
* SPI0 SD_CLK GPIO18
128+
* SPI0 CMD/MOSI GPIO19
129+
* SPI0 DAT0/MISO GPIO20
130+
* SPI0 DAT3/CS GPIO23
131+
* CARD_DET GPIO16 (not used)
132+
* DAT1 GPIO21 (not used)
133+
* DAT2 GPIO22 (not used)
134+
*/
135+
&spi0 {
136+
pinctrl-0 = <&spi0_default>;
137+
pinctrl-names = "default";
138+
status = "okay";
139+
cs-gpios = <&gpio0 23 GPIO_ACTIVE_LOW>;
140+
141+
sdhc0: sdhc@0 {
142+
compatible = "zephyr,sdhc-spi-slot";
143+
reg = <0>;
144+
status = "okay";
145+
spi-max-frequency = <12000000>;
146+
mmc {
147+
compatible = "zephyr,sdmmc-disk";
148+
disk-name = "SD";
149+
status = "okay";
150+
};
151+
};
152+
};
153+
154+
/* SPI1 CLK GPIO14
155+
* SPI1 MOSI GPIO15
156+
* SPI1 MISO GPIO8
157+
*/
158+
&spi1 {
159+
pinctrl-0 = <&spi1_default>;
160+
pinctrl-names = "default";
161+
status = "okay";
162+
};
163+
164+
&timer {
165+
status = "okay";
166+
};
167+
168+
&wdt0 {
169+
status = "okay";
170+
};
171+
172+
&adc {
173+
status = "okay";
174+
pinctrl-0 = <&adc_default>;
175+
pinctrl-names = "default";
176+
#address-cells = <1>;
177+
#size-cells = <0>;
178+
179+
channel@0 {
180+
reg = <0>;
181+
zephyr,gain = "ADC_GAIN_1";
182+
zephyr,reference = "ADC_REF_INTERNAL";
183+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
184+
zephyr,resolution = <12>;
185+
};
186+
187+
channel@1 {
188+
reg = <1>;
189+
zephyr,gain = "ADC_GAIN_1";
190+
zephyr,reference = "ADC_REF_INTERNAL";
191+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
192+
zephyr,resolution = <12>;
193+
};
194+
195+
channel@2 {
196+
reg = <2>;
197+
zephyr,gain = "ADC_GAIN_1";
198+
zephyr,reference = "ADC_REF_INTERNAL";
199+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
200+
zephyr,resolution = <12>;
201+
};
202+
203+
channel@3 {
204+
reg = <3>;
205+
zephyr,gain = "ADC_GAIN_1";
206+
zephyr,reference = "ADC_REF_INTERNAL";
207+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
208+
zephyr,resolution = <12>;
209+
};
210+
};
211+
212+
&pio0 {
213+
status = "okay";
214+
pio-ws2812 {
215+
compatible = "worldsemi,ws2812-rpi_pico-pio";
216+
status = "okay";
217+
pinctrl-0 = <&ws2812_pio0_default>;
218+
pinctrl-names = "default";
219+
bit-waveform = <3>, <3>, <4>;
220+
221+
/* RGB LED (Neopixel) GPIO17 */
222+
ws2812: ws2812 {
223+
status = "okay";
224+
gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>;
225+
chain-length = <1>;
226+
color-mapping = <LED_COLOR_ID_GREEN
227+
LED_COLOR_ID_RED
228+
LED_COLOR_ID_BLUE>;
229+
reset-delay = <280>;
230+
frequency = <800000>;
231+
};
232+
};
233+
};
234+
235+
zephyr_udc0: &usbd {
236+
status = "okay";
237+
};
238+
239+
&die_temp {
240+
status = "okay";
241+
};
242+
243+
&vreg {
244+
regulator-always-on;
245+
regulator-allowed-modes = <REGULATOR_RPI_PICO_MODE_NORMAL>;
246+
};
247+
248+
&xosc {
249+
startup-delay-multiplier = <64>;
250+
};
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
identifier: adafruit_feather_adalogger_rp2040
2+
name: Adafruit Feather RP2040 Adalogger
3+
type: mcu
4+
arch: arm
5+
flash: 8192
6+
ram: 264
7+
toolchain:
8+
- zephyr
9+
- gnuarmemb
10+
supported:
11+
- adc
12+
- clock
13+
- counter
14+
- dma
15+
- flash
16+
- gpio
17+
- hwinfo
18+
- i2c
19+
- pwm
20+
- spi
21+
- uart
22+
- watchdog
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
CONFIG_BUILD_OUTPUT_UF2=y
4+
CONFIG_CLOCK_CONTROL=y
5+
CONFIG_GPIO=y
6+
CONFIG_PIO_RPI_PICO=y
7+
CONFIG_RESET=y
8+
CONFIG_USE_DT_CODE_PARTITION=y
9+
CONFIG_SERIAL=y
10+
CONFIG_UART_INTERRUPT_DRIVEN=y
11+
CONFIG_CONSOLE=y
12+
CONFIG_UART_CONSOLE=y
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: adafruit_feather_adalogger_rp2040
3+
full_name: Feather RP2040 Adalogger
4+
vendor: adafruit
5+
socs:
6+
- name: rp2040
Binary file not shown.

0 commit comments

Comments
 (0)