I lifted up you code (which would have been easier if you had made proper use of code tags) and tried to compile it using the "official" STM32DUINO core, and yes, there are several references to AVR registers like SPDR that will need attention, and also definition of an ISR routine. Howeve...