Different members of the family have slightly different implementations. I have a annotated listing of the one in the STM32F103RET (819) if that's of any help.
Frankly it might be easier just to write a simple Intel Hex or Motorola S-Record loader. ST has an example loader that uses a Y-Modem variant, as well as the source to the PC side for the one in the ROM. -Clive sourcer32 at gmail dot com
Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..