From f7403b11e2396abf972c49a79be09495ee09240c Mon Sep 17 00:00:00 2001 From: David Hendricks Date: Mon, 19 May 2014 16:24:17 -0700 Subject: [PATCH] stm32: Enable USART TCIE after clearing TC After clearing the TC flag, we should re-enable TCIE so that when the DMA transfer is done we re-interrupt and allow uart_process_output() to continue printing whatever is in the circular buffer (in the case of wrap-around) or finish gracefully if there is nothing left in the buffer. BUG=chrome-os-partner:28837 BRANCH=nyan TEST=Commands now reliably print full output whereas before they might appear truncated until another interrupt was triggered to finish printing the buffer. Change-Id: I0a4236139f57812f384e2b99af45195537201a04 Signed-off-by: Randall Spangler Signed-off-by: David Hendricks Reviewed-on: https://chromium-review.googlesource.com/200499 --- chip/stm32/uart.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chip/stm32/uart.c b/chip/stm32/uart.c index e693d4ecaa..6221b62e9e 100644 --- a/chip/stm32/uart.c +++ b/chip/stm32/uart.c @@ -96,6 +96,9 @@ void uart_tx_dma_start(const char *src, int len) /* Force clear TC so we don't re-interrupt */ STM32_USART_SR(UARTN) &= ~STM32_USART_SR_TC; + /* Enable TCIE (chrome-os-partner:28837) */ + STM32_USART_CR1(UARTN) |= STM32_USART_CR1_TCIE; + /* Start DMA */ dma_go(dma_get_channel(dma_tx_option.channel)); }