Question
STMF0 HAL ADC DMA buffer 16bit vs. 32bit
Posted on July 06, 2018 at 08:01
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...Juergen