Problem initializing SPI TX interrupt in STM32F103
You're getting stuck in your interrupt handler because you're trying to clear the TXE flag 'manually' and this doesn't work.  

The TXE flag is there to tell you that the SPI module is ready for you to load another byte into its transmit register - and the act of loading this byte is what clears the TXE flag.  

If you don't have any more data to send, you must disable this interrupt until such time as you do want to send more data.