Skip to main content
francois06
Associate II
February 20, 2019
Solved

Programming flash with DMA

  • February 20, 2019
  • 5 replies
  • 1931 views

Hello,

I would like to know if it's possible to write from RAM to FLASH using a DMA.

I tried to configure a DMA as memtomem, using the HAL_DMA_Start function but it doesn't work.

Is it doable ?

Thank you.

François

This topic has been closed for replies.
Best answer by Tesla DeLorean

It adds complication​ without any benefits or advantages, and is not a use case that is likely to work.

Check the error/status thrown by the DMA controller. It is likely not an error that can be resolved by hitting it harder.​

5 replies

Tesla DeLorean
Guru
February 20, 2019

Sounds like a bad plan.​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
francois06
Associate II
February 20, 2019

What do you mean ?

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
February 20, 2019

It adds complication​ without any benefits or advantages, and is not a use case that is likely to work.

Check the error/status thrown by the DMA controller. It is likely not an error that can be resolved by hitting it harder.​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
francois06
Associate II
February 20, 2019

Okay thanks for your explanation.

For those who wants to know more, I found another post which talks about this topic.

https://stackoverflow.com/questions/52773949/dma-to-flash-for-stm32

It explains in detail what you said.

turboscrew
Senior III
February 21, 2019

I don't think DMA is able to wait long enough for a write to be finished. Flash doesn't make requests, so you need to do memtomem, and DMA writes as fast as it can. One write to flash takes microseconds. Flash operations stall the uC, but I don't think they stall DMA.