Skip to main content
Associate
May 23, 2025
Solved

MDMA STM32MP153C on Cortex M4 to move data to/from DDR to SRAM

  • May 23, 2025
  • 2 replies
  • 313 views

I would like to use MDMA on Cortex M4 to move data from DDR to SRAM in order to overcome the SRAM size limitation, especially in Ecosystem 6 secure context when a SYSRAM bank is dedicated to OPTEE.

My idea is to move to DDR some data structures used by code running on Cortex M4 and, when needed by the code, to use MDMA to move such data from DDR to SRAM and then to unload such same structures from SRAM to DDR.

I found that MDMA is the preferred way to move data DDR <-> SRAM, but it isn't supported by STM32 MCUs Embedded Software.

https://wiki.stmicroelectronics.cn/stm32mpu/wiki/MDMA_internal_peripheral#Software_frameworks_and_drivers

Do you have any suggestion about how to proceed ?

Best answer by Martin Devera

It is a bit old question, but anyway. Steal some chans from linux:

&mdma1 {
dma-channels = <28>; // need last 4 chans for MCU
};

in MCU, enable MDMA clock in RCC_MC_AHB6ENSETR a setup channel 28

as you need. MDMA structs/consts are in CMSIS headers.

Because there is only one IRQ for MDMA, you can use linked transfers to write

into EXTI->SWIER1 and create your own transfer-done IRQ.

We use it in this way.

Martin

2 replies

Martin Devera
Martin DeveraBest answer
Associate III
November 19, 2025

It is a bit old question, but anyway. Steal some chans from linux:

&mdma1 {
dma-channels = <28>; // need last 4 chans for MCU
};

in MCU, enable MDMA clock in RCC_MC_AHB6ENSETR a setup channel 28

as you need. MDMA structs/consts are in CMSIS headers.

Because there is only one IRQ for MDMA, you can use linked transfers to write

into EXTI->SWIER1 and create your own transfer-done IRQ.

We use it in this way.

Martin

Associate
March 6, 2026

Really thank you Martin!

I did it and it works!

   Andrea