Wear-leveled SPI flash file system for embedded devices