2020-05-14 09:56 AM
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.
2020-05-14 11:17 AM
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
2020-05-14 12:44 PM
Only one transfer per trigger
2020-05-14 01:27 PM
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?
2020-05-14 04:31 PM
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.
2020-05-14 04:32 PM
I am using 32F429ZI. Does it has the module you mention?
2020-05-14 05:49 PM
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.
2020-05-14 07:02 PM
No.