PIC bootloaders
PIC bootloaders
hey guys, anyone know what is a bootloader ?
Re: PIC bootloaders
A standard firmware comes in two major parts.
EXAMPLE:
Now you might be wondering about the requirement of a bootloader. Bottloader is a very useful part of the firmware. You might have seen some professional devices that can be re-flashed using USB or RS232. For example, ADSL routers can be upgraded to latest version that can be downloaded through Internet. In this case, it is essential to have a bootloader in the system. It works as below.

Now you can imagine a system where you program your microcontroller through RS232 port without using the Programmer. (You only have to use Programmer ones to write the bootloader)
Hope this helps.
- Bootloader
- Main application
- When you switch on your board (Microcontroller or DSP) the system will transfer control to a particular point in memory referred as first address location or entry point (This is defined in the manual). This is usually a pointer in FLASH. In some advanced systems like DSPs, this point can be changed to External FLASH, External EEPROM, etc... using DIP switches. We need to write the bootloader program to this location. If the bootloader is too large to fit, we simply write a small code to jump to another location with enough memory.
- Boot-loader can be used to initialise basic units of the device like UART, I2C, etc..., Verify components, Check power supply, wait for new firmware upgrade, etc...
- Finally the boot-loader should jump to main application.
You can see an example code here.
EXAMPLE:
Now you might be wondering about the requirement of a bootloader. Bottloader is a very useful part of the firmware. You might have seen some professional devices that can be re-flashed using USB or RS232. For example, ADSL routers can be upgraded to latest version that can be downloaded through Internet. In this case, it is essential to have a bootloader in the system. It works as below.
- PC sends start firmware update (Say 0xFF00FF00) bytes and keep on sending a firmware re-flash code (Say 0x88006600) to notify the PC is waiting to send the new firmware.
- When UNIT receive 0xFF00FF00, it resets itself so the bootloader starts again and UART/USB is initialised.
- Bootloader waits for few seconds until it identify the firmware re-flash code (0x88006600). Once it receives the code, it will send a command to request a line of new firmware followed by the memory address and write it to a the given location in memory. This process will repeat until it receives the last line.
- Once firmware re-flash is done, bootloader resets the UNIT and you are ready with the new firmware.

Now you can imagine a system where you program your microcontroller through RS232 port without using the Programmer. (You only have to use Programmer ones to write the bootloader)
Hope this helps.