The design of littlefs: A fail-safe filesystem designed for microcontrollers
"Usually, microcontroller code is simple and reactive, with no concept of a shutdown routine."<p>Really? Nobody uses brownout interrupts to lock down on power loss?  I almost always do a few things as the power is fading, flagging the situation at the very least in order to clean up when power is restored.