cancel
Showing results for 
Search instead for 
Did you mean: 

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

MJørg.2
Associate II

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.

1 REPLY 1
TDK
Guru

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