cancel
Showing results for 
Search instead for 
Did you mean: 

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

andreatessadri
Associate

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 ?

1 REPLY 1
Martin Devera
Associate III

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