2020-05-25 04:04 AM
Hello,
I use:
CubeIDE 1.3.0
STM32Cube_FW_F4_1.25.0
STM32F413CHU
I want to use DMA on UART5 on this uC but generated code (from CubeIDE) does not compile.
Channel used by this UART is DMA1->Stream7->Channel8
I use LL, not HAL for UART.
Into MX_UART5_Init function (Core/Src/usart.c), called in main, there is this following line:
LL_DMA_SetChannelSelection(DMA1, LL_DMA_STREAM_7, DMA_CHANNEL_8);
Unfortunately,DMA_CHANNEL_8 is not defined.
Actually, DMA_CHANNEL_x are not defined. However LL_DMA_CHANNEL_1 to LL_DMA_CHANNEL_7 are defined.
I added LL_DMA_CHANNEL_8 (into Drivers/STM32F4xx_HAL_Driver/STM32F4xx_ll_dma.h):
#define LL_DMA_CHANNEL_8 DMA_SxCR_CHSEL_3
I replaced DMA_CHANNEL_8 to LL_DMA_CHANNEL_8 and my code is compiling.
My code generation produces an error.
I asked for help on ST Community platform:
TDK member suggested an omission. "They [DMA channels from 8] are defined within stm32f4xx_hal_dma.h but not within stm32f4xx_ll_dma.h"
I hope this post will help you.
Thanks for your help.
2020-06-03 05:46 AM
Hello @nSTAC.1 ,
I take your feedback into consideration and I will raise this internally.
Thank you
Regards