cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX bug regarding LPUART1 DMA (MX_Device.h)

Reneb
Associate II

I use the STM32L496ZG. When generating the files using STM32CubeMX it also generates MX_Device.h which contains several defines. When using LPUART1 with DMA it also generates defines like:

#define MX_LPUART_RX_DMA_DMA_Handle
#define MX_LPUART_RX_DMA_Instance               DMA2_Channel7

The CMSIS Driver for the UART however uses:

#ifdef MX_LPUART1_RX_DMA_Instance
  #define UART6_DMA_USE_RX        UART_DMA_USE_RX
#else
  #define UART6_DMA_USE_RX        0
#endif

So using MX_LPUART1_RX_DMA_Instance is not the same as MX_LPUART_RX_DMA_Instance and causes the DMA to be disabled.

MX_Device.h should contain LPUART1 instead of LPUART with regards to the DMA defines as it also does with the Pin and IRQ defines.

2 REPLIES 2
Mahmoud Ben Romdhane
ST Employee

Hello @Reneb  ,

First let me thank you for posting and welcome to the ST Community.

Your request is under investigation, and I will get back to you ASAP.

For more investigation I suggest also that you provide your ioc file.

Thanks.

Mahmoud.

Hello @Mahmoud Ben Romdhane,

Attached you'll find the ioc file.

Regards,