2018-07-05 11:01 PM
If I declare the ADC-DMA dest buffer as
static uint32_t adc32_dma [5];
and call
HAL_ADC_Start_DMA (&hadc, adc32_dma, 5);
I get wrong results in dest buffer.
If I declare the ADC-DMA dest buffer as
static uint16_t adc16_dma [5];
and call
HAL_ADC_Start_DMA (&hadc, (uint32_t *)adc16_dma, 5);
I get correct results in dest buffer.
Two questions:- Why we have to define a 16bit buffer but pass it as (uint32_t *) to HAL?
- Why this is undocumented in Description of STM32F0 HAL and low-layer drivers?
Took me half a day to finally find it in an example...Juergen2018-07-06 01:58 AM
Solved:
One has to configure DMA in CubeMX for WORD transfer (default is HALFWORD==16bit), then can use 32 bit ADC-DMA-dest buffers: