Skip to main content
MJørg.2
Associate II
April 27, 2021
Question

DMA not working with GPIO as input and saving it to an array

  • April 27, 2021
  • 1 reply
  • 1032 views

I have 8 GPIO pins where I want to read the state of the pin. I want to do this with a DMA controller. My guess is that this should be done with perhipipal to memory. The code is shown in the txt. file.

When the DMA is finished it goes into an interrupt where I just have a breakpoint. The DMA does not transfer anything from the GPIO pins but gives the interrupt like it is done. I cant understand why it does not read the state of the GPIO pins.

I have btw tried this with Mem2Mem, but this does not allow me to read the GPIO pins state when the timer overflows and restart.

Every help will be well appreciated.

This topic has been closed for replies.

1 reply

TDK
April 30, 2021

> HAL_DMA_Start_IT(&hdma_tim1_ch3, (uint8_t)&(GPIOA->IDR), (uint32_t)cameraData, (uint32_t)640);

Should be:

> HAL_DMA_Start_IT(&hdma_tim1_ch3, (uint32_t)&(GPIOA->IDR), (uint32_t)cameraData, (uint32_t)640);

Potentially other stuff.

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