One bit shift in SPI communication on STM32G4
Hi,
I am working on SPI communication between STM32G491 and ATM90E26. and I am using the SPI polling API with HAL_SPI_Transmit and HAL_SPI_Receive.
My System clock is 96Mhz and I am using prescaler of 64 for SPI.
CLKPolarity=Low,
CLKPhase=1Edge.
Communication is happening between the devices but I am not getting the correct data.
there is only a shift of one bit.
For example
in binary:
expected: 0001 0011 1001 0100
received: 0000 1001 1100 1010
f I shift the received bitstream to the left I get exactly the right result.
I found one solution in the forum for similar type of question(for stm32H7) It was solved with
hspi1.Init.MasterKeepIOState = SPI_MASTER_KEEP_IO_STATE_ENABLE;
But I am using STM32G4 with SPI Poll method
there is no MasterKeepIOState parameter available its giving me the error I use it.
Is it due to bad configutation?
or anything do I need to configure to solve it. Can anyone please suggest.
Thanks
