Question on Optiboot and speed versions(?) 1 MHz and 8 MHz

Hi

I have a basic understanding of the function / goal of a bootloader, although I've never looked into an actual bootloader program.

Having read a number of bootloader posts I have a few questions.

  1. I see the statement ".... Optiboot Version for 1 MHz or 8 Mhz...." From this I assume there are two versions of Optiboot one for 1Mhz and the other or 8 Mhz. Is this correct? Can I assume the 8Mhz is suitable for 10, 12, 16 Mhz etc?

  2. I am using Arduino IDE V1.8.5 One post suggested this IDE uses Optiboot V4.4 (was an old post). Is this correct? And would changing to a newer version be useful (I am using the 328P chip)

Thanks

Optiboot uses serial. Serial requires the baud rate on the two devices to be the same - but the baud rate is generated on the AVR by dividing down the system clock. Hence, you need to have compiled optiboot for the speed the part is running at, or be running at a baud rate the same multiple of the original one as the clock rate is of the original clock (ie, if I have a 115200 baud optiboot bootloader built for 16mhz, I could use that at 8mhz with 57600 baud), though the speed of the triple-blink and other timing related functions will also be thrown off (usually doesn't matter).

Usually people build optiboot for the speed they'll be running at. MCUDude (hansibul) maintains cores for most atmega chips you'd want to use, and I maintain a core for almost any attiny you'd want to use - and we both supply optiboot for supported chips precompiled for almost every speed in common use.

Do you really need to rebuild the bootloader? Check MiniCore - i think it has optiboot built for the speeds you want already. If you're on windows, it's a right pain in the ass to set up a build environment because recent versions of the IDE don't include some of the required utilities. I pieced mine together from 1.0.6 IDE, and atmel's latest compiler version.

I don't think the version matters for a '328p - most of the changes have involved supporting hardware. Consult the release notes to be sure.