2023-09-11 02:34 PM
Hey Guys - more SPI issues!
I have a new board with minimal connections - basically just SPI to a LCD and four pushbuttons. I created a new STM32 project in STM32cube.
It is using a STM32F451VET6 with clock set to MSI RC 4000kHz
I configured SPI in the IOC to :
Full-duplex Master
Hardware NSS Output Signal
PB0 as SPI1_NSS, PE13 as SPI1_CLK, PE14 as SPI1_MISO, PE15 as SPI_MOSI
with the below parameters :
I added only a few lines to the auto-generated code for two variables and the SPI transmits ( below ).
Stepping the program it will send the first byte fine. The next byte sends but the HAL_SPI_Transmit() call hangs forever on this line :
/* Check the end of the transaction */
if (SPI_EndRxTxTransaction(hspi, Timeout, tickstart) != HAL_OK)
{
hspi->ErrorCode = HAL_SPI_ERROR_FLAG;
}
Here is the code from Main.c :
Solved! Go to Solution.
2023-09-13 01:52 PM
Resolved! BOOT0 was left unconnected. Set it as input and tied to GND and everything is workin ggreat!
Thanks!
2023-09-11 03:11 PM
Hello @Stoufer
I suggest you to double check your configurations and wiring to maker sure that they are master-slave compatible and that the slave requirements are satisfied (clock,...). Also, you have to update your firmware to the last version to garantie more efficiently. After that, try to change (increase or decrease) the timeout of 100ms that may solve the problem.
NB: is an L4 not F4.
Best regards.
II
2023-09-11 03:25 PM
you are right ... L451.
At this point I only have the Master sending data and monitoring with a scope.
I have tried increasing the timeout .. have not tried reducing it.
Thanks
2023-09-11 03:32 PM
Try to reduce it .
I also advise you to use an oscilloscope to track the signal's variations on reel Time. That may help you answering your questions.
Best regards.
II
2023-09-13 01:52 PM
Resolved! BOOT0 was left unconnected. Set it as input and tied to GND and everything is workin ggreat!
Thanks!