I used this early today:
uint8_t HAL_SPI_Write(uint8_t data)
{
SPI1BUF = data;
return 0;
}
Then everything is simple. The events happen in this order:
1. You drive CS down. You can see this on your scope (green trace I would guess)
2. You write to SPIBUF multiple times - the first write succeeds, others fail
3. You drive CS up. You can see that too. Double pulse for whatever reason.
4. SPI module transmits the first byte which you have transmitted on step 2. You can see this on your scope too.
5. Nothing else happens because the SPI buffer is now empty
You probably should wait for a byte to be transmitted before writing the next one. Also, you should wait until everything is transmitted before driving CS up.