cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple read from Peripheral to Memory using DMA

zhiyongwoo
Associate III

Dear Experts,

Can I configure the DMA2 to do say 3 repeats read on GPIOx_IDR by a single DMA request?

I do not want to have array of bytes instead I would like to write into a single variable and overriding it with the latest value.

I have set the MINC bit to 0 in the specific DMA2 register. So the variable always being written with the latest value.

  HAL_DMA_Start( htim1.hdma[TIM_DMA_ID_CC2], (uint32_t)&GPIB_D0_GPIO_Port->IDR, (uint32_t)GPIOE_IDR_buff_, 3);

Will the above API perform 3 reads on the GPIOx_IDR?

Please advice.

7 REPLIES 7

Which STM32? And what is the trigger source?

You should be able to do that with the DMAMUX on the newer STM32 models.

Forget about Cube/HAL and read the DMA/DMAMUX chapters in RM.

JW

Only one transfer per trigger

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

It is possible to set up the timer to send 3 successive DMA requests, but what is the purpose of this? How would the result be different from reading the IDR just once?

I was inspired by how the DMA for UART Tx is and the ADC. They can do multiple transfer per request.

BTW, I am using TIM Chn2 to detect a falling edge, this generates a DMA request.

I am using 32F429ZI. Does it has the module you mention?

Yes, those have a demand driven trigger, the TIM trigger is slightly different. I think it has a register that will write multiple registers, not delved into it.

The TIM do multiple one-shot operations, which might be usable, you'd have to work through the docs, and test things.

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

No.