changeset 923:6fc0e3d230e4 Evo_2_23

UART6 DMA handling: Make sure that RX transmission uses DMA stream 2
author Ideenmodellierer
date Mon, 04 Nov 2024 20:21:02 +0100
parents 7c996354b8ac
children 4d98fb2a178e
files Small_CPU/Src/stm32f4xx_it_v3.c Small_CPU/Src/uart_Internal.c
diffstat 2 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Small_CPU/Src/stm32f4xx_it_v3.c	Sun Nov 03 20:53:05 2024 +0100
+++ b/Small_CPU/Src/stm32f4xx_it_v3.c	Mon Nov 04 20:21:02 2024 +0100
@@ -250,7 +250,7 @@
 }
 
 #ifdef ENABLE_GPIO_V2
-void DMA2_Stream1_IRQHandler(void)
+void DMA2_Stream2_IRQHandler(void)
 {
   HAL_DMA_IRQHandler(&hdma_usart6_rx);
 }
--- a/Small_CPU/Src/uart_Internal.c	Sun Nov 03 20:53:05 2024 +0100
+++ b/Small_CPU/Src/uart_Internal.c	Mon Nov 04 20:21:02 2024 +0100
@@ -103,7 +103,7 @@
 
 	/* USART6 DMA Init */
 	/* USART6_RX Init */
-	hdma_usart6_rx.Instance = DMA2_Stream1;
+	hdma_usart6_rx.Instance = DMA2_Stream2;
 	hdma_usart6_rx.Init.Channel = DMA_CHANNEL_5;
 	hdma_usart6_rx.Init.Direction = DMA_PERIPH_TO_MEMORY;
 	hdma_usart6_rx.Init.PeriphInc = DMA_PINC_DISABLE;
@@ -174,6 +174,11 @@
 	huart6.Init.HwFlowCtl = UART_HWCONTROL_NONE;
 	huart6.Init.OverSampling = UART_OVERSAMPLING_16;
 	HAL_UART_Init(&huart6);
+
+	UART_clearRx6Buffer();
+	dmaRx6Active = 0;
+	dmaTx6Active = 0;
+	tx6BufferQueLen = 0;
 }