Synchronize DMA to GPIO transfer on 2 distant MCU by external signal.
Hello, community. I have a task to transfer a value from the buffer of 64 values in memory to 7 GPIO by DMA every 1us. I solved it by setting a TIM2 timer Channel1 to Output Compare mode and TRGO to Update event. Then, I mapped the DMA request to TIM2_UP and set the mode to Circular so that I could use HAL_DMA_CallbackIDTypeDef to copy new data to half of the buffer while transferring another half.
The challenge is that I must perform this on two separate STM32H7 MCUs with precise timing. To achieve this, I have a VSYNC signal that's essentially a basic PWM with a 64us period and a 5us pulse width.
So, for every rising edge of VSYNC, I need to start transferring the data buffer of 64 values. One value for 1us. And start transferring another 64 values right at the start of the next sync pulse.
I was trying to Enable Synchronization in DMA Request Synchronisation settings and set the Sync signal to EXTI (which is my PWM VSYNC) but it doesn't work as I expected.
Is there any other approach I can take to synchronize the DMA transfers?
