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.
1 Answer 1
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:
- Optiboot will not go into an endless reset loop after a watchdog reset. ATmegaBOOT will.
- 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– Claus2018年04月18日 14:44:57 +00:00Commented Apr 18, 2018 at 14:44
-
4There 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– per12342018年04月18日 21:01:26 +00:00Commented Apr 18, 2018 at 21:01
-
1
-
It might be worth noting: I have just received a Nano "clone" of AliExpress, which (unusually for a clone) has a FT232R (instead of a CH34x), which means that it works nicely on my Mac. However, I found that I had to select the old bootloader to be able to upload sketches - which seems contra your post (stating that the new bootloader is used for the Nano). However, as my Nano is a clone, I guess that anything goes.Greenonline– Greenonline2023年04月16日 22:50:56 +00:00Commented Apr 16, 2023 at 22:50
???/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