7

There are two ATmega328P bootloaders, old and current. What is the difference between these bootloaders?

I'm aware that Nanos sold by Arduino use the new bootloaders but I haven't been able to find any release notes about the bootloader.

  • from what I can see, the "old" bootloader is ???/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex and the new one is ???/bootloaders/optiboot/optiboot_atmega328.hex - ??? depends on your system, but should be easy to find - online, see github.com/Optiboot/optiboot – Jaromanda X Apr 15 '18 at 23:55
  • 1
    I bootload all my '328P chip based boards as 16 MHz Arduino Uno, then I don't need to worry about selecting the right board type. – CrossRoads Apr 16 '18 at 12:27
14

The bootloader currently shipped on the official Arduino Nano boards and selected via the Arduino IDE's Tools > Processor > ATmega328P after choosing Tools > Board > Arduino Nano is the same version of optiboot used by the Arduino/Genuino Uno: https://github.com/arduino/ArduinoCore-avr/blob/master/boards.txt#L152

nano.menu.cpu.atmega328.bootloader.file=optiboot/optiboot_atmega328.hex

https://github.com/arduino/ArduinoCore-avr/blob/master/boards.txt#L72

uno.bootloader.file=optiboot/optiboot_atmega328.hex

The bootloader selected via Tools > Processor > ATmega328P (Old Bootloader) is the "ATmegaBOOT" bootloader.

As used by the Nano hardware definition, there are two significant differences between the two bootloaders:

  1. Optiboot will not go into an endless reset loop after a watchdog reset. ATmegaBOOT will.
  2. Optiboot expects the upload communication at 115200 baud. ATmegaBOOT, 57600. This is the reason why the old boards don't work with the Tools > Processor > ATmega328P selection and vice versa.

There is another very significant difference between the two bootloaders that, sadly, you will not benefit from with the new Arduino Nano board/hardware definition: Optiboot will fit in a 0.5 kB boot section, while ATmegaBOOT requires a 2 kB boot section. Unfortunately Arduino forgot to change the BOOTSZ fuse accordingly and so the opportunity to free up 1.5 kB of precious flash memory for the users of the Nano was lost. The willingness of Arduino to knowingly release flawed hardware has historic precedent.

I haven't been able to find any release notes about the bootloader.

Arduino's release notes have not yet adapted to the fact that hardware packages may be released independently of IDE releases ever since Arduino IDE 1.6.2. There is a note about the bootloader change in the IDE release notes for the next IDE release:

https://github.com/arduino/Arduino/commit/ec179e5af67b7f1eeb5e46d22034798f8b24b7cb

Other than that, you can consult the commit history:

https://github.com/arduino/ArduinoCore-avr/commit/1b14cc07331268e95eddcce2cc67e29ed667e62f

  • Can the nano be flashed with either bootloaders or are there hardware differences that the booloader depends on? – Claus Apr 18 '18 at 14:44
  • 3
    There are no hardware differences. If you're flashing the bootloader my advice is to do so with Tools > Board > Arduino/Genuino Uno selected because then you get all the benefits of optiboot, including the 1.5 kB extra flash memory. Just remember that you need to have the Uno board when you use your Nano after that. – per1234 Apr 18 '18 at 21:01
  • 1
    *Uno board selected – per1234 Apr 19 '18 at 0:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.