cancel
Showing results for 
Search instead for 
Did you mean: 

Hello, I am trying to measure the time requires to transmit and receive the data over spi between two boards, I have tried DWT but DWT gives cycles according to system frequency(core) , I want the time require by the spi only.

MGaja.1
Associate

I am using stm32f429i discovery and stm32f429i eval boards for communication. Can anyone help me?

3 REPLIES 3
KnarfB
Principal III

read DWT twice, once immediately before you start the DPI transfer, once on completion. The difference, divided by SystemCoreClock gives you the time?

The math going from processor ticks to time is relatively pedestrian, you need to wait for the SPI data to clear the wire, as TXE signals when the shift register is loaded, not when all the bits have shifted out.

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

you can also run the SPI transaction say 1 000 000 times and use HAL_GetDelay() before and after to get an educated guess of the average speed.