Here's a LittleFS test program that works fine on the IMXRT1062-based Teensy 4.0. It writes four bytes to a file "Test" on LittleFS and then reads them back:
#include <LittleFS.h>
LittleFS_Program LittleFS;
void setup() {
Serial.begin(9600);
delay(3000);
LittleFS.begin(1024);
}
void loop() {
File file;
uint8_t u8[4] = {12, 34, 56, 78};
Serial.println("Write");
file = LittleFS.open("Test", FILE_WRITE_BEGIN);
if (file.write(u8, 4) != 4) Serial.println("Not enough room");
else Serial.println("Success");
file.close();
//
Serial.println("Read");
file = LittleFS.open("Test", FILE_READ);
file.read(u8, 4);
if (u8[0]==12 && u8[1]==34 && u8[2]==56 && u8[3]==78) Serial.println("Success");
file.close();
for(;;);
}
Running it on the GIGA produces the following error:
LittleFS.h: No such file or directory
Looking in the GIGA core I suspect it should be:
#include <LittleFileSystem.h>
I then get a large number of further errors, including:
error: 'LittleFS' was not declared in this scope
error: 'File' was not declared in this scope
Any suggestions?