Skip to content

Commit 8bfb08f

Browse files
youssefz24kartben
authored andcommitted
boards: add gpio, button and led support
Add gpio support for STM32MP257F-EV1 board. Add the orange (&led0) LED to the device tree and enable GPIOJ. Add the user button USER2 to the device tree and enable GPIOG. This step allows building and debugging the blinky and button sample applications. Signed-off-by: Youssef Zini <youssef.zini@savoirfairelinux.com>
1 parent 1a7bac5 commit 8bfb08f

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

boards/st/stm32mp257f_ev1/stm32mp257f_ev1_stm32mp257fxx_m33.dts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
/dts-v1/;
88
#include <st/mp2/stm32mp257_m33.dtsi>
9+
#include <st/mp2/stm32mp257faix-pinctrl.dtsi>
10+
#include <zephyr/dt-bindings/input/input-event-codes.h>
911

1012
/ {
1113
model = "STMicroelectronics STM32MP257F-EV1 board";
@@ -15,8 +17,40 @@
1517
zephyr,flash = &ddr_code;
1618
zephyr,sram = &ddr_sys;
1719
};
20+
21+
leds {
22+
compatible = "gpio-leds";
23+
24+
orange_led_3: led_3 {
25+
gpios = <&gpioj 6 GPIO_ACTIVE_HIGH>;
26+
label = "LD3";
27+
};
28+
};
29+
30+
gpio_keys {
31+
compatible = "gpio-keys";
32+
33+
button_user2: button2 {
34+
label = "User 2";
35+
gpios = <&gpiog 8 GPIO_ACTIVE_LOW>;
36+
zephyr,code = <INPUT_KEY_0>;
37+
};
38+
};
39+
40+
aliases {
41+
led0 = &orange_led_3;
42+
sw0 = &button_user2;
43+
};
1844
};
1945

2046
&rcc {
2147
clock-frequency = <DT_FREQ_M(400)>;
2248
};
49+
50+
&gpiog {
51+
status = "okay";
52+
};
53+
54+
&gpioj {
55+
status = "okay";
56+
};

boards/st/stm32mp257f_ev1/stm32mp257f_ev1_stm32mp257fxx_m33_defconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@
44
# Enable MPU
55
CONFIG_ARM_MPU=y
66

7+
# Enable GPIO
8+
CONFIG_GPIO=y
9+
710
# Enable HW stack protection
811
CONFIG_HW_STACK_PROTECTION=y

0 commit comments

Comments
 (0)