Using code based on hFramework you have to flash bootloader in the first place and protect some sectors in memory before overwrite. Next you can flash your compiled code. Unfortunately stm32loader don’t know where it should start write for example .hex or .bin file. This functionality is available in core2-flasher. So answering your question, it’s not possible to flash code based on hFramework usingstm32loader for now. We also do not plan to add such functionality because hFramework is already deprecated.
Thanks for the helpful tips!
By analyzing resulted .hex files and core2-flasher source code, I figured out how to use stm32loader to flash hFramework firmware.
The main problem is that stm32loader does not erase flash memory at all when there are protected pages (or I’m doing something wrong). So I start by performing a write unprotect:
As I said before this script is quite old and we do not remember all details. Please review STM32 boot process manual to investigate that if this is important for you for some reason.