Skip to content

Commit ed3bc5f

Browse files
committed
samples: basic: fade_led: Add stm32_min_dev.overlay support
Add a Device Tree overlay for the STM32 Minimum Development Board (Blue) to the fade_led sample, enabling PWM-based LED fading on PA8 (Timer 1, Ch 1), PA9 (Timer 1, Ch 2), PA0 (Timer 2, Ch 1), and PA1 (Timer 2, Ch 2) with a 20 ms and a prescaler of 10000 for STM32F103C8 compatibility. All four LEDs fade without errors. Signed-off-by: Gomaa Mohammed Eldebaby <[email protected]>
1 parent 265cfb4 commit ed3bc5f

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/*
2+
* Copyright (c) 2025 Gomaa Eldebaby <[email protected]>
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/ {
7+
model = "STM32 Minimum Development Board (Blue)";
8+
compatible = "stm32_min_dev_blue", "st,stm32f103c8";
9+
10+
aliases {
11+
pwm-led0 = &pwm_led_0;
12+
pwm-led1 = &pwm_led_1;
13+
pwm-led2 = &pwm_led_2;
14+
pwm-led3 = &pwm_led_3;
15+
};
16+
17+
pwmleds: pwmleds {
18+
compatible = "pwm-leds";
19+
status = "okay";
20+
21+
pwm_led_0: pwm_led0 {
22+
pwms = <&pwm1 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
23+
label = "PWM LED 0";
24+
};
25+
26+
pwm_led_1: pwm_led1 {
27+
pwms = <&pwm1 2 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
28+
label = "PWM LED 1";
29+
};
30+
31+
pwm_led_2: pwm_led2 {
32+
pwms = <&pwm2 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
33+
label = "PWM LED 2";
34+
};
35+
36+
pwm_led_3: pwm_led3 {
37+
pwms = <&pwm2 2 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
38+
label = "PWM LED 3";
39+
};
40+
};
41+
};
42+
43+
&timers1 {
44+
st,prescaler = <10000>;
45+
status = "okay";
46+
47+
pwm1: pwm {
48+
pinctrl-0 = <&tim1_ch1_pwm_out_pa8 &tim1_ch2_pwm_out_pa9>;
49+
pinctrl-names = "default";
50+
status = "okay";
51+
};
52+
};
53+
54+
&timers2 {
55+
st,prescaler = <10000>;
56+
status = "okay";
57+
58+
pwm2: pwm {
59+
pinctrl-0 = <&tim2_ch1_pwm_out_pa0 &tim2_ch2_pwm_out_pa1>;
60+
pinctrl-names = "default";
61+
status = "okay";
62+
};
63+
};
64+
65+
&tim1_ch1_pwm_out_pa8{
66+
slew-rate = "max-speed-50mhz";
67+
bias-pull-up;
68+
drive-push-pull;
69+
};
70+
71+
&tim1_ch2_pwm_out_pa9{
72+
slew-rate = "max-speed-50mhz";
73+
bias-pull-up;
74+
drive-push-pull;
75+
};
76+
77+
&tim2_ch1_pwm_out_pa0 {
78+
slew-rate = "max-speed-50mhz";
79+
bias-pull-up;
80+
drive-push-pull;
81+
};
82+
83+
&tim2_ch2_pwm_out_pa1{
84+
slew-rate = "max-speed-50mhz";
85+
bias-pull-up;
86+
drive-push-pull;
87+
};

0 commit comments

Comments
 (0)