Skip to main content
iguffick2
Associate II
October 9, 2023
Solved

Circular DMA on ADC runs once and stops

  • October 9, 2023
  • 1 reply
  • 2559 views

I'm using an STM32H563. Setup to get ADC captures into a buffer using DMA in circular mode.

I have TIM1 triggering an ADC1 conversion of two channels. And a buffer with 16 readings using DMA. The GPDMA is set in Standard Request Mode and Circular enabled. To debug I have a counter in HAL_ADC_ConvCpltCallback to see how many times it is called.

The buffer of 16 values is populated with values, and I get a call to the callback function once. But it then stops, I don't get any more call backs.

I was expecting the circular mode to give a trigger once the buffer was full, but then loop around and continue filling the buffer a second and third time, each time giving a callback.

I can see that the init to set circular mode are being added to the stm32h5xx_hal_msp.c but don't seem to be doing what I expect.

I've attached a sample project and IOC file.

This topic has been closed for replies.
Best answer by Simon.T

Hello @iguffick2 ,

In the ADC parameter setting, can you try by enabling the DMA Countinious Requests ?

 

Best regards,

 

Simon 

1 reply

Simon.T
Simon.TBest answer
ST Employee
October 9, 2023

Hello @iguffick2 ,

In the ADC parameter setting, can you try by enabling the DMA Countinious Requests ?

 

Best regards,

 

Simon 

iguffick2
iguffick2Author
Associate II
October 10, 2023

That's all that it needed. ADC values now populating with DMA and giving callback interrupts.

Thank you.