STM32F103 blue pill overcurrent (possibly from motor)
The schematic as drawn looks ok. 

If gen+ got to 12V (worst case) the pins on the STM32F would only receive less then 0.4mA of current even with no protection diodes, which should be fine for the STM32F. With the diodes the limit would be even less, the gen pin looks good.

Any over voltage from the motor should be stopped to some extent by the voltage regulator, to be sure, put a scope on it to make sure when the motor is switched on or off there isn't a problem there. 

The diode across the motor should stop flyback in the negative direction so I wouldn't be too worried about that either. But implementation is everything, a bad grounding system (or a diode that isn't installed correctly) could be part of the problem. Make sure your implementation matches the schematic. 

The rule of thumb I use with STM32's in max/normal operation is roughly 50mA, so that would be (12V-3.3V)*0.05A = 0.435W which may be why the regulator feels hot. You may want to step the voltage down with two regulators, or get a '7805 series' drop in compatible DC DC regulator.

In my experience STM32's get blown out from overcurrent, if there is too much voltage on a pin and the protection diodes turn on and the maximum rated current for the pin reached.