2024-07-08 08:15 AM
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
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 :)
Solved! Go to Solution.
2024-07-09 07:55 AM
Hi Sarra
Thanks for your reply.
I used that article, among others, to generate a standard request mode. I also chose that configuration in CubeMx. However, the generated code goes through the linked-list configuration when I debug HAL_ADC_Start_DMA()
I could resolve the issue though by setting the destination HW request bit CTR2.DREQ = 0
I had it set to 1 by mistake, so the DMA works fine now :)
Cheers
Ivo
2024-07-09 06:39 AM
Hello @IGärt.1,
Please refer to this article on how to to configure the GPDMA with Standard Request Mode: How to configure the GPDMA - STMicroelectronics Community
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-07-09 07:55 AM
Hi Sarra
Thanks for your reply.
I used that article, among others, to generate a standard request mode. I also chose that configuration in CubeMx. However, the generated code goes through the linked-list configuration when I debug HAL_ADC_Start_DMA()
I could resolve the issue though by setting the destination HW request bit CTR2.DREQ = 0
I had it set to 1 by mistake, so the DMA works fine now :)
Cheers
Ivo