A more accurate answer to my question about the
large number of different Arduino bootloaders requires explaining how the Arduino environment determines
which bootloader to burn onto a board or bare AVR MCU chip.
First of all, because the bootloader communicates over a serial port, this necessitates having several different pre-compiled .hex bootloader files to match the desired AVR MCU clock frequency and baud rate. Choosing the correct .hex bootloader file to burn onto the board or AVR MCU is handled automatically by the Arduino IDE (nearly all of the time). This configuration data is stored in Arduino
"boards.txt" files. Note that "files" is plural because each "board" which can be selected by the user has its own specific "boards.txt" file.
Bootloader configuration parameters in "boards.txt: include:- Exact name of AVR MCU part (example: ATmega328P)
- Clock frequency of AVR MCU (often 16MHz)
- Baud rate for bootloader (often 115.2k, occasionally 19.2k, 38,4k, or 57.6k)
- Which AVR UART will be used for bootloader (larger AVR devices have several)
- Exact details for how to set the "fuses" on the AVR MCU chip
- Whether or not a bootloader is to be burned onto the AVR device
All of this is necessary because the bootloader must be aware of the AVR MCU clock frequency and of the desired serial port baud rate. These parameters (and others) must be "hard-coded" into the bootloader itself. "Boards" such as "minicore" which support several different AVR devices contain literally 100's of pre-compiled .hex bootloaders in order to support numerous different hardware, clock frequency, and baud rates. Fortunately the Arduino IDE user is spared
most of the effort required to configure these details properly.
Popular Arduino boards (UNO, nano, and similar) come with bootloaders already installed. Even the Chinese clone boards often contain a "functional" bootloader pre-installed. It gets more interesting for those of us who wish to use bare AVR MCU chips or non-AVR MCU devices within the Arduino IDE. Fortunately the excellent "minicore," "mightycore," and "megacore" packages available on Github handle these details quite well. But due to the large number of choices which they support, one must pay attention to the user guide and examples provided.
Important: The Arduino IDE "burn bootloader" command does considerably more than just putting a bootloader onto the board. It also takes care of properly programming the "fuses" inside the AVR MCU.
The "bootloader doesn't work" issue is often caused by incorrect fuse settings. Or by failure to select the correct choices within the Arduino IDE "boards" menu system.
For example, the "minicore" package enables the user to select among a large number of different AVR clock frequencies. But in order for this to work, one must "burn bootloader"
after changing the AVR clock frequency within the Arduino IDE. This is required
even for the case of using AVR MCU chips
without a bootloader. I know this may not seem logical.
After all, why "burn bootloader" when one isn't using a bootloader?The answer is this:
The Arduino IDE "burn bootloader" command properly sets the "fuses" inside the AVR MCU.One alternative is to learn how to use AVRDUDE from either a command line or through the superb AVRDUDESS GUI. But this requires detailed knowledge of AVR MCU hardware.
I'll provide specific examples and walk-throughs soon. I have successfully installed bootloaders onto many different AVR MCU devices.