Skip to main content
Jayce Cao
Associate II
May 23, 2019
Question

Build a .hex file which including the Bootloader

  • May 23, 2019
  • 10 replies
  • 5572 views

I am working on an application based on STM32F103 chips.

After build the application, I do full chip erase using ST-LINK Utility and then flash the chip using new .hex file.

I know that STM32 starts executing the code at the address of 0x8000000. However, my main program starts from address of 0x8003000. I thought the stm32 used a space of 0x8000000 ~ 0x8002FFF for Bootloader. Therefore, my application cannot work.

I cannot find any solutions to build a .hex file which including the Bootloader for my application.

Do you guys know any way to build that one?

Thanks and BRs,

This topic has been closed for replies.

10 replies

Tesla DeLorean
Guru
May 23, 2019

ST doesn't provide that loader.

The .HEX files are of a simple ASCII format​ and can be merged in a text editor. You just have to lose one or two of the non data end record.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Jayce Cao
Jayce CaoAuthor
Associate II
May 23, 2019

Actually, I have a Firmware which main program starts from address of 0x8003000 and an .hex file which start from the address of 0x8000000 (it's from former employee).

If I build the application, erase full chips and flash, and then flash to my circuit, it cannot work. However, if I flash the .hex file (older one) and overwrite with new one, it's working. But I want to flash one time without overwrite anything.

How could I fix this problem?

Tesla DeLorean
Guru
May 23, 2019

Merge the .HEX files.​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Sivasubramaniyan
Associate II
May 24, 2019

you can merge the two hex files using SRECORD tool.

follow the descripition mentioned in this link

http://www.keil.com/support/docs/2666.htm

Jayce Cao
Jayce CaoAuthor
Associate II
May 27, 2019

@Sivasubramaniyan​ : Thank you for your solution!