Skip to content

Commit 45179f8

Browse files
drivers: serial: silabs: Fix uart tx abort at high baudrate
At high baudrate when using async api of the uart, the abort function in not giving the right informations since we're stopping the dma after getting the status of it. It makes the uart_async_api test failed on high baudrate. Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
1 parent 6ef3ea4 commit 45179f8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/serial/uart_silabs_usart.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,11 +539,12 @@ static int uart_silabs_async_tx_abort(const struct device *dev)
539539
USART_IntClear(config->base, USART_IF_TXC | USART_IF_TCMP2);
540540
(void)uart_silabs_pm_lock_put(dev, UART_SILABS_PM_LOCK_TX);
541541

542+
dma_stop(data->dma_tx.dma_dev, data->dma_tx.dma_channel);
543+
542544
if (!dma_get_status(data->dma_tx.dma_dev, data->dma_tx.dma_channel, &stat)) {
543545
data->dma_tx.counter = tx_buffer_length - stat.pending_length;
544546
}
545547

546-
dma_stop(data->dma_tx.dma_dev, data->dma_tx.dma_channel);
547548
data->dma_tx.enabled = false;
548549

549550
async_evt_tx_abort(data);

0 commit comments

Comments
 (0)