Boot-loader is a program that runs in the microcontroller that has to be programmed. To load a program into memory, you must first load a program into memory. In some cases, it will be the earliest point at which the integrity of an embedded systems can be checked.
How a Boot-Loader for Microcontroller Works?
The boot-loader is a short program used to burn the firmware to the microcontroller without any programmer device either like FLASH or volatile like RAM and jumps to the desired program from there it takes care of execution. The process of burning the provided data to the program memory is controlled by the boot-loader. A boot-loader is a program which will be the first thing to run and can load other applications into specific places in memory and is provided to the serial interface. Embedded microcontrollers offer various hardware-reset-configuration schemes.
A boot-loader is an application whose primary purpose is to allow the systems software that has to be updated without using any specialized hardware such as a JTAG programmer.
- The boot-loader manages the systems images.
- It receives new program information externally via some communication means and writes that information to the program memory of the processor.
- They can communicate over a variety of protocols such as USART, CAN, I2C, Ethernet, USB and the list goes on for as many protocols that exist.
- There are many different sizes and varieties to embedded boot-loaders.
Systems with boot-loaders have at least two program images coexisting on the same microcontroller must include branch code that performs a check to see if an attempt to update software is in progress. This is in contrast with the normal way of getting the program into the microcontroller, which is via special hardware built into the micro for that purpose. On PICs, this is a SPI-like interface. The important point of external programming via specialized hardware is that it works regardless of the existing contents of program memory. Microcontrollers start out with program memory erased, so external programming is the only means to get the first program into a microcontroller. You will find a variety of boot-loader software for all kind of microcontroller in the internet.
The boot up process, often a complex multistep sequence involving numerous sub-steps solves this problem. Any boot-up process, including booting up Windows, Linux or an embedded RTOS (real-time operating system), begins with the application of power to the system and the subsequent removal of system reset. During power-on-reset we have to reconfigure hardware peripherals if operational values differ from those of default settings.
To enable system-boot flexibility both from USB, PCIe (Peripheral Component Interconnect Express), and SDHC (secure-digital-high-capacity) interfaces and from conventional memory devices it requires in-depth hardware and software capabilities.
The above figure shows a Boot-loader for microcontroller to program it. An optional way to program the application firmware onto the device is using a boot-loader. Open source firmware specifically, the UBoot (Universal Boot Loader) utility, which finds wide use in embedded-system platforms have lot of value. The Linux-based boot loader can automatically boot up the operating system alternatively and it allows a user to manually run explicit commands to start the operating system and it supports booting from a variety of interfaces.
During the programming process of a boot-loader microcontroller the application firmware has to be transferred to the memory of the chip. This is normally done with a programmer device that burns the machine code to the program memory.
Usually the boot-loader is located at the beginning of the memory area or at the very end of it and is the first program that will be executed after powering on the device. If the boot-loader firmware detects the programming intention, it will take all the control and transfer the coding to the device or it will give to the application firmware by jumping to the address and marks the entry point of the firmware. This entry point has to be defined in the coding of the boot-loader. If the boot-loader is located at the beginning of the program memory, the address for the interrupt routines has to be shifted in the similar way. The boot-loader firmware has to be transferred to the program memory of the chip before it can be used to program the application firmware onto the device. This has to be done with a conventional programmer as mentioned above.
Another issue which has to be considered is that the boot-loader firmware and the application firmware are sharing the same memory space on the chip and therefore we have to ensure not to overwrite the boot-loader while transferring the application coding to the program memory.
What is Boot-loader in Microcontroller and How It Works?
The Boot-loader has to be programmed in the program memory of the microcontroller using a conventional programmer and later the microcontroller will be programmed without a programmer. Once the boot-loader is programmed in such a way in microcontroller then each time after reset it starts running like any conventional program in Microcontroller Bootloading.
For Example: Programming PIC18 devices with bootloader AN1310 and HI-TECH C compiler
In a boot-load microcontroller development board which is equipped with a PIC18F23K22 and the bootloader AN1310 provided by Microchip, the bootloader AN1310 provides an incremental bootloading option which will allow us to change only that memory blocks which have been modified with microcontroller programming.
To program the firmware I am using HI-TECH C Compiler. The development board will be connected to the PC via USB wire. For this purpose the board is equipped with the USB chip FT232R which provides the USB serial interface to communicate with the UART interface of the chip.
As the bootloader installed on the chip of my development board, is located at the beginning of the program memory area, the starting address for the application firmware has to be shifted to an address outside of the memory region where the bootloader resides. In my case it is the memory position 0×400 which marks the beginning of the application.
In Bootload micro controller, the target address for the interrupt routines will be shifted accordingly as the bootloader firmware occupy the interrupt address as well Where we normally expect the address for the interrupt routines we will find a pointer to the shifted interrupt address.
For instance, a UART bootloader will listen to the UART buffer of the micro, checking for incoming bytes. If the bytes start arriving, the bootloader will grab them and write them in the program memory in the sequence it receives them and at predefined locations. Once all bytes have been received, the bootloader for microcontroller executes a jump at the start of the memory zone it has received and then the “normal” program starts running.
This is how a 8 Kbyte memory of a micro:
The PIC18F4550 is a bootload microcontroller from the Microchip 8-bit family. This microcontroller is ideal for low power 1 and connectivity applications that benefit from the availability of three serial ports: FS-USB (12Mbit/s) and an asynchronous serial port. Large amounts of RAM memory for buffering and enhanced flash program memory make it ideal for embedded control and monitor applications that require periodic connection with a personal computer via USB for data upload/download/firmware updates.
- Understanding embedded system boot techniques by eet
- A Boot loader for Microcontroller Programming by bitcook
- Micro controller Boot-loader by emcelettronica
- Precompiled HID Boot loader – microchip by tinypic
- PIC18F4550 Bootload Microcontroller by pinguino
- Schematic of Bootloader Microcontroller by picprojects