Skip to main content
JLope.11
Associate III
April 12, 2024
Solved

stm32h7 fastest gpio read using DMA

I would like read the gpio lines at fastest speed. 

As example it is possible to read first 4 ports by reading:

uint16_t ports0123=GPIOC->IDR&0x000F; (it is very fast, takes 28 tics)
It is possible to read ports GPIO_PIN_0-15 by connecting GPIOC->IDR to a DMA?

and a fast DMA?

 

This topic has been closed for replies.
waclawek.jan
waclawek.janBest answer
Super User
April 12, 2024

You can do it, but you may be unpleasantly surprised by how slow it is.

While that article talks about toggling (i.e. write), most of what's written there applies to reads, too.

You may try to experiment with the BDMA which in the same clock domain as GPIO, but don't have too high expectations.

JW

2 replies

mƎALLEm
ST Technical Moderator
April 12, 2024

Hello

It is possible to read ports GPIO_PIN_0-15 by connecting GPIOC->IDR to a DMA?

Nothing prevents you to do it.

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
waclawek.jan
waclawek.janBest answer
Super User
April 12, 2024

You can do it, but you may be unpleasantly surprised by how slow it is.

While that article talks about toggling (i.e. write), most of what's written there applies to reads, too.

You may try to experiment with the BDMA which in the same clock domain as GPIO, but don't have too high expectations.

JW