Skip to content

Commit 2445b1d

Browse files
authored
[bsp][stm32][uart]:fix stm32 uart timout (#10022)
fix:stm32 uart timout
1 parent 88195c8 commit 2445b1d

File tree

109 files changed

+548
-14
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+548
-14
lines changed

bsp/stm32/libraries/HAL_Drivers/drivers/drv_usart.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434
static void stm32_dma_config(struct rt_serial_device *serial, rt_ubase_t flag);
3535
#endif
3636

37-
/* Number of while blocking timeouts for the stm32_putc */
38-
#define TX_BLOCK_TIMEOUT 2000
39-
4037
enum
4138
{
4239
#ifdef BSP_USING_UART1
@@ -233,8 +230,7 @@ static rt_err_t stm32_configure(struct rt_serial_device *serial, struct serial_c
233230
return -RT_ERROR;
234231
}
235232
uart->DR_mask = stm32_uart_get_mask(uart->handle.Init.WordLength, uart->handle.Init.Parity);
236-
uart->tx_block_timeout = TX_BLOCK_TIMEOUT;
237-
233+
uart->tx_block_timeout = BSP_STM32_UART_V1_TX_TIMEOUT;
238234
return RT_EOK;
239235
}
240236

bsp/stm32/libraries/templates/stm32f0xx/board/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ menu "On-chip Peripheral Drivers"
2323
default y
2424
select RT_USING_SERIAL
2525
if BSP_USING_UART
26+
config BSP_STM32_UART_V1_TX_TIMEOUT
27+
int "UART TX timeout"
28+
default 2000
29+
depends on RT_USING_SERIAL_V1
30+
2631
config BSP_USING_UART1
2732
bool "Enable UART1"
2833
default y

bsp/stm32/libraries/templates/stm32f10x/board/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ menu "On-chip Peripheral Drivers"
2323
default y
2424
select RT_USING_SERIAL
2525
if BSP_USING_UART
26+
config BSP_STM32_UART_V1_TX_TIMEOUT
27+
int "UART TX timeout"
28+
default 2000
29+
depends on RT_USING_SERIAL_V1
30+
2631
config BSP_USING_UART1
2732
bool "Enable UART1"
2833
default y

bsp/stm32/libraries/templates/stm32f2xx/board/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ menu "On-chip Peripheral Drivers"
2323
default y
2424
select RT_USING_SERIAL
2525
if BSP_USING_UART
26+
config BSP_STM32_UART_V1_TX_TIMEOUT
27+
int "UART TX timeout"
28+
default 2000
29+
depends on RT_USING_SERIAL_V1
30+
2631
config BSP_USING_UART1
2732
bool "Enable UART1"
2833
default y

bsp/stm32/libraries/templates/stm32f3xx/board/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ menu "On-chip Peripheral Drivers"
2323
default y
2424
select RT_USING_SERIAL
2525
if BSP_USING_UART
26+
config BSP_STM32_UART_V1_TX_TIMEOUT
27+
int "UART TX timeout"
28+
default 2000
29+
depends on RT_USING_SERIAL_V1
30+
2631
config BSP_USING_UART2
2732
bool "Enable UART2"
2833
default y

bsp/stm32/libraries/templates/stm32f4xx/board/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ menu "On-chip Peripheral Drivers"
2323
default y
2424
select RT_USING_SERIAL
2525
if BSP_USING_UART
26+
config BSP_STM32_UART_V1_TX_TIMEOUT
27+
int "UART TX timeout"
28+
default 2000
29+
depends on RT_USING_SERIAL_V1
30+
2631
config BSP_USING_UART1
2732
bool "Enable UART1"
2833
default y

bsp/stm32/libraries/templates/stm32f7xx/board/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ menu "On-chip Peripheral Drivers"
2323
default y
2424
select RT_USING_SERIAL
2525
if BSP_USING_UART
26+
config BSP_STM32_UART_V1_TX_TIMEOUT
27+
int "UART TX timeout"
28+
default 2000
29+
depends on RT_USING_SERIAL_V1
30+
2631
config BSP_USING_UART1
2732
bool "Enable UART1"
2833
default y

bsp/stm32/libraries/templates/stm32h7xx/board/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ menu "On-chip Peripheral Drivers"
2323
default y
2424
select RT_USING_SERIAL
2525
if BSP_USING_UART
26+
config BSP_STM32_UART_V1_TX_TIMEOUT
27+
int "UART TX timeout"
28+
default 2000
29+
depends on RT_USING_SERIAL_V1
30+
2631
config BSP_USING_UART1
2732
bool "Enable UART1"
2833
default y

bsp/stm32/libraries/templates/stm32l1xx/board/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ menu "On-chip Peripheral Drivers"
5252
default y
5353
select RT_USING_SERIAL
5454
if BSP_USING_UART
55+
config BSP_STM32_UART_V1_TX_TIMEOUT
56+
int "UART TX timeout"
57+
default 2000
58+
depends on RT_USING_SERIAL_V1
59+
5560
config BSP_USING_UART1
5661
bool "Enable UART1"
5762
default y

bsp/stm32/libraries/templates/stm32l4xx/board/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ menu "On-chip Peripheral Drivers"
2323
default y
2424
select RT_USING_SERIAL
2525
if BSP_USING_UART
26+
config BSP_STM32_UART_V1_TX_TIMEOUT
27+
int "UART TX timeout"
28+
default 2000
29+
depends on RT_USING_SERIAL_V1
30+
2631
config BSP_USING_UART1
2732
bool "Enable UART1"
2833
default y

0 commit comments

Comments
 (0)