AnsweredAssumed Answered

Bug On CubeMX 4.20.1? STM32F407 Triple Mode and DMA

Question asked by Pablo Leibovich on Apr 7, 2017
Latest reply on May 22, 2018 by Cyril FENARD

Hi all!

I want to you use all of the ADC of the STM32F407VG in triple regular simultaneous mode and to save a buffer of samples in RAM with DMA.

I configure everything with CubeMX and when I debug it, I cannot access memory positions after the buffering. Getting inside the drivers, I found that the DMA channel of the ADC is configured as this:

hdma_adc1.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
hdma_adc1.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;



Searching in the reference manual, I learned that the Common data register in triple mode has 32 bits, so the data is saved on the LSB of the register, but the memory transfer must be done with 32 bits. Reconfiguring the buffer to be 32 bit long and DMA:

 hdma_adc1.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
hdma_adc1.Init.MemDataAlignment = DMA_MDATAALIGN_WORD;

It works ok!

My question is, is this a bug of CubeMX for not notificate that half word DMA is not possible?

Thanks to all!