Dude... that guy is like... doing it absolutely the hardest way effing possible. Not leveraging the built-in shit that makes STM32F-family processors amazing.
Come over to the DFU side; we have built-in USB connectivity and the bootloader lives in a built-in sandbox so you can't fuck it up.
mnem
Learning slowly. Thanks for the info.
I'm glad if my own pitiful knowledge can help somebody. This is all stuff I've learned working with these processors as they come in flight controllers, but that's close to a decade's worth now. (!!! - Yeah, I can hardly believe it too!) I'm not even a novice programmer; but I've at least learned enough to understand the basics of how to connect to them so I can use someone else's software to configure them.
Here's
Banggood's collection of STM32Fxxx dev boards; depending on your needs, you can go as cheap/simple or as fast/powerful as you want. They have some starting at literally $2.69 shipped. (AKA "The Blue Pill")
If you have a friend who's into RC quadcopters, he's probably got one or more old flight controllers that aren't fast/powerful enough for today's firmware (the dev cycle is now 3-6 months) he'll give you to tinker on. I have a couple I'd give you, but it'll cost more than they're worth to get 'em tooya.
Take a look at the pic above to see what a modern FC looks like and all the I/O on it; this one incorporates an STM32F4 as main PID control (supposedly, this one uses some approximation of Terniary math I can barely wrap my brain around, but still similar concept to the traditional nested PID controllers used for other FCs) processor for the motor speed controllers and a separate STM32F3 to run separate gyro/accel noise filtering based on a Kalman algorithm.
Good hunting, my friend!
I have no doubt in about 5 minutes you'll know more about them than I ever did.
mnem
*Sleepy dwagon*