I am writing a python script similar to STM32Loader that can write a hex formatted program to the flash of an STM32F0.
I have managed to use the system boot-loader to write the hex file to the chip and verified it with STM32CubeProgrammer, but the chip won't boot. If I flash the same hex file with the STM32CubeProgrammer the chip boots fine.
The script flashes the hex file on to the chip by first erasing the flash, then reading the hex file and creating a memory map from it, and using that map to load the correct data into the flash of the chip.
I used this Wikipedia article to decode the hex file. The STM32F0 hex files generated by gcc only uses the data types for data, end of file, extended linear address and start linear address. I do not know what to do with the line for start linear address, but if I remove it from the hex file and flash it with the STM32CubeProgrammer the chip boot with no issue.
Is there something I'm missing?