Hello!
Your description is still very vague. Here are some things you can check:
- You send from STM32f4xxx. Are you sure that you are not sending too fast for Arduino?
- Have you checked clock phase, clock polarity?
- Have you checked that one is master and one is slave (i.e not both slaves or both masters)?
- What do you call "sometimes" (sometimes data is sent correctly). I mean, if you send random data
one byte at a time, you have one chance on 256 that the data will be right.
etc...
Dora.