From bfabd1d961566afd49d3af5d1b0e6ee4e53cb46a Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 5 Nov 2017 11:10:11 +0000 Subject: Fixed bug #901. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10956 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/STM32/LLD/USARTv1/hal_uart_lld.c | 7 ++++--- os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c | 7 ++++--- readme.txt | 2 ++ 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). -- cgit v1.2.3