Skip to main content
SKUND.11
Associate III
June 27, 2022
Question

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

  • June 27, 2022
  • 4 replies
  • 3657 views

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?

This topic has been closed for replies.

4 replies

Tesla DeLorean
Guru
June 27, 2022

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

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
SKUND.11
SKUND.11Author
Associate III
June 27, 2022

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)).

waclawek.jan
Super User
June 27, 2022

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
SKUND.11Author
Associate III
June 27, 2022

oh okay btw I'm using STM32G030K8 microcontroller