From 37d545a52fb34c8d23fa35daf8171f423bb5ac33 Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Wed, 21 May 2025 19:07:01 +0200 Subject: [PATCH] boards: st: fix STM32L4 boards DTS files coding style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix board DTS coding style issues to prevent they spread when a new board is introduced and used this DTS as example start point. Issues addressed from Zephyr devicetree style guidelines [1]: - Don’t insert empty lines before a dedenting };. - Insert a single empty line to separate nodes at the same hierarchy level. No functional change. Link: https://docs.zephyrproject.org/latest/contribute/style/devicetree.html [1] Signed-off-by: Etienne Carriere --- boards/st/b_l4s5i_iot01a/b_l4s5i_iot01a.dts | 4 +++- boards/st/disco_l475_iot1/disco_l475_iot1.dts | 6 +++++- boards/st/nucleo_l412rb_p/nucleo_l412rb_p.dts | 2 ++ boards/st/nucleo_l432kc/nucleo_l432kc.dts | 1 + boards/st/nucleo_l433rc_p/nucleo_l433rc_p.dts | 2 ++ boards/st/nucleo_l452re/nucleo_l452re.dts | 1 + boards/st/nucleo_l452re/nucleo_l452re_common.dtsi | 6 +++--- boards/st/nucleo_l452re/nucleo_l452re_stm32l452xx_p.dts | 1 + boards/st/nucleo_l476rg/nucleo_l476rg.dts | 2 ++ boards/st/nucleo_l496zg/nucleo_l496zg.dts | 4 ++++ boards/st/nucleo_l4a6zg/nucleo_l4a6zg.dts | 4 ++++ boards/st/nucleo_l4r5zi/nucleo_l4r5zi.dts | 2 ++ boards/st/sensortile_box/sensortile_box.dts | 9 +++++++-- boards/st/stm32l476g_disco/stm32l476g_disco.dts | 7 +++++++ boards/st/stm32l496g_disco/stm32l496g_disco.dts | 7 ++++++- boards/st/stm32l4r9i_disco/stm32l4r9i_disco.dts | 7 +++++++ 16 files changed, 57 insertions(+), 8 deletions(-) diff --git a/boards/st/b_l4s5i_iot01a/b_l4s5i_iot01a.dts b/boards/st/b_l4s5i_iot01a/b_l4s5i_iot01a.dts index da6bcc44c6a..c476d87c12f 100644 --- a/boards/st/b_l4s5i_iot01a/b_l4s5i_iot01a.dts +++ b/boards/st/b_l4s5i_iot01a/b_l4s5i_iot01a.dts @@ -27,10 +27,12 @@ leds { compatible = "gpio-leds"; + green_led_1: led_1 { gpios = <&gpioa 5 GPIO_ACTIVE_HIGH>; label = "User LD1"; }; + green_led_2: led_2 { gpios = <&gpiob 14 GPIO_ACTIVE_HIGH>; label = "User LD2"; @@ -39,6 +41,7 @@ gpio_keys { compatible = "gpio-keys"; + user_button: button { label = "User"; gpios = <&gpioc 13 GPIO_ACTIVE_LOW>; @@ -173,7 +176,6 @@ }; &flash0 { - partitions { compatible = "fixed-partitions"; #address-cells = <1>; diff --git a/boards/st/disco_l475_iot1/disco_l475_iot1.dts b/boards/st/disco_l475_iot1/disco_l475_iot1.dts index 166d24c3ee5..a044ca256bf 100644 --- a/boards/st/disco_l475_iot1/disco_l475_iot1.dts +++ b/boards/st/disco_l475_iot1/disco_l475_iot1.dts @@ -27,10 +27,12 @@ leds { compatible = "gpio-leds"; + green_led_1: led_1 { gpios = <&gpioa 5 GPIO_ACTIVE_HIGH>; label = "User LD1"; }; + green_led_2: led_2 { gpios = <&gpiob 14 GPIO_ACTIVE_HIGH>; label = "User LD2"; @@ -39,6 +41,7 @@ gpio_keys { compatible = "gpio-keys"; + user_button: button_0 { label = "User"; gpios = <&gpioc 13 GPIO_ACTIVE_LOW>; @@ -58,6 +61,7 @@ pwms = <&pwm2 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>; label = "green LD1"; }; + green_pwm_2: green_led_2 { pwms = <&pwm15 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>; label = "green LD2"; @@ -336,7 +340,7 @@ zephyr_udc0: &usbotg_fs { slot1_partition: partition@0 { label = "image-1"; reg = <0x00000000 DT_SIZE_K(864)>; - }; + }; slot2_partition: partition@d8000 { label = "image-3"; diff --git a/boards/st/nucleo_l412rb_p/nucleo_l412rb_p.dts b/boards/st/nucleo_l412rb_p/nucleo_l412rb_p.dts index 0ffe4545645..6ff8c2c51e8 100644 --- a/boards/st/nucleo_l412rb_p/nucleo_l412rb_p.dts +++ b/boards/st/nucleo_l412rb_p/nucleo_l412rb_p.dts @@ -23,6 +23,7 @@ leds: leds { compatible = "gpio-leds"; + green_led: led_0 { gpios = <&gpiob 13 GPIO_ACTIVE_HIGH>; label = "User LD4"; @@ -31,6 +32,7 @@ gpio_keys { compatible = "gpio-keys"; + user_button: button { label = "User"; gpios = <&gpioc 13 GPIO_ACTIVE_LOW>; diff --git a/boards/st/nucleo_l432kc/nucleo_l432kc.dts b/boards/st/nucleo_l432kc/nucleo_l432kc.dts index f6a3d568913..334ef93f8ba 100644 --- a/boards/st/nucleo_l432kc/nucleo_l432kc.dts +++ b/boards/st/nucleo_l432kc/nucleo_l432kc.dts @@ -22,6 +22,7 @@ leds: leds { compatible = "gpio-leds"; + green_led: led_0 { gpios = <&gpiob 3 GPIO_ACTIVE_HIGH>; label = "User LD3"; diff --git a/boards/st/nucleo_l433rc_p/nucleo_l433rc_p.dts b/boards/st/nucleo_l433rc_p/nucleo_l433rc_p.dts index 4e483b55f00..f81010a1378 100644 --- a/boards/st/nucleo_l433rc_p/nucleo_l433rc_p.dts +++ b/boards/st/nucleo_l433rc_p/nucleo_l433rc_p.dts @@ -24,6 +24,7 @@ leds: leds { compatible = "gpio-leds"; + green_led: led_0 { gpios = <&gpiob 13 GPIO_ACTIVE_HIGH>; label = "User LD4"; @@ -32,6 +33,7 @@ gpio_keys { compatible = "gpio-keys"; + user_button: button { gpios = <&gpioc 13 GPIO_ACTIVE_LOW>; label = "User"; diff --git a/boards/st/nucleo_l452re/nucleo_l452re.dts b/boards/st/nucleo_l452re/nucleo_l452re.dts index e488fb1bccf..df6bb0ee710 100644 --- a/boards/st/nucleo_l452re/nucleo_l452re.dts +++ b/boards/st/nucleo_l452re/nucleo_l452re.dts @@ -17,6 +17,7 @@ leds: leds { compatible = "gpio-leds"; + green_led: led_0 { gpios = <&gpioa 5 GPIO_ACTIVE_HIGH>; label = "User LD2"; diff --git a/boards/st/nucleo_l452re/nucleo_l452re_common.dtsi b/boards/st/nucleo_l452re/nucleo_l452re_common.dtsi index 8db389d9074..8f6d3f468e5 100644 --- a/boards/st/nucleo_l452re/nucleo_l452re_common.dtsi +++ b/boards/st/nucleo_l452re/nucleo_l452re_common.dtsi @@ -24,6 +24,7 @@ gpio_keys { compatible = "gpio-keys"; + user_button: button { label = "User"; gpios = <&gpioc 13 GPIO_ACTIVE_LOW>; @@ -116,9 +117,8 @@ compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - /* - * Reserve the final 16 KiB for file system partition - */ + + /* Reserve the final 16 KiB for file system partition */ storage_partition: partition@7c000 { label = "storage"; reg = <0x0007c000 0x00004000>; diff --git a/boards/st/nucleo_l452re/nucleo_l452re_stm32l452xx_p.dts b/boards/st/nucleo_l452re/nucleo_l452re_stm32l452xx_p.dts index 3a49bbea357..2558012a592 100644 --- a/boards/st/nucleo_l452re/nucleo_l452re_stm32l452xx_p.dts +++ b/boards/st/nucleo_l452re/nucleo_l452re_stm32l452xx_p.dts @@ -16,6 +16,7 @@ leds: leds { compatible = "gpio-leds"; + green_led: led_0 { gpios = <&gpiob 13 GPIO_ACTIVE_HIGH>; label = "User LD2"; diff --git a/boards/st/nucleo_l476rg/nucleo_l476rg.dts b/boards/st/nucleo_l476rg/nucleo_l476rg.dts index 4a63a5ad328..cb72c3547fd 100644 --- a/boards/st/nucleo_l476rg/nucleo_l476rg.dts +++ b/boards/st/nucleo_l476rg/nucleo_l476rg.dts @@ -24,6 +24,7 @@ leds: leds { compatible = "gpio-leds"; + green_led_2: led_2 { gpios = <&gpioa 5 GPIO_ACTIVE_HIGH>; label = "User LD2"; @@ -32,6 +33,7 @@ gpio_keys { compatible = "gpio-keys"; + user_button: button { label = "User"; gpios = <&gpioc 13 GPIO_ACTIVE_LOW>; diff --git a/boards/st/nucleo_l496zg/nucleo_l496zg.dts b/boards/st/nucleo_l496zg/nucleo_l496zg.dts index 2589fef3342..4cd8233f6d8 100644 --- a/boards/st/nucleo_l496zg/nucleo_l496zg.dts +++ b/boards/st/nucleo_l496zg/nucleo_l496zg.dts @@ -23,14 +23,17 @@ leds: leds { compatible = "gpio-leds"; + green_led_1: led_1 { gpios = <&gpioc 7 GPIO_ACTIVE_HIGH>; label = "User LD1"; }; + blue_led_2: led_2 { gpios = <&gpiob 7 GPIO_ACTIVE_HIGH>; label = "User LD2"; }; + red_led_3: led_3 { gpios = <&gpiob 14 GPIO_ACTIVE_HIGH>; label = "User LD3"; @@ -47,6 +50,7 @@ gpio_keys { compatible = "gpio-keys"; + user_button: button { label = "User Button"; gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>; diff --git a/boards/st/nucleo_l4a6zg/nucleo_l4a6zg.dts b/boards/st/nucleo_l4a6zg/nucleo_l4a6zg.dts index 3e5a14298d9..7cd0c3e37c5 100644 --- a/boards/st/nucleo_l4a6zg/nucleo_l4a6zg.dts +++ b/boards/st/nucleo_l4a6zg/nucleo_l4a6zg.dts @@ -23,14 +23,17 @@ leds: leds { compatible = "gpio-leds"; + green_led_1: led_1 { gpios = <&gpioc 7 GPIO_ACTIVE_HIGH>; label = "User LD1"; }; + blue_led_2: led_2 { gpios = <&gpiob 7 GPIO_ACTIVE_HIGH>; label = "User LD2"; }; + red_led_3: led_3 { gpios = <&gpiob 14 GPIO_ACTIVE_HIGH>; label = "User LD3"; @@ -47,6 +50,7 @@ gpio_keys { compatible = "gpio-keys"; + user_button: button { label = "User Button"; gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>; diff --git a/boards/st/nucleo_l4r5zi/nucleo_l4r5zi.dts b/boards/st/nucleo_l4r5zi/nucleo_l4r5zi.dts index ad1586e4382..7c874a54c9d 100644 --- a/boards/st/nucleo_l4r5zi/nucleo_l4r5zi.dts +++ b/boards/st/nucleo_l4r5zi/nucleo_l4r5zi.dts @@ -23,6 +23,7 @@ leds: leds { compatible = "gpio-leds"; + green_led_0: led_0 { gpios = <&gpioc 7 GPIO_ACTIVE_HIGH>; label = "User LD1"; @@ -41,6 +42,7 @@ gpio_keys { compatible = "gpio-keys"; + user_button: button { label = "User"; gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>; diff --git a/boards/st/sensortile_box/sensortile_box.dts b/boards/st/sensortile_box/sensortile_box.dts index 84fee2824b4..a3284b9d8a5 100644 --- a/boards/st/sensortile_box/sensortile_box.dts +++ b/boards/st/sensortile_box/sensortile_box.dts @@ -24,6 +24,7 @@ leds { compatible = "gpio-leds"; + blue_led: led { gpios = <&gpiob 15 GPIO_ACTIVE_HIGH>; label = "User LD1"; @@ -37,6 +38,7 @@ gpio_keys { compatible = "gpio-keys"; + user_button: button { label = "User PB1"; gpios = <&gpiog 1 GPIO_ACTIVE_LOW>; @@ -138,7 +140,8 @@ pinctrl-names = "default"; status = "okay"; - cs-gpios = <&gpioe 11 GPIO_ACTIVE_LOW>, <&gpioe 12 GPIO_ACTIVE_LOW>, <&gpioe 10 GPIO_ACTIVE_LOW>; + cs-gpios = <&gpioe 11 GPIO_ACTIVE_LOW>, <&gpioe 12 GPIO_ACTIVE_LOW>, + <&gpioe 10 GPIO_ACTIVE_LOW>; lis2dw12: lis2dw12@0 { compatible = "st,lis2dw12"; @@ -168,6 +171,7 @@ pinctrl-names = "default"; status = "okay"; cs-gpios = <&gpiod 0 GPIO_ACTIVE_LOW>; + spbtle_1s_sensortile_box: spbtle-1s@0 { compatible = "st,hci-spi-v2"; reg = <0>; @@ -208,7 +212,6 @@ zephyr_udc0: &usbotg_fs { }; &flash0 { - partitions { compatible = "fixed-partitions"; #address-cells = <1>; @@ -229,10 +232,12 @@ zephyr_udc0: &usbotg_fs { label = "image-0"; reg = <0x00020000 DT_SIZE_K(432)>; }; + slot1_partition: partition@8c000 { label = "image-1"; reg = <0x0008C000 DT_SIZE_K(432)>; }; + scratch_partition: partition@f8000 { label = "image-scratch"; reg = <0x000F8000 DT_SIZE_K(24)>; diff --git a/boards/st/stm32l476g_disco/stm32l476g_disco.dts b/boards/st/stm32l476g_disco/stm32l476g_disco.dts index e2d8abec4b0..22286b190fc 100644 --- a/boards/st/stm32l476g_disco/stm32l476g_disco.dts +++ b/boards/st/stm32l476g_disco/stm32l476g_disco.dts @@ -26,10 +26,12 @@ leds { compatible = "gpio-leds"; + green_led_4: led_4 { gpios = <&gpiob 2 GPIO_ACTIVE_HIGH>; label = "User LD4"; }; + green_led_5: led_5 { gpios = <&gpioe 8 GPIO_ACTIVE_HIGH>; label = "User LD5"; @@ -38,26 +40,31 @@ gpio_keys { compatible = "gpio-keys"; + joy_center: joystick_center { label = "joystick center"; gpios = <&gpioa 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; zephyr,code = ; }; + joy_down: joystick_down { label = "joystick down"; gpios = <&gpioa 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; zephyr,code = ; }; + joy_up: joystick_up { label = "joystick up"; gpios = <&gpioa 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; zephyr,code = ; }; + joy_left: joystick_left { label = "joystick left"; gpios = <&gpioa 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; zephyr,code = ; }; + joy_right: joystick_right { label = "joystick right"; gpios = <&gpioa 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; diff --git a/boards/st/stm32l496g_disco/stm32l496g_disco.dts b/boards/st/stm32l496g_disco/stm32l496g_disco.dts index 7fd2f89ab9a..8fc6dc6cdaa 100644 --- a/boards/st/stm32l496g_disco/stm32l496g_disco.dts +++ b/boards/st/stm32l496g_disco/stm32l496g_disco.dts @@ -24,6 +24,7 @@ leds { compatible = "gpio-leds"; + green_led_2: led_2 { gpios = <&gpiob 13 GPIO_ACTIVE_HIGH>; label = "User LD2"; @@ -32,26 +33,31 @@ gpio_keys { compatible = "gpio-keys"; + joy_sel: joystick_select { label = "joystick select"; gpios = <&gpioc 13 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; zephyr,code = ; }; + joy_down: joystick_down { label = "joystick down"; gpios = <&gpioi 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; zephyr,code = ; }; + joy_up: joystick_up { label = "joystick up"; gpios = <&gpioi 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; zephyr,code = ; }; + joy_left: joystick_left { label = "joystick left"; gpios = <&gpioi 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; zephyr,code = ; }; + joy_right: joystick_right { label = "joystick right"; gpios = <&gpiof 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; @@ -69,7 +75,6 @@ volt-sensor0 = &vref; volt-sensor1 = &vbat; }; - }; &clk_lsi { diff --git a/boards/st/stm32l4r9i_disco/stm32l4r9i_disco.dts b/boards/st/stm32l4r9i_disco/stm32l4r9i_disco.dts index 94b46040ef7..5547b1c160b 100644 --- a/boards/st/stm32l4r9i_disco/stm32l4r9i_disco.dts +++ b/boards/st/stm32l4r9i_disco/stm32l4r9i_disco.dts @@ -22,10 +22,12 @@ leds { compatible = "gpio-leds"; + orange_led: led_1 { gpios = <&mfx 0 GPIO_ACTIVE_LOW>; label = "User LD1"; }; + green_led: led_2 { gpios = <&gpioh 4 GPIO_ACTIVE_LOW>; label = "User LD2"; @@ -34,26 +36,31 @@ gpio_keys { compatible = "gpio-keys"; + joy_sel: joystick_selection { label = "joystick selection"; gpios = <&gpioc 13 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; zephyr,code = ; }; + joy_up: joystick_up { label = "joystick up"; gpios = <&mfx 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; zephyr,code = ; }; + joy_down: joystick_down { label = "joystick down"; gpios = <&mfx 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; zephyr,code = ; }; + joy_right: joystick_right { label = "joystick right"; gpios = <&mfx 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; zephyr,code = ; }; + joy_left: joystick_left { label = "joystick left"; gpios = <&mfx 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;