Burn newest Optiboot onto 8MHz 328P

Hey there,

I have designed my own board based on an arduino pro mini running with a 328p on an external 8MHz Chrystal. (I need the 3V3 version with 8MHz due to the circuitry its connected to)

I would like to burn the latest version of Optiboot onto this 328p since I want to reduce bootup time while still having a bootloader burned since I want to still be able to program the chip via USB not ISP. Up to now I could find bits of explanations of how to burn the latest version of optiboot but sadly they often were too vague for me to follow or didn’t explain how to convert the 16MHz bootloader into a 8MHz bootloader very well.

Since at some point this board is supposed to go into production the simplest way to burn a lot of the latest Optiboot bootloaders (using an arduino uno as programmer) would make most sense. WestfW’s OptiLoader seems promising but I can’t figure out what to do with the files and how to change the bootloader into an 8MHz version.

Could someone explain the process of how to do this in a simple way or maybe direct me to a good tutorial?

Thank you in advance!
Tuege

Voltage does not matter, but frequency does. Optiboot have to be compiled for exact frequency. The HEX for 8MHz used to be available but not anymore as I see. Source is on github.

The easiest way to do this is using MiniCore:

Thank you so much!The process is really well described there and you have linked great resources.

I have now burnt the bootloader using an arduino uno as programer and the bootloader burned without issues with the settings mentioned above.

My only issue is that using this newer version of Optiboot has not provided any speed up in boot up time at all. The boot up still takes between 1 and 1.5 seconds (I am looking for 600ms or less with bootloader still burned on the chip) however according to the thread linked below I should expect a boot up time of 65ms down to even 15ms when Optiboot 6.2 has been burned.

Does anyone have any idea why I am not seeing a faster boot up time and how I could achieve a faster bootup time with bootloader still burnt on the chip?

“Boot up time” after power-on, or boot up time after reset?

How are you measuring boot up time, and have you timed the boot up time of your sketch without the bootloader? When power is first applied to the board, it should skip the bootloader and go directly to the sketch.

Optiboot have to be compiled for exact frequency.

Yes and no. One of the "recommendations" for an 8MHz ATmega328 is to just use the 16MHz .hex file, and run the serial port at 57600 instead of 115200

The HEX for 8MHz used to be available but not anymore as I see. Source is on github.

The Optiboot git repository is trying to get out of the "business" of providing .hex files (as the number of chips supported, and the various options available, have made the number of "possibly useful" .hex files very large. It's more for people who want to compile their own with very weird options, or modifications.
If you don't want to do that, you're better off with using one of full Arduino "Cores" that include more recent versions of Optiboot. MCUDude's cores include over 1500 Optiboot .hex files! (for MegaCore), and DrAzzy's ATTinyCore has over 200.

westfw:
“Boot up time” after power-on, or boot up time after reset?

The Bootup time after power-on

david_2018:
How are you measuring boot up time, and have you timed the boot up time of your sketch without the bootloader? When power is first applied to the board, it should skip the bootloader and go directly to the sketch.

I am currently measuring it by visual inspection only. The first thing I do is setup timer2 at 1kHz (this is done in setup) which calls a function to immediatly switch on an LED (after the 1 ms delay of the first timer cycle of course)

Testing without the bootloader is probably a good idea to compare against. I will do that and also use the simplest sketch I can think of to indicate "boot-up time" after power-on which would be nothing except switching an LED on in setup (without all the timer and function stuff)

Here's something to try. Don't use the latest version, use 4.4.

The power on no-delay of Optiboot is more stable in the older version 4.4 of Optiboot. The newer versions are finicky depending on some characteristic of the serial or auto reset circuit, so they may or may not give you a power on with no delay. It may depend on what serial circuit you are pairing with your own board based on the Pro Mini.

Try the optiboot_atmega328.hex that is in the older versions of Arduino, such as 1.6.5 and earlier. That is for the Uno at 16MHz. You can verify it is version 4.4 by looking at the comments in the optiboot.c file in the bootloaders directory. In Arduino IDE 1.6.5 (or older), select the Uno board and burn the bootloader. Then change the board selection to Arduino Pro or Pro Mini, which uploads at 57600, to upload sketches. Upload a sketch and do your power on delay testing.

As westfw mentions you will be burning a bootloader intended to upload at 115200 on a 16MHz MCU, but since your MCU is running at half that speed, the upload is also half speed (57600).