Electronic – Writing bootloader for STM32 by C language in Keil

bootloaderckeil

I want to write a bootloader for my MCU. It's an STM32F103RET6. I searched for information about writing a bootloader for it, but I couldn't find anything. Now I have these questions:

  1. Where can I find any information (website, book etc.) about writing a bootloader?
  2. Can I write a bootloader for my MCU just using C language and the Keil compiler?

Best Answer

A bootloader is no different from a normal program. You will need to think of the following things first:

  • What do I want my bootloader to do?
  • Since it usually takes care of upgrading software, where do I get the new application image from?
  • Do I want to be able to communicate with the bootloader via UART/USB/?
  • How do I make sure that a valid program is loaded at the specific memory address?
  • How do I make sure that I am always able to enter the bootloader somehow?

There is no single "bootloader" - it depends on your requirements.