Skip to content

Commit e31498c

Browse files
djiatsaf-stcfriedt
authored andcommitted
tests: drivers: uart: elementary: stm32: add support for hw flow control
- Configure and attach DMA for each USART node. - Enable hardware flow control capability. - Add RTS/CTS pin name signals. Note: Some platform series are missing due to conflicts with other pins used by different test drivers (RTS pin should be connected to the CTS pin.) Signed-off-by: Fabrice DJIATSA <[email protected]>
1 parent a86d902 commit e31498c

File tree

8 files changed

+163
-0
lines changed

8 files changed

+163
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright (c) 2025 STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
dut: &usart3 {
8+
pinctrl-0 = <&usart3_tx_pd8 &usart3_rx_pd9 &usart3_rts_pd2 &usart3_cts_pb13>;
9+
dmas = <&gpdma1 0 29 STM32_DMA_PERIPH_TX>,
10+
<&gpdma1 1 28 STM32_DMA_PERIPH_RX>;
11+
dma-names = "tx", "rx";
12+
hw-flow-control;
13+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* Copyright (c) 2025 STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
dut: &usart3 {
8+
pinctrl-0 = <&usart3_tx_pc10 &usart3_rx_pc11 &usart3_rts_pb14 &usart3_cts_pb13>;
9+
pinctrl-names = "default";
10+
dmas = <&dma1 2 (STM32_DMA_PERIPH_TX | STM32_DMA_PRIORITY_HIGH)>,
11+
<&dma1 1 (STM32_DMA_PERIPH_RX | STM32_DMA_PRIORITY_HIGH)>;
12+
dma-names = "tx", "rx";
13+
hw-flow-control;
14+
status = "okay";
15+
};
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) 2025 STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
dut: &usart1 {
8+
pinctrl-0 = <&usart1_tx_pb6 &usart1_rx_pb7 &usart1_rts_pa12 &usart1_cts_pa11>;
9+
dmas = <&dmamux1 3 51 STM32_DMA_PERIPH_TX>,
10+
<&dmamux1 4 50 STM32_DMA_PERIPH_RX>;
11+
dma-names = "tx", "rx";
12+
hw-flow-control;
13+
};
14+
15+
&dma1 {
16+
status = "okay";
17+
};
18+
19+
&dmamux1 {
20+
status = "okay";
21+
};
22+
23+
&usb {
24+
status = "disabled"
25+
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright (c) 2025 STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
dut: &usart1 {
8+
pinctrl-0 = <&usart1_tx_pc4 &usart1_rx_pc5 &usart1_rts_pa12 &usart1_cts_pa11>;
9+
dmas = <&dmamux1 2 25 STM32_DMA_PERIPH_TX>,
10+
<&dmamux1 1 24 STM32_DMA_PERIPH_RX>;
11+
dma-names = "tx", "rx";
12+
hw-flow-control;
13+
};
14+
15+
&dma1 {
16+
status = "okay";
17+
};
18+
19+
&dmamux1 {
20+
status = "okay";
21+
};
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (c) 2025 STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
dut: &usart2 {
8+
dmas = <&dmamux1 2 44 STM32_DMA_PERIPH_TX>,
9+
<&dmamux1 3 43 STM32_DMA_PERIPH_RX>;
10+
dma-names = "tx", "rx";
11+
pinctrl-0 = <&usart2_tx_pd5 &usart2_rx_pd6>;
12+
pinctrl-names = "default";
13+
current-speed = <115200>;
14+
hw-flow-control;
15+
status = "okay";
16+
};
17+
18+
&dma1 {
19+
status = "okay";
20+
};
21+
22+
&dma2 {
23+
status = "okay";
24+
};
25+
26+
&dmamux1 {
27+
status = "okay";
28+
};
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (c) 2025 STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
dut: &usart3 {
8+
pinctrl-0 = <&usart3_tx_pc10 &usart3_rx_pc11 &usart3_rts_pb14 &usart3_cts_pb13>;
9+
pinctrl-names = "default";
10+
dmas = <&dma1 2 (STM32_DMA_PERIPH_TX | STM32_DMA_PRIORITY_HIGH)>,
11+
<&dma1 3 (STM32_DMA_PERIPH_RX | STM32_DMA_PRIORITY_HIGH)>;
12+
dma-names = "tx", "rx";
13+
hw-flow-control;
14+
status = "okay";
15+
};
16+
17+
&dma1 {
18+
status = "okay";
19+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright (c) 2025 STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
dut: &usart2 {
8+
pinctrl-0 = <&usart2_tx_pd5 &usart2_rx_pf6 &usart2_rts_pg14 &usart2_cts_pg5>;
9+
dmas = <&gpdma1 0 110 STM32_DMA_PERIPH_TX>,
10+
<&gpdma1 1 109 STM32_DMA_PERIPH_RX>;
11+
dma-names = "tx", "rx";
12+
hw-flow-control;
13+
};
14+
15+
&gpdma1 {
16+
status = "okay";
17+
};
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) 2025 STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
dut: &usart3 {
8+
pinctrl-0 = <&usart3_tx_pc4 &usart3_rx_pc5 &usart3_rts_pb14 &usart3_cts_pb13>;
9+
dmas = <&dmamux1 5 74 STM32_DMA_PERIPH_TX>,
10+
<&dmamux1 4 73 STM32_DMA_PERIPH_RX>;
11+
dma-names = "tx", "rx";
12+
hw-flow-control;
13+
};
14+
15+
&dma1 {
16+
status = "okay";
17+
};
18+
19+
&dma2 {
20+
status = "okay";
21+
};
22+
23+
&dmamux1 {
24+
status = "okay";
25+
};

0 commit comments

Comments
 (0)