Skip to main content
Wechmarer
Associate
January 26, 2023
Question

What's the function of the pins property in device tree?

  • January 26, 2023
  • 1 reply
  • 961 views

I modified the device tree by a patch to disable HW flow control. It seems the port is still working as expected.

  1. Why are the pins grouped by 'pins1' ... 'pinsN'? Is this just to apply the same settings to these pins?
  2. Why can I remove some pins and RX is still RX and TX is still TX and not shifted because I removed an entry? How is this detected by the driver?

Here is my patch:

usart2_pins_c: usart2-2 {
 		pins1 {
-			pinmux = <STM32_PINMUX('D', 5, AF7)>, /* USART2_TX */
-				 <STM32_PINMUX('D', 4, AF7)>; /* USART2_RTS */
+			pinmux = <STM32_PINMUX('D', 5, AF7)>; /* USART2_TX */
 			bias-disable;
 			drive-push-pull;
 			slew-rate = <3>;
 		};
 		pins2 {
-			pinmux = <STM32_PINMUX('D', 6, AF7)>, /* USART2_RX */
-				 <STM32_PINMUX('D', 3, AF7)>; /* USART2_CTS_NSS */
+			pinmux = <STM32_PINMUX('D', 6, AF7)>; /* USART2_RX */
 			bias-disable;
 		};
 	};

This topic has been closed for replies.

1 reply

Erwan SZYMANSKI
Technical Moderator
January 27, 2023

Hello @Wechmarer​ ,

You can fin some documentation concerning pinctrl and pins DT node in the wiki:

If you take a look at the stm32-usart driver, you will be able to find the different calls to the pinctrl framework and understand how does it works, in parallel with the precedent wiki links.

I hope that these links will help you to catch the utility of pins node.

Kind regards,

Erwan

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.