STM32H5 - ADC DMA - Standard Request Example
Hello
I am looking for an example to get the ADC regular sequence transferred by DMA to memory going.
I use TIM15 to trigger the ADC regular sequence, which has four measurements, every 5 milliseconds. When I activate the EOS IRQ and toggle a GPIO I see that the four conversions are done. So that works fine.
However, if I start the GPDMA to transfer the ADC data to an array it copies the same value to all four array elements. I added another GPIO toggle to the GPDMA transfer complete ISR and see on the scope that the ISR is happening after the third conversion. Also strangely enough, the DMA half transfer complete ISR starts after the first conversion
On the ADC I enabled DMA (CFGR.DMAEN = 1) and set it to circular mode (CFGR.DMACFG = 1)
My GPDMA configuration is
- src/dest data width: HalfWord (CTR1.SDW_LOG2 = 1 / CTR1.DDW_LOG2 = 1)
- src/dest burst length: 1 (CTR1.DBL_1 = 0, CTR1.SBL_1 = 0)
- src increment: disable (CTR1.DINC = 0)
- dest increment: enable (CTR1.SINC = 1)
- BlockHwRequest: SingleBurst (CTR2.BREQ = 1)
- transfer event: Block (CTR2.TCEM = 0)
- transfer mode: Peripheral flow control (CTR2.PFREQ = 1)
I start the GPDMA with the correct source and destination addresses, and with a a data length of 8 (CBR1.BNDT = 8) which is four conversions with two bytes each.
I tired a lot of other configurations as well, but never get it going correctly.
To get an example from STM32CubeMx I chose GPDMA1 Channel 0 in "Standard Request Mode". However, the generated code creates a Linked-List configuration. I debugged the HAL_ADC_Start_DMA() function and it goes into the linked-list configuration. The example works fine, butI don't want to use the Linked-List configuration.
Does anyone know how to get a linked-list free example? Or has anyone observed similar behavior and was able to solve the issue?
Thanks for your inputs :)
