cancel
Showing results for 
Search instead for 
Did you mean: 

SPI block on SPI_WaitFlagStateUntilTimeout

MPast.1
Senior II

HI all,

I have a custom board with stm32h743vit6 microController.

I configurated SPI1 for comunicate with a SPI display (ili9488 managed by touchgfx with partial frame mode).

My problem is that I can't reach high speed (more than 25mhz on SPI) else the code block itself on SPI_WaitFlagStateUntilTimeout routine.

I must tell you that I command SPI to work with DMA to decrease at minum as possible the core work (while graphic buffer is transferred on display).

Can someone suggest to me the reason of SPI baudrate limitation? I would like to reach 100Mhz.

are there some incompatible setting between SPI/Core/DMA speed or other configuration?

thanks in advance.

MarcoP

3 REPLIES 3
TDK
Guru

> I have a custom board with stm32h743vit6 microController.

> My problem is that I can't reach high speed (more than 25mhz on SPI) else the code block itself on SPI_WaitFlagStateUntilTimeout routine.

SPI_WaitFlagStateUntilTimeout doesn't appear to be in the latest CubeMX package.

https://github.com/STMicroelectronics/STM32CubeH7/search?q=SPI_WaitFlagStateUntilTimeout

Perhaps you can provide more detail on where exactly it's failing. At a minimum, try it with the latest STM32CubeH7 package. Examining SPI and DMA status registers for overflow error conditions would also be useful.

Including the call stack when it's blocked would also be informative.

If you feel a post has answered your question, please click "Accept as Solution".

HI TDK, thanks for your answer.

Unfortunatly I'm using the lastest API version for STM32H7 (if i'm right it is 1.9).

These evening when i'll be home, I 'll verify your suggested points and i'll give you some more infos.

thanks in advance

MPast.1
Senior II

Hi TDK,

I discovered the problem: the error was in the interrupt handling. fortunately no overflow or hardware errors were generated.

The spi display technique works with DMA (memory in peripheral mode). Dma generates an interrupt every time SPI TX completes.

The error was that the Touchgfx engine was receiving many requests to update the screen, before the Touchgfx engine was fully started.

I put a flag in the right place to block interrupts and Touchgfx Engine for only 50ms. This solved all my problems.