2025-04-14 4:09 AM - edited 2025-04-14 4:10 AM
Hi,
I'm trying to get a bare metal implementation of SPI working on a STM32WB55 Nucleo board.
The transmit appears to work but I cant get the receive function to work. I'm using a loop back by connecting MOSI & MISO with a jumper.
When in debug I can see my Tx buffer getting loaded with the appropriate value but it never appears in the Rx buffer. When I step through the Tx code runs through as expected, in the Rx code though it looks like the SPI_FLAG_RXNE never gets set i.e. nothing ever arrives.
Ultimately I'm trying to connect with 2 x ADXL362s over the SPI bus.
I have attached a zip of the CubeIDE.
Any help with debugging this or pointers to how I go about that would be most appreciated. I'm getting code blindness trying to find the problem.
2025-04-15 8:12 AM
It sounds like you're reading DR in the debugger, which will clear the RXNE flag.
2025-04-16 7:57 AM
I've tried it without viewing DR in the debugger & I still get nothing in the rx buffer. The receive part of the function never enters receive block which is conditional on RXNE.
I just tried to do the same thing with MX & HAL (which I was avoiding as I'm trying to learn how stuff works) but that doesn't work either (my UART buadrate issue for my UART debug did get resolved though - a separate issue)