生成 spiffs image
python spiffsgen.py <image_size> <base_dir> <output_file>
eg, python spiffsgen.py 0x2000 ./folder hello.bin
Arduino 的库有例子可以直接用于 OTA 升级 spiffs 分区
HTTPUpdateResult HTTPUpdate::updateSpiffs(HTTPClient &httpClient,const String ¤tVersion,HTTPUpdateRequestCB requestCB)
Arduino 里对 spiffs 的使用
1, 初始化
if (!SPIFFS.begin(FORMAT_SPIFFS_IF_FAILED)) {Serial.println("SPIFFS Mount Failed");return;}
2,使用
listDir(SPIFFS, "/", 0);writeFile(SPIFFS, "/hello.txt", "Hello ");appendFile(SPIFFS, "/hello.txt", "World!\r\n");readFile(SPIFFS, "/hello.txt");renameFile(SPIFFS, "/hello.txt", "/foo.txt