cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable DMA to run continuously without re-enabling it.

zhiyongwoo
Associate III

Hi,

My application is to copy the content (32-bit Data) in the Memory to PORT ODR each time it detects a Falling Edge. I use DMA1 from TIMER CCP pin.

The problem I have is, DMA1 will stop as soon as it complete the transfer and require to re-enabling again.

Last time I use STM32F429ZI, I managed to get it running continuously without reenabling. But somehow I can't do it again?

Here is my Configuration in the STM32CubeMX for the DMA1:

Mode = Circular

Use FIFO = DISABLE

Increment Address on Peripheral = DISABLE

Increment Address on Memory = DISABLE

Data Width = Word (on both Peripheral and Memory)

I though by setting DMA mode to Circular then it will run continuously???? But it seems like it is not. Or is it the bugs in the STM32CubeMX?

1 ACCEPTED SOLUTION

Accepted Solutions
zhiyongwoo
Associate III

Okay, I think I found out why it stopped. From the SFR debug Window, I found out an Error Transfer and I think that is why it make it stop.

BTW, I am able to use DMA2 for USART TX and they are working perfectly fine. So I think the lib is okay or at least the lib I wrote is OKAY.

......... After some researches......

Okay, this is the issue and it is stated in this thread too: https://community.st.com/s/question/0D50X0000BftJYYSQ2/stm32f427-dma-transfer-error-why-not-ccm-issue

DMA1 can't access anything but APB1 peripherals on its peripheral port

Sorry ... I personally find this DMA is so F*** and S**T. All the small gotcha is making the developer crazy!

View solution in original post

3 REPLIES 3
berendi
Principal

> Last time I use STM32F429ZI, I managed to get it running continuously without reenabling. But somehow I can't do it again?

Do you have the source code from the last time?

> I though by setting DMA mode to Circular then it will run continuously????

Never assume that STM32CubeMX or the HAL library does what you think it should do.

> But it seems like it is not. Or is it the bugs in the STM32CubeMX?

There might be bugs, and there is poor documentation missing important details.

Read out the timer and DMA registers, and post their values here. You can as well check them against the more detailed and reliable documentation in the reference manual.

Circular DMA should never stop, unless stopped deliberately by software.

Read out and check/post the DMA registers content.

Cube/CubeMX may get into way if you do something Cube authors did not envisage. DMA is relatively simple so you can easily get rid of Cube for this task.

JW

zhiyongwoo
Associate III

Okay, I think I found out why it stopped. From the SFR debug Window, I found out an Error Transfer and I think that is why it make it stop.

BTW, I am able to use DMA2 for USART TX and they are working perfectly fine. So I think the lib is okay or at least the lib I wrote is OKAY.

......... After some researches......

Okay, this is the issue and it is stated in this thread too: https://community.st.com/s/question/0D50X0000BftJYYSQ2/stm32f427-dma-transfer-error-why-not-ccm-issue

DMA1 can't access anything but APB1 peripherals on its peripheral port

Sorry ... I personally find this DMA is so F*** and S**T. All the small gotcha is making the developer crazy!