cancel
Showing results for 
Search instead for 
Did you mean: 

The STM32CubeMX code generation is not properly working in case the ADC is triggered by the HRTIM timers and DMA is used to transfer the ADC values to memory.

HMay.1
Associate

When the file stm32f3xx_hal_msp.c is created there is a missing line in function void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc) which enables the DMA clock - ( __HAL_RCC_DMA1_CLK_ENABLE();

The STM32CubeMX generates code that enables that clock in main.c in a separate function called MX_DMA_Init(); But this is to late to configure DMA and make it work.

So with that extra line in HAL_ADC_MspInit everything is fine. Can you please fix that problem and offer an update so that everything works just out of the box.

PS: I really appreciate the STM32CubeMX. It is very handy

3 REPLIES 3
Amel NASRI
ST Employee

Hello @HMay.1​ ,

Which STM32CubeMX version are you using? This issue should be already fixed with the version 5.5 of the tool, currently we are on version 5.6.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

HMay.1
Associate

Hello Amel,

thanks for the reply. The version i am using is indeed version 5.4. But when i click on Help->Check for update the program tells me that everything is up to date. But this is another topic. I am glad you have fixed that issue.

regards

Hendrik

Hello I may have the same problem with G4.

It does not include DMAx_CHANNELx_CLK_ENABLE();.