cancel
Showing results for 
Search instead for 
Did you mean: 

Can it be possible to trigger DMA using a GPIO pin in STM32?

SKUND.11
Associate III

For my application I'm using a comparator and i have set a reference voltage(threshold) for that and my application is that, if the current passes through the threshold then my comparator output should be turn on(1 or 0). I have set the comparator output as GPIO pin. So as soon as the gpio pin get high(when current passes through the threshold), I want to trigger my DMA to do the following instructions and i don't want to use interrupts. So is it possible and how?

4 REPLIES 4

Used a pin related to a TIM to generate the trigger.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

I don't want to use it as timer pin. i want to use it as normal gpio pin. For that I've figured it out a solution but i don't know how to use it.

First i have set that particular pin to GPIO_EXTI pin and set it as in rising edge.

0693W00000Nso6JQAR.pngSecond I've request a DMA on that pin.

0693W00000Nso7WQAR.pngBut i Don't know what should i do next? Should i just start the dma in interrupt mode or what( HAL_DMA_Start_IT(hdma, SrcAddress, DstAddress, DataLength)).

Which STM32?

In older STM32, there was no other way than to use timer pin.

In newer STM32 with DMAMUX, there may be DMAMUX inputs connected to EXTI lines. Read the DMAMUX chapter in RM. I don't have first-hand experience with these.

I don't know if this can be clicked in CubeMX, I don't use Cube.

JW

SKUND.11
Associate III

oh okay btw I'm using STM32G030K8 microcontroller