Detect IDLE status of SPI protocol under STM32
You need to introduce some kind of protocol, or at least framing detection. SPI is just a stream of bytes if there is nothing else being done.

1) First transfer some initialization data to know when slave is present and in sync. Then continue with your normal packets.

2) Put a delay between packets on TX end and and put a shorter timeout on RX end. This way the RX knows that it got an incomplete packet and will restart at first byte when TX sends next packet.

3) Frame the data with start of packed ID bytes and end of packet ID bytes. Maybe with a length as well. Then you can ignore any data until start ID is seen, and check if you get end ID after correct amount of data. Only problem is if your data bytes accidentally contains these IDs. This is where coding the data helps, for example send data as ASCII, using hexadecimal numbers and letters for data, and letters X and Y are free for packet start and stop delimiters.

4) Use the chip select to detect first and last bytes of SPI packet. As you have fixed length packet, just use falling edge to restart reception, or rising edge to latch in last 10 bytes, or use both edges. STM32 can generate an interrupt from the edges of CS pin.

Edit: after learning the CS pin is not connected, only way to get even the byte sync correct would be the use of timeouts and resetting the bit reception in the timeout as well.