cancel
Showing results for 
Search instead for 
Did you mean: 

Force DMA stop for Burst mode on stm32f7xxx

phenom
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions

> 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

View solution in original post

7 REPLIES 7
phenom
Associate II

Any suggestions please!

> 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

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.

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

JW

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.

> 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

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