All firmware developers listens the word
BOOT LOADER. There is little bit confusion with this word in contrast to PC and
Microcontroller.
In contrast to PC boot loader is a program
that runs before an operation system start. Boot loader places the operating
system in memory. In computer is the
process of initialization of all the peripherals.
In microcontroller boot loader is the
small piece of code which is used to reprogram the flash program memory. Boot
loader resides in the program memory. Boot loader code should be small in size.
Boot loader code may be place at the bottom of Flash Memory or at Top of Flash
memory. Boot loader receives the code from any external communication module
such as USB, UART, SPI, I2C, CAN etc and save this code in to program memory.
As shown in figure above after reset
program start executing from Reset Vector 0x0000h. The Boot Load Code is
available at bottom of Flash Memory.
Why
Use Boot Loader?
·
Mostly microcontrollers
use special hardware to program microcontroller. For example ST’s
Microcontroller uses JTAG or single Interface module, AVR uses JTAG interface
to program and debugging. They have some pins for programming. The hex file is
of program originates in PC, So hardware to program the microcontroller is
connected to PC by some interface like USB and Serial Communication and other
end connected with the Microcontroller.
Some time this hardware is very expensive. In some cases Microcontrollers
will be programmed with boot loader code with special hardware devices. Boot
Loader code check communicates with host system through some type of
communication like UART and if it gets any firmware upgrade command from Host
system it will update the firmware of Microcontroller else it will execute
existing code.
·
In Some case it is
required to Firmware update in field then Boot Loader come in existence. In
that cases Hex file will place in PC or other device which will communicates
with microcontroller through serial communication. When Microcontrollers get Reset command
either by hardware or software, after reset boot loader check communication
with Host system to upgrade the Firmware.
·
Firmware update over the
air is the place where Boot Loader is required.
In this case we save the program to be updated receives from wireless
communication in external memory or internal flash memory. After saving program
we give the software reset command to microcontroller. After reset if new
program exists in flash memory boot loader set program counter to execute
program from new location. If program
saves in external memory then boot loader will first update the program in
controller flash memory and then start execution updated program.
No comments:
Post a Comment