Skip to main content
phenom
Associate III
July 9, 2019
Solved

Force DMA stop for Burst mode on stm32f7xxx

  • July 9, 2019
  • 4 replies
  • 1943 views

Hi,

I am working on eval stm32f769. I have used DMA burst mode in circular.

I want to forcefully abort DMA stream and DMA, so that on I can restart DMA burst with different sequence.

I have used HAL_TIM_DMABurst_WriteStart() API for starting burst mode and HAL_TIM_DMABurst_WriteStop() for stopping burst mode.

Suppose a DMA burst sequence is going on and in middle of transfer I stop DMA using HAL_TIM_DMABurst_WriteStop().

DMA doesn't gets stopped. My next DMA sequence gets start after waiting for previous burst time elapse.

I want to start new DMA burst sequence as soon as I stop DMA burst by calling

HAL_TIM_DMABurst_WriteStop().

Please suggest how to proceed.

This topic has been closed for replies.
Best answer by waclawek.jan

> DMA burst mode: BurstRequestSrc TIM DMA Request sources is TIM_DMA_UPDATE.

Try calling HAL_TIM_GenerateEvent(yourtimer, TIM_EVENTSOURCE_UPDATE) after HAL_TIM_DMABurst_WriteStart().

JW

4 replies

phenom
phenomAuthor
Associate III
July 16, 2019

Any suggestions please!

waclawek.jan
Super User
July 17, 2019

> DMA doesn't gets stopped.

How do you know that? What are the symptoms? What is the related DMA registers' content?

What exactly do you mean by Burst mode?

I don't use Cube/HAL.

JW

phenom
phenomAuthor
Associate III
July 18, 2019

Hi,

DMA burst mode: BurstRequestSrc TIM DMA Request sources is TIM_DMA_UPDATE.

DMA in circular mode.

I am facing a problem as,

I have to two different PWM sequences. Suppose sequence one is doing DMA transfer and in middle of transfer I stop DMA write by HAL_TIM_DMABurst_WriteStop() API, DMA stops here.

And I immediately starts other sequence using HAL_TIM_DMABurst_WriteStart() API.

But new sequence does not gets started immediately. This other sequence waits for first sequence to be completed. I am using DMA in a circular mode.

New sequence gets started once I reached the end of first sequence.

e.g.

First sequence total time = 30 seconds.

Second sequence = 15 seconds

First sequence is doing DMA transfer and after 10 seconds I stop DMA write. And starts second sequence DMA write. Second sequence gets starts at the end of 30 seconds rather than being started immediately.

How do I start other sequence immediately?

Thanks.

waclawek.jan
Super User
July 18, 2019

I don't use Cube/HAL, and don't understand why the said function waits longer than necessary, sorry.

JW

phenom
phenomAuthor
Associate III
July 19, 2019

Can you help me with the correct way to use DMA burst mode? So that I can successfully run two different DMA sequences as I needed without using HAL.

Or any reference for using DMA burst mode will be helpful for me.

waclawek.jan
waclawek.janBest answer
Super User
September 11, 2019

> DMA burst mode: BurstRequestSrc TIM DMA Request sources is TIM_DMA_UPDATE.

Try calling HAL_TIM_GenerateEvent(yourtimer, TIM_EVENTSOURCE_UPDATE) after HAL_TIM_DMABurst_WriteStart().

JW

phenom
phenomAuthor
Associate III
September 11, 2019

Thanks JW,

It works.

> DMA burst mode: BurstRequestSrc TIM DMA Request sources is TIM_DMA_UPDATE.

Try calling HAL_TIM_GenerateEvent(yourtimer, TIM_EVENTSOURCE_UPDATE) after HAL_TIM_DMABurst_WriteStart().