cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 need to trigger MDMA with exact delay after TC

SeyyedMohammad
Senior III

I want to trigger MDMA to do sequence of copy/paste by exact delay after TC.

My solution is: TC causes LPTIM to start one pulse, on the falling edge of it I must bind a DMA request generator to transfer dummy data. Then the TC of DMA req gen will trigger the MDMA.

Is there a simpler wat to do that?

4 REPLIES 4
FBL
ST Employee

Hello @SeyyedMohammad​,

Could you explain more the requirements, the use case? What do you mean "exact delay after TC"? You could start with running an example of MDMA for a linked list transfer. You can configure a timer in the next node. Then, MDMA transmission ends when all the transfer nodes are served.

Hope this helps!

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi @F.Belaid​ 

Application: I have some peripheral SAI and adc, I receive/ transmit through them continually (circular). I need to transfer beffer of mentioned peripheral to TCM for processing (which is done by MDMA). But when is good time for transfer to TCM? I've though best is when all have been done and enouph time is reminded to next first I/O buffer update(bu SAI or ADC). I've got the most important signal of these peripherals as reference and that is SAItx_TC. But since this time is not when all buffers are updated. I need small delay after this TC happens to drive MDMA which updates TCM.

Need: I need to signal MDMA after specific delay from SAI_DMA_TX_Delay. And I've done this in this chain:

SAI_rx_DMA_tc -> MDMAch0 ->LPTIM2 -> DMA_gen -> MDMA_tcmUpdater.

This solution has been worked. But another solution:

SAI_rx_DMA_tc_event -> DMAch0 ->LPTIM2 -> DMA_gen -> MDMA_tcmUpdater.

Doesn't work since event generation not care about block of transfer it generate event on every single transfer and not the block number configured NDTR. And i've referenced that here.

AScha.3
Chief II

...from this I conclude : you want dma transfer the circular buffer, just when 1/2 is filled/ready ?

then (i do same) use callbacks ! (+ set sai call back in cube -> project manager -> advanced.. )

HAL_SAI_TxCpltCallback(SAI_HandleTypeDef *hsai)

{ ...dma start...}

+

..halfCplt..

If you feel a post has answered your question, please click "Accept as Solution".

Hi @AScha.3​ 

Nice perspective I think. But I don't want to use interrupts. Interrupts making programm unpredictable. (I'm curious what is that proj manag -> adv. what is it's difference from System core -> NVIC -> code generation)

According to your answer, it means it could be helpfull if MDMA could read HT signal other than TC, but sadly they can't, then we have to use interrupts or workaround I've mentioned in question.