STM32H723VG SPI TransmitReceive sometimes works and sometimes does not, based on Delay length
Hello,
I have developed my own board using the STM32H723VG and two equal sensors connected separately via SPI1 and SPI2.
I have underclocked the MCU to 300MHz. The SPI clock is 48MHz while the communication frequency for both sensors is 24MHz. As CS I am using a manually toggeled pin. I am using the HAL and the STM32CubeIDE.
For setting the initial registers of the sensors Iam using the blocking SPI TransmitReceive function. While reading a known register value from the sensor 1 which is connected via SPI1 I have seen that sometimes the used SPI HAL function does not return the expected value but returns HAL_OK. Instead of the expected Value (71) i get a 0.
So far I have discovered in a test code that the issue occures after using a delay longer than 145ms.
I dont know why a HAL_Delay or just anything else which blocks an SPI transaction for longer than 145ms should result in an SPI communication error. I doubt that my issue has something to do with the custom board since it does obviously work (with a delay less than 145ms).
I have my test program attached. Does anyone know how I could solve my problem or how I could try investigate it further?
