cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronous mode for DMAMUX - Trigger via EXTI

fullcustomasic
Associate II

Hello community!

I set up a dmamux channel, which is working perfectly in unconditional mode(direct mux). Now I want to use synchronous mode, where the EXTI0 line Interrupt is the trigger(or latch), so it initiates the DMA request transactions. I get the exti0 interrupts, selected the right sync_id (0) and polarity in dmamux registers but there seems to be no requests firing. I verify that, by setting the TC(transaction complete bit) in the DMA channel and by sending more requests than defined in CNDTR.

Some more notes:

  • I trigger the EXTI0 by EXTI pending register
  • DMAREQ_ID is TIMx_UP, which is continuously triggering dma requests
  • DMAMUX Generator isnt starting neither when I select EXTI as trigger input
  • SPOL is rising in DMAMUX
  • Using STM32G474RE

I also tried it with exti1, but its not working with that neither.

Am I missing something? I cant imagine that only 'real hardware interrupts' triggered by peripherals can be sync. triggers.

 

1 ACCEPTED SOLUTION

Accepted Solutions
fullcustomasic
Associate II

Ok..so apparently only 'real hardware interrupts' can be used for DMAMUX. I configured the user button and routed exti13 via this button as interrupt, now the DMAMUX is doing what it should. But its pretty sad that you cant trigger that via software.

 

Maybe also good to know is, that it is not enough if DMAREQ_ID is the same in more than two channels, and one event is triggering another adjacent channel. Sadly that is not working, you need two seperate trigger sources if the channels are adjacent or chained.

View solution in original post

5 REPLIES 5
TDK
Guru

> DMAREQ_ID is TIMx_UP, which is continuously triggering dma requests

 

This is the issue. If you want EXTI to trigger it, it should come from the EXTI.

The documentation for this is lacking, at least in the reference manual.

I suspect you assign the channel with dma request 1 (DMAMUX_Req G0) and then set this up to be triggered by EXTI0 in the DMAMUX_RGxCR register by setting SIG_ID=0 (EXTI LINE0). The naming scheme for this in the RM is inconsistent.

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

I understood it like that: You can have a trigger(DMAREQ_ID) and a latch(SYNC_ID). No matter what is happening with the trigger, as long as no 'latch' is detected, no dmarequest is redirected. Only when a latch signal occurs, (NBREQ + 1) requests are redirected(but only after the latch, or SYNC_ID). Thats what I read from Picture of the G4 RM0440, page 431 in-document.

So I assign the channel with 79(TIM15_UP) request and SYNC_ID = 0 (EXTI0) as sync start, and enable sync bit.

Is this wrong? If yes, how can I implement the solution so, that I can ignore requests as long as some signal(i guess a sync signal) is high?

 

I don't understand why TIM15 is involved at all--can you clarify what behavior you're looking for? It sounds like you want a single DMA trigger for every EXTI0 edge, or is it something else?

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

Yes its something else. I want basically to start a DMAMUX-chain. EXTI0 is the initial trigger to start the transaction-chain:

  • EXTI0 is triggered
  • MUX_ch0 starts redirecting dma requests generated by a timer as soon as EXTI0 trigger is detected. (NBREQ + 1) requests are redirected(EXTI0 is only triggered once).
  • When NBREQ reaches zero, an event is generated by MUX_ch0, which is used as sync. input to MUX_ch1, which has the same DMAREQ_ID as MUX_ch0. But since it is configured in sync mode with event from MUX_ch0 as sync input(which is only triggered at the end of MUX_ch0 transaction), it starts redirecting requests only when MUX_ch0 event is detected and so on.
fullcustomasic
Associate II

Ok..so apparently only 'real hardware interrupts' can be used for DMAMUX. I configured the user button and routed exti13 via this button as interrupt, now the DMAMUX is doing what it should. But its pretty sad that you cant trigger that via software.

 

Maybe also good to know is, that it is not enough if DMAREQ_ID is the same in more than two channels, and one event is triggering another adjacent channel. Sadly that is not working, you need two seperate trigger sources if the channels are adjacent or chained.