cancel
Showing results for 
Search instead for 
Did you mean: 

Is synchronous data sampling of TIM.CNT and ADC.DR with 6 MHz possible with the usage of DMA1 & DMA2 on an H743?

DFlad.1
Associate II

Hi,

I want to use an STM32H743 for sampling one TIM.CNT and one ADC channel synchronously and store the data of both peripherals in array buf_adc[5000] and buf_timcnt[5000].

Therefore I want to use the DMAMUX request generation and use LPTIM2 as trigger with a update frequency of 6 MHz.

I configured two DMA channels in circular mode in CUBE and the LPTIM2 as request generator.

For testing I use one TIM.CNT and transfer the data from this register two both memory buffers to check for synchronous sampling.

I tested the DMA streams synchronous sampling by checking NDTR register for both streams. This value of NDTR is consistent, but if I compare the two arrays, one is showing a perfect sawtooth signal and the other one shows just trash.

Has anyone ever tried to synchonize two DMA transfers at this high frequency or/and can help me with this problem?

It seems the DMA transfer is corrupted.

5 REPLIES 5

Does it work at lower speeds?

If that fails then clearly that's a red herring..​

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

Thank you for answering :).

At lower speeds it fails as well.

You can see the output from the two buffer which should have the values from TIM12.CNT.

Do you have any idea what went wrong here? It looks like a puzzle.

I will check again if the serial connection, where is send data to the pc is fine. Maybe that's a problem

Serial connection is fine. It really seems to be a DMA problem.

Amel NASRI
ST Employee

Hi @DFlad.1​ ,

Is your application based on a code generated with latest versions of STM32CubeMX (6.3.0) or STM32CubeIDE (1.7.0)?

If yes, please make sure that MX_DMA_Init() is called before peripheral initialization.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.