2020-01-22 02:57 PM
2020-01-23 02:10 PM
It's not clear which code you want to change. Typically bootloader updates the main firmware, but the bootloader itself is never updated, because doing that can brick the device.
For an example you can take a look on OpenBLT project, but internet is full of other examples also.
2020-01-23 04:30 PM
ST doesn't provide source code for the System Loader. It is in OTP/ROM and can't be changed in the field. It is provided as a low level method to unbrick the devices, or factory program them, but most commercial users will want to provide a simpler customer facing tool/method.
There are several examples of IAP (In Application Programming) using different interfaces.
I'm not really sold on the security or robustness of the System Loader, and it's protocol. You could likely make something much more tailored to your board/application.