STM32Fx Microcontroller Custom Bootloader Development

Learn fundamentals of Bootloader Development for your ARM Cortex Mx based STM32Fx Microcontroller

4.66 (1100 reviews)


7.5 hours


Sep 2021

Last Update
Regular Price

What you will learn

Write your own custom bootloader for your STM32Fx microcontroller and test

Host Bootloader Communication implementation

Custom Bootloader command packets

Different boot modes of the STM32 Microcontroller

Boot loader flash handling implementation : Sector Erase/Program/Mass erase

Boot loader options bytes(OB) Program handling implementation

Boot loader Flash sector protection status handling implementation

Boot loader In application programming implementation (IAP)

Vector table relocation of ARM cortex Mx processor


I have designed this course for students to get started with Micro-controller Bootloader Development. This course will be suitable for beginners in the domain of embedded systems and programming.

This course is all about learning to develop a custom BootLoader for ARM CORTEX Mx powered STM32Fx microcontroller.

In this course, I will guide you through step by step procedure to develop your own BootLoader and we will explore many things related to BootLoader programming.

The BootLoader we are going to develop in this course will have the following features

1) It can do the in application programming(IAP). You can use the BootLoader to flash a given application binary

2) Read microcontroller specific data

3) Flash related configurations like setting up read and write protections for different sectors

4) Flash sector erase

5) Mass erase of the user flash

6) Read and display the protection status of the flash memory

7) Jump to the specified address to execute the code

Along with custom BootLoader development, you will also understand

1) The different memory organization of a microcontroller

2) Memory aliasing and different boot modes of STM32

3) How MCU boots after power up

4) Vector table mapping and vector table relocation use case of arm cortex mx processor.

5) Difference between In-system programming(ISP) and in application programming(IAP)

6) Custom boot loader design flow chart

7) Host and Boot loader communication method

8) Implementation of different boot loader commands

You can also extend this BootLoader by giving the following features once you complete the course

1) Encrypt and Decrypt the firmware sent by the host using AES

2) Over the air programming by interfacing WIFI or Zigbee Modules

Hardware used in this course

In this course, STM32F446RE Nucleo board is used.

If you have any other board based on STM32 microcontroller then also you can use the codes developed in the course with no or minor changes.

Software used:


2) OpenSTM32 SystemWorkbench for (WINDOWS/LINUX/MAC OS)

Learning order of FastBit Embedded Brain Academy Courses,

If you are a beginner in the field of embedded systems, then you can take our courses in the below-mentioned order.
This is just a recommendation from the instructor for beginners.

1) Microcontroller Embedded C Programming: absolute beginners(Embedded C)

2) Embedded Systems Programming on ARM Cortex-M3/M4 Processor(ARM Cortex M4 Processor specific)

3) Mastering Microcontroller with Embedded Driver Development(MCU1)

4) Mastering Microcontroller: TIMERS, PWM, CAN, RTC,LOW POWER(MCU2)

5) Mastering RTOS: Hands-on FreeRTOS and STM32Fx with Debugging(RTOS)

6) ARM Cortex M Microcontroller DMA Programming Demystified(DMA)

7) STM32Fx Microcontroller Custom Bootloader Development(Bootloader)

8) Embedded Linux Step by Step using Beaglebone Black(Linux)

9) Linux device driver programming using Beaglebone Black(LDD1)


STM32Fx Microcontroller Custom Bootloader Development
STM32Fx Microcontroller Custom Bootloader Development
STM32Fx Microcontroller Custom Bootloader Development
STM32Fx Microcontroller Custom Bootloader Development


Course Overview

Course Overview

Important Note

Source Code Repository


What is Boot-Loader and Why it is needed ?

MCU memory, Reset Sequence and Boot configs

MCU-Embedded Memory Organization

Understanding Reset Sequence and memory Aliasing of the MCU

Boot Configurations of the STM32 MCU.

Development board used in our courses

Note for the students

About MCU Development board

STM32F4 Discovery and Nucleo : Board Details

ST-Link Driver Installation

ST Link Firmware Upgrade

KEIL-MDK-5 IDE setup for ARM Cortex M based MCUs

Note for the students

KEIL-MDK-5 Installation

KEIL-MDK-5 Installation Contd.

KEIL-MDK-5 Pack Installation

Locating Pack Installation files

Creating a KEIL Project

Creating a LED Toggling App using Board BSP APIs

Creating a LED Toggling App using Board BSP APIs-Nucleo

Installing OpenSTM32 System-Workbench

Downloading and Installing OpenSTM32 System-Workbench

Installing OpenSTM32 System-Workbench


Note for the students

STM32CubeMX Installation

Exploring STM32 Native Bootloader

Activating ST’s Bootloader Part-1

Activating ST’s Bootloader Part-2

Activating ST’s Bootloader Part-3

Activating ST’s Bootloader Part-4

Custom Bootloader Communication with HOST

Bootloader Transport

Bootloader code placement

Bootloader Supported Commands

Host – Bootloader Communication

Boot-Loader Project Creation

Boot-Loader Project Creation

Bootloader Project Exploration Part-1

Boot-Loader UART Testing

Command UART testing

Debug UART Testing

Boot-loader Jumping to User Code

Boot-loader Jumping to User application Part-1

Boot-loader Jumping to User application Part-2

Boot-loader Jumping to User application Part-3

Flash Code Placement using OpenSTM32 System Workbench

Vector Table offset Register(VTOR) use case

Boot-loader Jumping to User application Part-4

Boot-loader Read Commands from Host

Boot-loader command format

Boot-loader read commands implementation

Command Handle Functions Implementation

Implementing BL_GET_VER Command

Boot-loader Command Handling Flow-Chart

BL_GET_VER Handle Function Implementation

Boot-Loader ACK/NACK Implementation

Boot-Loader Verify CRC

Sending BL_GET_VER_CMD Reply

BL_GET_VER_CMD Testing Part-1

Python Installation on Host

Python Pyserial module installation

BL_GET_VER_CMD Testing Part-2

BL_GET_VER_CMD Debugging

Implementing BL_GET_HELP_CMD

BL_GET_HELP_CMD Implementation and Testing

Implementing BL_GET_CID_CMD

BL_GET_CID_CMD Implementation and Testing


Understanding Flash Read Protection Levels

BL_GET_RDP_LEVEL Command Testing

Implementing BL_GET_GO_TO_ADDR_CMD

BL_GO_TO_ADDR Command Implementation

BL_GO_TO_ADDR Command Testing


BL_FLASH_ERASE Command Implementation

BL_FLASH_ERASE Command Implementation contd.

Testing Flash Sector Erase

Testing Flash Mass Erase

Implementing BL_MEM_WRITE_CMD

BL_MEM_WRITE Commadn Implementation

BL_MEM_WRITE Command Testing

Options Bytes and Flash Sector Protection

Options Bytes Programming

Implementing Flash Sector Protection Commands

Summary of the commands

Exploring HOST Application

HOST application Source files and Details

Procedure to Add your own command




Shreyas9 September 2020

This is a good course. I enjoyed doing this course like doing this practically on my Nucleo STM32F429ZI. I have enjoyed all the courses from Kiran so far. This tutorial is a bit simpler. Perhaps, it is simple because boot-loader job is nothing but to jump to an address. Another job is to write to the flash. It is a good course but I was expecting it to be a bit more detail and a bit more difficult. I will recommend this course to everyone though. You will learn what bootloader does . Believe me bootloader is a very important thing while we do embedded development. Kiran you are amazing.

Ahmed22 August 2020

the effort is great and you showed the purpose of the boatloader clearly. but i suggest to choose one environment (IDE) not more than one to use this time to add another material for this course

Zsolt27 June 2020

Nice introduction and hands-on examples of boot loader implementation. I definitely recommend this course!

Subhash12 June 2020

The course is really useful. - The implementation is explained properly with the appropriate level of detail. - The concepts of the bootloader are explained. The complete bootloader for the STM32Fxxx controller is implemented and explained properly - I recommend this course for one who really wants to implement the custom bootloaders for the ARM-cortex M microcontrollers.

Lakshmiravikanth2 June 2020

The tutor is excellent and course is very well designed.Appreciate his efforts wholeheartedly !! Suggestion is to improve the video quality as it is not clear intermediately.

Mario21 February 2020

Really good course to start in bootloader stuffs for beginners and medium level. I just give 4 stars since at the end of the course (from section 21) it seems that instructor just wanted to finish the course instead of explaning code details.

Gil6 February 2020

I'm Engineer and professional in Embedded systems. Good course, Kiran explains it very well, I'm looking for his next courses in the future.

Antonello15 January 2020

Excellent course. It covers all aspects on both the target and programmer side. The material provided by the teacher is very valid and can be used as it is. Surely the teacher will update the development environment to STM32CudeIDE.

Mohammed2 January 2020

I haven't finished the course yet, most likely I will not. Because I got till now everything that I need, I understood for the first time what a Bootloader is and how it works.

Ajith28 December 2019

So far the concepts presented are ideas that I had learnt myself. But I like the way the instructor has organised it and the explanation is good.

Keith17 December 2019

The instructor walks you through every step of building and interfacing with a UART-based bootloader. You end the course with practical experience that can be immediately applied to your own bootloader application.

Pavan10 November 2019

I Really enjoyed the course ! I am expecting device drivers course with Real time projects. Thanking you!!

Muhib19 October 2019

This is by far the best course on bootloader development on any microcontroller. Usually there is not much information on this topic in books and application notes and in the real world you are faced with problem of upgrading the embedded system in the field. The instructor has gracefully explained how to solve that problem. Highly recommended!

Dharmendrasinh11 September 2019

This is a great course for beginners. The author spends a lot of time on installation and implementing the application code. The heart of the course which is Bootloader is quite a small part which he does cover really well. He could have covered more scenarios for advance bootloaders like shared code between Bootloader and Main app. But this is a great course to brush up your knowledge.

Shridhar28 July 2019

I have almost zero knowledge on bootloader and have high expectation. So far soooo good. When the Instructor is Kiran, I am sure I will not go back with empty hand. I have subscribed all his courses and believe me, all his courses are AWESOME. Thanks.


1/9/202136% OFFExpired


Udemy ID


Course created date


Course Indexed date
Course Submitted by