STM32 Xmodem Protocol Hex File Parsing
Hi,
I am trying to update the firmware with an xmodem protocol over a uart with stm32. I convert the hex file created by CubeIDE into an Xmodem 1k package and send it. The bootloader I wrote in Stm32, receives this data and writes it to the necessary address. There is no problem on this side.
However, there is a difference between the program I sent and the program compiled and written by CubeIDE. This causes the program to not work properly.
There are some lines in the hex file that are not completed to 16 bytes, I add 0xFF to the end of them, package them and send them like that.
.
.
.
:10026000B1240408B1240408B1240408B12404080A
:10027000B1240408B1240408B124040800000000DB
:10028000B1240408B1240408B124040800000000CB
:0802900000000000B124040885
:1002A00010B5054C237833B9044B13B10448AFF3B0
:1002B00000800123237010BD0C0200240000000008
:1002C00058D9040808B5034B1BB103490348AFF3E1
.
.
.
.
Here, I complete the 8-byte line to 16 and send it like that. This line is somewhere at the beginning of the hex file. This line matches no problem.
:10E2B00065776C69622F6C6962632F7374646C6933
:10E2C000622F6764746F612D6765746865782E636B
:04E2D000000000004A
:08E2D4000C20FF7F0100000097
:04E2DC00C50204086B
:04E2E000A10204088B
:10E2E400010000001E1A09162700000000000000AB
:10E2F400000000000000000000000000000000001A
:10E304000000000000000000000000000000000009
However, towards the end of the hex file, such a line comes again and again I complete the end with 0xFF and send it.But this place doesn't match.
In the photo I added below, there are flash memory views of the program I sent and the program sent by cube ide. Here it shows the mismatch.
How should I send these packages?
