What is BootLoader?
The Boot Loader is the first program that runs (before the main program) whenever a system boots. On PC It is used to boot the system operating system. In case of microcontrollers , a bootloader enriches the capabilities of the microcontroller and makes it a self-programmable device. This article will explore the importance of having bootloader on microcontroller .
When working with microcontroller a common problem faced is programming the controller? Different controllers follow different protocols to program their ROM and therefore each controller has a different programmer which is difficult to do. On the other hand, a universal programmer is quite expensive.
With the era of technology upgrade, today's microcontrollers are not only becoming more powerful but also incorporating technically superior functionalities, which makes them more flexible and quite easy to use. The bootloader is one of them. The bootloader is a small section in the controller's ROM that runs first when it boots. Generally boot loaders were written to enable a controller with auto-save capabilities. The bootloader program can access any of the built-in peripherals like USB, USART, CAN, SPI, etc. to exchange data and this feature is used to write to flash memory. In the automotive industry, controllers are encapsulated in a metal box and only allow access to a few pins. In these cases, the controller is programmed with the bootloader program using a CAN interface at the time of manufacture and is then glued into the circuits, which provides ease of updating the code over time.
The bootloader can be inserted into a controller using an external or any conventional recorder and then depending on the type of bootloader the controller starts responding to the interface. So, whenever the controller is reset, the program counter jumps to the bootloader section and waits for the instruction, which is fed from the external device. If there is no bootloader, the program counter will go to 0000H (starting position of the flash memory) and begin executing the instructions that are written in the device's memory.

Figure 1: Role image display of a boot manager
If the program counter goes into the boot manager section then after running the bootloader there must be an instruction in the bootloader that will force the program counter to go to 0000H.
Mostly the bootloader resides at the bottom area of the ROM, but there are some cases where the bootloader can be configured at the top (like in PIC18F). The starting and ending address of the boot loader in ROM depends on the product. Therefore, it is recommended to use the technical sheet to collect the necessary information.