Ok, we’ll come clean. [Design Build Destroy] didn’t really add any memory to his Arduino Nano. But he did get about 1.5K more program space when compared to the stock setup. The trick? On some Nano boards and clones, the bootloader is set to use a large block of reserved memory, but Optiboot only requires a fraction of that reserved memory. By reprogramming the bootloader and changing the configuration fuses, you can reclaim that unused memory.
Of course, you can’t easily overwrite the bootloader and fuses over the serial port to prevent you from bricking your device. The video below shows how to connect another Arduino to do the programming. You could also use any dedicated AVR programmer you happen to have. Oddly, the Uno already uses Optiboot with the same processors, and is set correctly and the video shows the differences in the configuration between the two in their default state.
Of course, depending on where you get your Nano devices and their age, you may already have this set up at which point you won’t gain anything, but you should be able to easily tell if you need to go through the steps or not. The same trick will probably work with any older Arduino boards you have laying around if Optiboot supports them. What can you do with the extra memory? Maybe speech recognition?
Neat! More memory is always better!
As someone who has witnessed what happens to software when programmers think all computers have gigabytes of memory, I can tell you it’s not always better.
Thanks a lot!
is possible run mRuby on this device? is possible add MMU or xor correct to arduino to?
A quick google found an mruby-arduino github repo that says you probably want at least 90kB (I see 70-80kB mentioned elsewhere) of ram to run mRuby, while the nano has 2kB, so probably not. For a similar form factor you could try it with a blackpill board, some of them come with the STM32F411CEU6 which has 128kB. Be aware, though, that many of these boards come with counterfeit or lower-spec MCUs (though I don’t think it’s as much of an issue with the newer blackpill as it is with the older bluepill), so be sure to verify the MCU is what you think it is with ST-Link before burning a bunch of time trying to flash something to it.
I think Julian Ilett did something similar a couple of years ago.
https://www.youtube.com/watch?v=bpXUvRr2ywA
Whaaaaat?
Isn’t this widely known for like a decade now?
I tried a few days ago, it’s not only the extra memory the better, old bootloader have a problem with .noinit section memory
Why not ditch the bootloader completely and gain even more memory?
Because what’s left is AVR and blinking led takes 10x more time for uninitiated.
@Rumble_in_the_Jungle
If someone is reprograming boot loaders they are probably not the uninitiated.
If you can do without the bootloader then you likely aren’t using an Arduino. Besides, it’s like a couple kilobytes at most.
Hello, Nice to see, but why can’t you use the bootloader from the UNO. it has the same processor.
And why are there different bootloaders for the pro-min, de nano and the UNO? (with the same voltage and speed)
Is it not possible to use the UNO bootloader for all, because, they heve the same processor. (what is the read different?)
It will be easier and no OLD BOOTLOADER anymore!
Next you’ll want to know why Arduino is still using “Optiboot 4.x” (from a decade ago) when https://github.com/Optiboot/optiboot is up to version 8.x
(Actually “if it’s not broke, don’t fix it” is a pretty good excuse.)
Of course! Of course…
With witch program can i readout the boot version installed on the arduino version? I can’t find a suitable tool.
With or without a device programmer?
If you have Optiboot, it has a version number in the last two bytes of flash ([bows].)
For non-optiboot, …, you can read the bootloader section of memory (top 2k for Uno/etc) and compare it (binary wise) to bootloaders that you might expect to find. (Good luck.)
Note that with the default fuses, a sketch running on the AVR cannot read the bootloader memory, so that while it can check the fuses to see if you have a 512byte bootloader (probably optiboot), it can’t read the version info. Meanwhile, the bootloader can read its own memory, but it can’t read the AVR’s fuses… Sigh.
I have with a UNO the bootstrap programmed from a NANO with the only choosing the UNO as reference and the NANO is now a UNO with 1,5kbyte more space. My NANO has now 32256 bytes and not 30720 from the old NANO bootstrap.
It works easy, make from a NANO easy a UNO with more space only by the choice of the UNO bootstrap.
Also easier no more old NANO anymore. (if you re flash it)
I did this recently. In the Arduino IDE under tools menu there’s an option “Processor” and you can pick ATmega328P or ATmega328P (Old Bootloader). I believe I had old bootloader selected and it burned the old bootloader instead of the new one. So make sure you have “Processor: ATmega328P” when you click “Burn Bootloader”.
Hello. Thank you for this trik. I would like to switch to IDE 2, and there is no Board.txt file ! How is it possible to get the increased memory ?