Skip to main content
HMay.1
Associate
February 22, 2020
Question

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.

  • February 22, 2020
  • 2 replies
  • 775 views

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

This topic has been closed for replies.

2 replies

Amel NASRI
Technical Moderator
March 9, 2020

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 "Best Answer" on the reply which solved your issue or answered your question.
HMay.1
HMay.1Author
Associate
March 13, 2020

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

victagayun
Senior III
May 23, 2020

Hello I may have the same problem with G4.

It does not include DMAx_CHANNELx_CLK_ENABLE();.