You might wonder why the chip manufacturers don't just bake a bootloader into every microcontroller chip at the factory.

Keep in mind that the vast majority of microcontroller chips wind up embedded in products ranging from toasters to traffic lights.  A modern automobile may have 100 or more embedded microcontrollers that only need to be programmed once by the parts supplier.  Cost, performance or other constraints can easily outweigh any considerations of programming convenience. 

There have been a few chips that come with a "ROM" (permanent) bootloader. Such as the ESP32 or the LPC11xx series with their USB mass storage bootloader, but these are very few-and-far-between.

microcontrollers_234A3233.jpg
Fuel Injector with embedded microcontroller. A processor in every cylinder!

Some of the reasons you may want to forgo the convenience of a bootloader:

Memory

Bootloaders tend to be rather small programs. But they do take some space.  For applications that need every last byte of program memory, the convenience of a bootloader may be an unnecessary luxury.

Embedded systems designers try to keep product costs down by using the smallest possible processor that can do the job.  Investing in a proprietary programming interface for the manufacturing line is a one-time investment.  Sizing up to a bigger processor adds cost to every unit sold.

Start-up Time

Most bootloaders incur some dead-time on power-up or reset as they look for a potential upload.  If ‘instant on’ is a requirement for your application, a stock bootloader may not be an option.

Security

If you don’t want everyone with an Arduino IDE to be able to re-program your device, ditching the bootloader will add another obstacle for a would-be hacker. 

(Although any hacker worth her salt will probably have an AVRISP and/or JLink in her toolbox!)

This guide was first published on Jun 19, 2019. It was last updated on Jun 19, 2019.

This page (Why not build them in?) was last updated on Jun 09, 2019.

Text editor powered by tinymce.