cancel
Showing results for 
Search instead for 
Did you mean: 

How do I configure/program with MDMA?

elso
Associate III

Hi All,

I am struggling with that the maximum DMA buffer size is 64KB. I am currently transferring the data from an ADC to the Buffer using DMA with circular buffering, but I would want the buffer to be around 200KB. I have heard that one can use MDMA to transfer the DMA buffer information to a bigger buffer. I have never used MDMA before, and there is little information online about how to use it in CubeIDE. If someone can help me to configure the MDMA/DMA to do this, and what functions to use it would be very helpful!

Best regards,

Elso

1 ACCEPTED SOLUTION

Accepted Solutions
elso
Associate III

Finally figured it out. This is how I would configure a 6 noded linked list. 

elso_4-1699536692092.png

This linked list will do a transfer from the a source buffer to a destination buffer when triggered by a software call: 

HAL_MDMA_GenerateSWRequest(&hmdma_mdma_channel0_sw_0);

These blocks below in the config file will need to be configured for each node. Example: Source address is replaced with the ptr or address to the source buffer. Destination address is configured the same way for the destination buffer. I would use block count 1 assuming you want to send 1 block, and block size, the size of the data you send. 

elso_3-1699536650099.png

 

View solution in original post

5 REPLIES 5
elso
Associate III

elso_0-1698236433496.png

Like this

EXUE.2
ST Employee

you can find the STM32 cube demos for MDMA on st.com, or can use Cube-MX to build MDMA function automatically.

for example, STM32H747 MCU has MDMA module, you can find "STM32H747", you can find it on st.com, then you can get the completely demo to how to use MDMA.

EXUE2_0-1698832438038.png

 

elso
Associate III

Most of these files does not use a config file/ .IOC. Is MDMA enabled by default? Or do I have to define the macro myself to get the MDMA features?

elso
Associate III
 

elso_2-1698845849934.png

In this picture it shows that we can configure that DMA can trigger a request for MDMA, however is it possible for HF (half full), and not only TC (Transfer complete)?

Edit:

Not HF, I meant HT.

elso
Associate III

Finally figured it out. This is how I would configure a 6 noded linked list. 

elso_4-1699536692092.png

This linked list will do a transfer from the a source buffer to a destination buffer when triggered by a software call: 

HAL_MDMA_GenerateSWRequest(&hmdma_mdma_channel0_sw_0);

These blocks below in the config file will need to be configured for each node. Example: Source address is replaced with the ptr or address to the source buffer. Destination address is configured the same way for the destination buffer. I would use block count 1 assuming you want to send 1 block, and block size, the size of the data you send. 

elso_3-1699536650099.png