Microcontrollers bootloader and firmware basics

Discussion in 'Embedded Systems and Microcontrollers' started by SamEricson, Apr 26, 2015.

  1. SamEricson

    Thread Starter Member

    Apr 25, 2015
    When I have flashed programmed microcontrollers in the past some have bootloader hex files and then you load the firmware hex file. Other microcontrollers don't have a bootloader hex file just a firmware hex file. Why do some microcontrollers need a bootloader? and is bootloaders and firmware files always have to be hex files or what other types can they be? The bootloader just opens up and closes the inputs,output, and ports of the microcontroller. The firmware is the application program. but sometimes the firmware can be the bootloader and the firmware. I'm confused
  2. Papabravo


    Feb 24, 2006
    The files used to program a microcontroller or other memory device do not need to be ".hex" files. It is one of a number of popular formats. It might arguably be the most popular.

    Microcontrollers don't necessarily need a bootloader, it is just a convenience. They came into widespread usage with the advent of electrically eraseable, single voltage programmed FLASH memories. It used to be that microcontrollers had to be removed from the board(socket), erased with a UV light, programmed with an external programmer, and then placed back in the board(socket).

    Operationally the bootloader only gets programmed into the microcontroller once. It resides in non-volatile FLASH memory that retains its contents when the power is removed. The bootloader can be updated if new features are added or bugs are fixed, but this is usually infrequent.
  3. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    First let’s note that all code run in a microcontroller may be called firmware, whatever format that data may be in it contains the program instructions needed to do the job. Firmware may be divided into two broad categories, the application firmware that does some useful job, and the bootloader firmware.

    A unprogrammed micro fresh out of the package requires a separate programmer to load firmware before it can do anything useful.

    A bootloader is a special kind of firmware that loads other firmware using some interface not requiring that programmer. It may work off a USB input or an RS232 or a SD card or some other source to input the code. The main use is to skip the requirement for a separate hardware programmer unit to reduce cost. This may be done to make a lower cost development board, or to add the ability to upgrade a product “in the field” by a casual user.

    At start up the bootloader first checks if it is being asked to load code. If the bootloader is requested to load it reads instruction data off whatever interface it is using and sends that to the appropriate place in instruction memory. The check is often done by a special pushbutton switch dedicated for this task. If no request to load is made the bootloader just jumps to the first instruction of the application code.

    Note that while the bootloader does not need a programmer you still need a programmer to program the bootloader into the device. That is why sometimes as part of a larger package a micro may come with the bootloader alread installed.
    nithyavasudevan likes this.
  4. SamEricson

    Thread Starter Member

    Apr 25, 2015
    Yes I have notice this. What is this called when the bootloader it checking for the application? because the bootloader is on a timer for checking, if the bootloader doesn't find anything it will just default to the bootloader firmware.

    When you first turn on the power switch the bootloader is on a timer looking and checking for a application program firmware if it doesn't find any it will default. What I never knew the name of what this is called when the bootloader is doing this

    What does a bootloader firmware do or used for? I never knew what was on the bootloader or what is on bootloader files

    Yes you have to load the bootloader firmware first thur a serial port and then you load the application firmware thur the serial port also.