Skip to content

Commit bab9f63

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 bab9f63

12 files changed

+533
-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: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#include <dt-bindings/pinctrl/rpi-pico-rp2040-pinctrl.h>
2+
3+
&pinctrl {
4+
uart0_default: uart0_default {
5+
group1 {
6+
pinmux = <UART0_TX_P0>;
7+
};
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+
21+
group2 {
22+
pinmux = <I2C1_SCL_P3>;
23+
input-enable;
24+
};
25+
};
26+
27+
spi0_default: spi0_default {
28+
group1 {
29+
pinmux = <SPI0_TX_P19>;
30+
};
31+
32+
group2 {
33+
pinmux = <SPI0_RX_P20>;
34+
input-enable;
35+
};
36+
37+
group3 {
38+
pinmux = <SPI0_SCK_P18>;
39+
};
40+
};
41+
42+
spi1_default: spi1_default {
43+
group1 {
44+
pinmux = <SPI1_TX_P15>;
45+
};
46+
47+
group2 {
48+
pinmux = <SPI1_RX_P8>;
49+
input-enable;
50+
};
51+
52+
group3 {
53+
pinmux = <SPI1_SCK_P14>;
54+
};
55+
};
56+
57+
adc_default: adc_default {
58+
group1 {
59+
pinmux = <ADC_CH0_P26>, <ADC_CH1_P27>, <ADC_CH2_P28>, <ADC_CH3_P29>;
60+
input-enable;
61+
};
62+
};
63+
64+
ws2812_pio0_default: ws2812_pio0_default {
65+
ws2812 {
66+
pinmux = <PIO0_P17>;
67+
};
68+
};
69+
};
Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
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_button: button {
47+
label = "User";
48+
gpios = <&gpio0 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
49+
zephyr,code = <INPUT_KEY_0>;
50+
};
51+
};
52+
53+
leds: leds {
54+
compatible = "gpio-leds";
55+
56+
red_led: red_led {
57+
gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
58+
label = "Red LED";
59+
};
60+
};
61+
62+
stemma_connector: stemma_connector {
63+
compatible = "stemma-qt-connector";
64+
#gpio-cells = <2>;
65+
gpio-map-mask = <0xffffffff 0xffffffc0>;
66+
gpio-map-pass-thru = <0 0x3f>;
67+
gpio-map = <0 0 &gpio0 3 0>, /* SCL */
68+
<1 0 &gpio0 2 0>; /* SDA */
69+
};
70+
};
71+
72+
&flash0 {
73+
reg = <0x10000000 DT_SIZE_M(8)>;
74+
75+
partitions {
76+
compatible = "fixed-partitions";
77+
#address-cells = <1>;
78+
#size-cells = <1>;
79+
80+
/* Reserved memory for the second stage bootloader */
81+
second_stage_bootloader: partition@0 {
82+
label = "second_stage_bootloader";
83+
reg = <0x00000000 0x100>;
84+
read-only;
85+
};
86+
87+
/*
88+
* Usable flash. Starts at 0x100, after the bootloader. The partition
89+
* size is 8 MB minus the 0x100 bytes taken by the bootloader.
90+
*/
91+
code_partition: partition@100 {
92+
label = "code-partition";
93+
reg = <0x100 (DT_SIZE_M(8) - 0x100)>;
94+
read-only;
95+
};
96+
};
97+
};
98+
99+
&gpio0 {
100+
status = "okay";
101+
};
102+
103+
&uart0 {
104+
current-speed = <115200>;
105+
status = "okay";
106+
pinctrl-0 = <&uart0_default>;
107+
pinctrl-names = "default";
108+
};
109+
110+
zephyr_i2c: &i2c1 {
111+
status = "okay";
112+
pinctrl-0 = <&i2c1_default>;
113+
pinctrl-names = "default";
114+
clock-frequency = <I2C_BITRATE_FAST>;
115+
};
116+
117+
&spi0 {
118+
pinctrl-0 = <&spi0_default>;
119+
pinctrl-names = "default";
120+
status = "okay";
121+
cs-gpios = <&gpio0 23 GPIO_ACTIVE_LOW>;
122+
123+
sdhc0: sdhc@0 {
124+
compatible = "zephyr,sdhc-spi-slot";
125+
reg = <0>;
126+
status = "okay";
127+
spi-max-frequency = <12000000>;
128+
129+
mmc {
130+
compatible = "zephyr,sdmmc-disk";
131+
disk-name = "SD";
132+
status = "okay";
133+
};
134+
};
135+
};
136+
137+
&spi1 {
138+
pinctrl-0 = <&spi1_default>;
139+
pinctrl-names = "default";
140+
status = "okay";
141+
};
142+
143+
&timer {
144+
status = "okay";
145+
};
146+
147+
&wdt0 {
148+
status = "okay";
149+
};
150+
151+
&adc {
152+
status = "okay";
153+
pinctrl-0 = <&adc_default>;
154+
pinctrl-names = "default";
155+
#address-cells = <1>;
156+
#size-cells = <0>;
157+
158+
channel@0 {
159+
reg = <0>;
160+
zephyr,gain = "ADC_GAIN_1";
161+
zephyr,reference = "ADC_REF_INTERNAL";
162+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
163+
zephyr,resolution = <12>;
164+
};
165+
166+
channel@1 {
167+
reg = <1>;
168+
zephyr,gain = "ADC_GAIN_1";
169+
zephyr,reference = "ADC_REF_INTERNAL";
170+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
171+
zephyr,resolution = <12>;
172+
};
173+
174+
channel@2 {
175+
reg = <2>;
176+
zephyr,gain = "ADC_GAIN_1";
177+
zephyr,reference = "ADC_REF_INTERNAL";
178+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
179+
zephyr,resolution = <12>;
180+
};
181+
182+
channel@3 {
183+
reg = <3>;
184+
zephyr,gain = "ADC_GAIN_1";
185+
zephyr,reference = "ADC_REF_INTERNAL";
186+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
187+
zephyr,resolution = <12>;
188+
};
189+
};
190+
191+
&pio0 {
192+
status = "okay";
193+
194+
pio-ws2812 {
195+
compatible = "worldsemi,ws2812-rpi_pico-pio";
196+
status = "okay";
197+
pinctrl-0 = <&ws2812_pio0_default>;
198+
pinctrl-names = "default";
199+
bit-waveform = <3>, <3>, <4>;
200+
201+
/* RGB LED (Neopixel) */
202+
ws2812: ws2812 {
203+
status = "okay";
204+
gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>;
205+
chain-length = <1>;
206+
color-mapping = <LED_COLOR_ID_GREEN
207+
LED_COLOR_ID_RED
208+
LED_COLOR_ID_BLUE>;
209+
reset-delay = <280>;
210+
frequency = <800000>;
211+
};
212+
};
213+
};
214+
215+
zephyr_udc0: &usbd {
216+
status = "okay";
217+
};
218+
219+
&die_temp {
220+
status = "okay";
221+
};
222+
223+
&vreg {
224+
regulator-always-on;
225+
regulator-allowed-modes = <REGULATOR_RPI_PICO_MODE_NORMAL>;
226+
};
227+
228+
&xosc {
229+
startup-delay-multiplier = <64>;
230+
};
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

0 commit comments

Comments
 (0)