aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--os/hal/ports/STM32/LLD/USARTv1/hal_uart_lld.c7
-rw-r--r--os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c7
-rw-r--r--readme.txt2
3 files changed, 10 insertions, 6 deletions
diff --git a/os/hal/ports/STM32/LLD/USARTv1/hal_uart_lld.c b/os/hal/ports/STM32/LLD/USARTv1/hal_uart_lld.c
index 6b36178ae..8cb5c1a8f 100644
--- a/os/hal/ports/STM32/LLD/USARTv1/hal_uart_lld.c
+++ b/os/hal/ports/STM32/LLD/USARTv1/hal_uart_lld.c
@@ -730,9 +730,10 @@ void uart_lld_start_send(UARTDriver *uartp, size_t n, const void *txbuf) {
dmaStreamSetMode(uartp->dmatx, uartp->dmamode | STM32_DMA_CR_DIR_M2P |
STM32_DMA_CR_MINC | STM32_DMA_CR_TCIE);
- /* Only enable TC interrupt if there's a callback attached to it.
- Also we need to clear TC flag which could be set before. */
- if (uartp->config->txend2_cb != NULL) {
+ /* Only enable TC interrupt if there's a callback attached to it or
+ if called from uartSendFullTimeout(). Also we need to clear TC flag
+ which could be set before.*/
+ if ((uartp->config->txend2_cb != NULL) || (uartp->early == false)) {
uartp->usart->SR = ~USART_SR_TC;
uartp->usart->CR1 |= USART_CR1_TCIE;
}
diff --git a/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c b/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c
index f00fa28ef..505cd537a 100644
--- a/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c
+++ b/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c
@@ -953,9 +953,10 @@ void uart_lld_start_send(UARTDriver *uartp, size_t n, const void *txbuf) {
dmaStreamSetMode(uartp->dmatx, uartp->dmamode | STM32_DMA_CR_DIR_M2P |
STM32_DMA_CR_MINC | STM32_DMA_CR_TCIE);
- /* Only enable TC interrupt if there's a callback attached to it.
- Also we need to clear TC flag which could be set before. */
- if (uartp->config->txend2_cb != NULL) {
+ /* Only enable TC interrupt if there's a callback attached to it or
+ if called from uartSendFullTimeout(). Also we need to clear TC flag
+ which could be set before.*/
+ if ((uartp->config->txend2_cb != NULL) || (uartp->early == false)) {
uartp->usart->ICR = USART_ICR_TCCF;
uartp->usart->CR1 |= USART_CR1_TCIE;
}
diff --git a/readme.txt b/readme.txt
index e558342b6..c7317cf9d 100644
--- a/readme.txt
+++ b/readme.txt
@@ -150,6 +150,8 @@
dependencies and configuration directories. This makes possible
to have multiple non-conflicting makefiles in the same project.
Updated the various platform.mk implementing "smart build" mode.
+- HAL: Fixed function uartSendFullTimeout() failing on STM32 USARTv1 and
+ v2 drivers (bug #901)(backported to 17.6.3 and 16.1.10).
- HAL: Fixed broken I2C fallback driver (bug #900)(backported to 17.6.3).
- LIB: Fixed heap buffer alignment not enforced (bug #899)(backported
to 17.6.3).