Nader Al Khatib's Forgetfulino Embeds Your Arduino Sketch's Source Code Right on Your Dev Board
Never lose your code again — by ensuring when you pull the board out of a dusty drawer years later, the source code is right there with it.
Maker Nader Al Khatib is looking to make it harder to accidentally lose your Arduino projects' source code — with a tool to write it right to the board's flash memory for later retrieval: Forgetfulino.
"Forgetfulino is an Arduino library and Arduino IDE 2.x extension that embeds your sketch source code into firmware flash and lets you recover it later via serial," Al Khatib explains. "[It] stores the exact sketch sources (all .ino and .cpp files) in PROGMEM. [It requires] zero RAM usage for storage: everything stays in flash."
The use-case for Forgetfulino is obvious: safely storing a copy of the source code with the hardware on which it's running, making it easy to pick up forgotten projects and start hacking on them again. It's an approach already in-use in interpreted environments like MicroPython, where the program is copied into storage as Python source code and interpreted at run-time — but not so common in compiled environments like Arduino, where C/C++ source code is transformed into a binary before being flashed into program storage.
Now in its second major release, after a week of integrating feedback from the first version, Forgetfulino includes some impressive features: it requires none of the precious RAM on a development board to work, and stores the source code in a compressed format — with the option to transfer it back to a host machine as either a rapid compressed stream or in its original plain-text form.
"Forgetfulino is NOT a replacement for Git [version control]," Al Khatib explains of the project. "If you stop pushing to GitHub because 'it's on the chip anyway,' you are doing it wrong. This is your emergency parachute, not your airplane. Use it for those projects you find in a drawer three years from now, but keep your workflow professional."
The source code is available on GitHub, under the permissive MIT license; a tutorial video is embedded above and is also available on Al Khatib's YouTube channel.