Skip to main content
phenom
Associate III
Jul 9, 2019 9:53 AM UTC
Solved

Force DMA stop for Burst mode on stm32f7xxx

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.
waclawek.jan
waclawek.janBest answer
Super User
Sep 11, 2019 8:56 AM UTC

> 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

7 replies

phenom
phenomAuthor
Associate III
Jul 16, 2019 10:42 AM UTC

Any suggestions please!

waclawek.jan
Super User
Jul 17, 2019 3:20 PM UTC

> 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
Jul 18, 2019 6:34 AM UTC

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
Jul 18, 2019 4:54 PM UTC

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

JW

phenom
phenomAuthor
Associate III
Jul 19, 2019 6:22 AM UTC

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
Sep 11, 2019 8:56 AM UTC

> 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
Sep 11, 2019 10:19 AM UTC

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().