Skip to main content
SWenn.1
Senior III
February 7, 2023
Question

DMA reset?

  • February 7, 2023
  • 3 replies
  • 1609 views

I have an A/D circular DMA that collects 192 samples...There can be times when an asynchronous push button event interrupts this while it is collecting. Can someone tell me the quickest solution for resetting the DMA so that after I service the push button event it will start collecting at the beginning again?

This topic has been closed for replies.

3 replies

Javier1
Principal
February 7, 2023

not saying is the fastest way but i use: hal_tim_stop

HAL_TIM_IC_Stop_DMA(ICtimerpointer, ICtimerRisingedgeChannel);
HAL_TIM_IC_Start_DMA(ICtimerpointer, ICtimerRisingedgeChannel, DMAcapturedriseData, DMAbufferSize);

hit me up in https://www.linkedin.com/in/javiermuñoz/
SWenn.1
SWenn.1Author
Senior III
February 7, 2023

Hi Javier.....

But does it reset the pointer so the circular buffer is back at the beginning? That is important to me that when I get done processing the button I don't want my DMA to pick up where it left off as that would mean samples from different times.....

Javier1
Principal
February 8, 2023

>>But does it reset the pointer so the circular buffer is back at the beginning?

I believe it does? set some debugging breaks in your code and let me know.

hit me up in https://www.linkedin.com/in/javiermuñoz/