Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 9 of 9

Thread: LittleFS for Winbond W25Q128 flash memory

  1. #1
    Senior Member Sandro's Avatar
    Join Date
    Nov 2016
    Location
    Rimini - Italy
    Posts
    134

    LittleFS for Winbond W25Q128 flash memory

    Hi all, I'm trying to experiment the LitteFS library's functionalities using this version:
    https://github.com/PaulStoffregen/LittleFS

    starting from the included example ListFiles. I'm using a Teensy 4.1 with Audio board rev.D, and the small W25Q128 chip on it.
    This is the example's code (unmodified):

    Code:
    // Print a list of all files stored on a flash memory chip
    
    #include <LittleFS.h>
    
    
    // Flash chip on Teensy Audio Shield or Prop Shield
    LittleFS_SPIFlash myfs;
    const int chipSelect = 6;
    
    
    void setup() {
      //Uncomment these lines for Teensy 3.x Audio Shield (Rev C)
      //SPI.setMOSI(7);  // Audio shield has MOSI on pin 7
      //SPI.setSCK(14);  // Audio shield has SCK on pin 14  
      
      // Open serial communications and wait for port to open:
      Serial.begin(9600);
      while (!Serial) { ; // wait for Arduino Serial Monitor
      }
    
      Serial.println("Initializing Flash Chip");
    
      if (!myfs.begin(chipSelect)) {
        Serial.println("initialization failed!");
        return;
      }
    
      Serial.print("Space Used = ");
      Serial.println(myfs.usedSize());
      Serial.print("Filesystem Size = ");
      Serial.println(myfs.totalSize());
    
      printDirectory(myfs);
    }
    
    
    void loop() {
    }
    
    
    void printDirectory(FS &fs) {
      Serial.println("Directory\n---------");
      printDirectory(fs.open("/"), 0);
      Serial.println();
    }
    
    void printDirectory(File dir, int numSpaces) {
       while(true) {
         File entry = dir.openNextFile();
         if (! entry) {
           //Serial.println("** no more files **");
           break;
         }
         printSpaces(numSpaces);
         Serial.print(entry.name());
         if (entry.isDirectory()) {
           Serial.println("/");
           printDirectory(entry, numSpaces+2);
         } else {
           // files have sizes, directories do not
           printSpaces(36 - numSpaces - strlen(entry.name()));
           Serial.print("  ");
           Serial.println(entry.size(), DEC);
         }
         entry.close();
       }
    }
    
    void printSpaces(int num) {
      for (int i=0; i < num; i++) {
        Serial.print(" ");
      }
    }
    I allso added FS.h (from https://github.com/PaulStoffregen/co...master/teensy4) to Arduino\hardware\teensy\avr\cores\teensy4.
    If I try to compile, this is the result:
    Code:
    C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\dell\AppData\Local\Arduino15\packages -hardware C:\Users\dell\Google Drive\ARDUINO SKETCHES\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\dell\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\dell\Google Drive\ARDUINO SKETCHES\libraries -fqbn=teensy:avr:teensy41:usb=serial,speed=600,opt=o3std,keys=it-it -ide-version=10813 -build-path C:\Users\dell\AppData\Local\Temp\arduino_build_487132 -warnings=all -build-cache C:\Users\dell\AppData\Local\Temp\arduino_cache_549412 -verbose C:\Users\dell\AppData\Local\Temp\arduino_modified_sketch_391317\ListFiles.ino
    C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\dell\AppData\Local\Arduino15\packages -hardware C:\Users\dell\Google Drive\ARDUINO SKETCHES\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\dell\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\dell\Google Drive\ARDUINO SKETCHES\libraries -fqbn=teensy:avr:teensy41:usb=serial,speed=600,opt=o3std,keys=it-it -ide-version=10813 -build-path C:\Users\dell\AppData\Local\Temp\arduino_build_487132 -warnings=all -build-cache C:\Users\dell\AppData\Local\Temp\arduino_cache_549412 -verbose C:\Users\dell\AppData\Local\Temp\arduino_modified_sketch_391317\ListFiles.ino
    Using board 'teensy41' from platform in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr
    Using core 'teensy4' from platform in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr
    Detecting libraries used...
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_ITALIAN "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teensy4" "C:\\Users\\dell\\AppData\\Local\\Temp\\arduino_build_487132\\sketch\\ListFiles.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
    Alternatives for LittleFS.h: [LittleFS-main@1.0.0]
    ResolveLibrary(LittleFS.h)
      -> candidates: [LittleFS-main@1.0.0]
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_ITALIAN "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teensy4" "-IC:\\Users\\dell\\Google Drive\\ARDUINO SKETCHES\\libraries\\LittleFS-main\\src" "C:\\Users\\dell\\AppData\\Local\\Temp\\arduino_build_487132\\sketch\\ListFiles.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
    Alternatives for SPI.h: [SPI@1.0]
    ResolveLibrary(SPI.h)
      -> candidates: [SPI@1.0]
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_ITALIAN "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teensy4" "-IC:\\Users\\dell\\Google Drive\\ARDUINO SKETCHES\\libraries\\LittleFS-main\\src" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\SPI" "C:\\Users\\dell\\AppData\\Local\\Temp\\arduino_build_487132\\sketch\\ListFiles.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_ITALIAN "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teensy4" "-IC:\\Users\\dell\\Google Drive\\ARDUINO SKETCHES\\libraries\\LittleFS-main\\src" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\SPI" "C:\\Users\\dell\\Google Drive\\ARDUINO SKETCHES\\libraries\\LittleFS-main\\src\\LittleFS.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_ITALIAN "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teensy4" "-IC:\\Users\\dell\\Google Drive\\ARDUINO SKETCHES\\libraries\\LittleFS-main\\src" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\SPI" "C:\\Users\\dell\\Google Drive\\ARDUINO SKETCHES\\libraries\\LittleFS-main\\src\\LittleFS_NAND.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_ITALIAN "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teensy4" "-IC:\\Users\\dell\\Google Drive\\ARDUINO SKETCHES\\libraries\\LittleFS-main\\src" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\SPI" "C:\\Users\\dell\\Google Drive\\ARDUINO SKETCHES\\libraries\\LittleFS-main\\src\\littlefs\\lfs.c" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_ITALIAN "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teensy4" "-IC:\\Users\\dell\\Google Drive\\ARDUINO SKETCHES\\libraries\\LittleFS-main\\src" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\SPI" "C:\\Users\\dell\\Google Drive\\ARDUINO SKETCHES\\libraries\\LittleFS-main\\src\\littlefs\\lfs_util.c" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_ITALIAN "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teensy4" "-IC:\\Users\\dell\\Google Drive\\ARDUINO SKETCHES\\libraries\\LittleFS-main\\src" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\SPI" "C:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\SPI\\SPI.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
    Generating function prototypes...
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_ITALIAN "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teensy4" "-IC:\\Users\\dell\\Google Drive\\ARDUINO SKETCHES\\libraries\\LittleFS-main\\src" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\SPI" "C:\\Users\\dell\\AppData\\Local\\Temp\\arduino_build_487132\\sketch\\ListFiles.ino.cpp" -o "C:\\Users\\dell\\AppData\\Local\\Temp\\arduino_build_487132\\preproc\\ctags_target_for_gcc_minus_e.cpp" -DARDUINO_LIB_DISCOVERY_PHASE
    "C:\\Program Files (x86)\\Arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\dell\\AppData\\Local\\Temp\\arduino_build_487132\\preproc\\ctags_target_for_gcc_minus_e.cpp"
    Sto compilando lo sketch...
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/precompile_helper" "C:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr/cores/teensy4" "C:\\Users\\dell\\AppData\\Local\\Temp\\arduino_build_487132" "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -x c++-header -O3 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_ITALIAN "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr/cores/teensy4" "C:\\Users\\dell\\AppData\\Local\\Temp\\arduino_build_487132/pch/Arduino.h" -o "C:\\Users\\dell\\AppData\\Local\\Temp\\arduino_build_487132/pch/Arduino.h.gch"
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -c -O3 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_ITALIAN "-IC:\\Users\\dell\\AppData\\Local\\Temp\\arduino_build_487132/pch" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teensy4" "-IC:\\Users\\dell\\Google Drive\\ARDUINO SKETCHES\\libraries\\LittleFS-main\\src" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\SPI" "C:\\Users\\dell\\AppData\\Local\\Temp\\arduino_build_487132\\sketch\\ListFiles.ino.cpp" -o "C:\\Users\\dell\\AppData\\Local\\Temp\\arduino_build_487132\\sketch\\ListFiles.ino.cpp.o"
    In file included from C:\Users\dell\AppData\Local\Temp\arduino_modified_sketch_391317\ListFiles.ino:3:0:
    C:\Users\dell\Google Drive\ARDUINO SKETCHES\libraries\LittleFS-main\src/LittleFS.h: In member function 'bool LittleFS_RAM::begin(uint32_t)':
    C:\Users\dell\Google Drive\ARDUINO SKETCHES\libraries\LittleFS-main\src/LittleFS.h:292:34: error: 'extmem_malloc' was not declared in this scope
       return begin(extmem_malloc(size), size);
                                      ^
    ListFiles: In function 'void setup()':
    ListFiles:25: error: call of overloaded 'println(uint64_t)' is ambiguous
       Serial.println(myfs.usedSize());
                                     ^
    In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Stream.h:24:0,
                     from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/HardwareSerial.h:106,
                     from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/WProgram.h:46,
                     from C:\Users\dell\AppData\Local\Temp\arduino_build_487132\pch\Arduino.h:6:
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Print.h:84:9: note: candidate: size_t Print::println(const String&)
      size_t println(const String &s)   { return print(s) + println(); }
             ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Print.h:85:9: note: candidate: size_t Print::println(char)
      size_t println(char c)    { return print(c) + println(); }
             ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Print.h:89:9: note: candidate: size_t Print::println(uint8_t)
      size_t println(uint8_t b)   { return print(b) + println(); }
             ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Print.h:90:9: note: candidate: size_t Print::println(int)
      size_t println(int n)    { return print(n) + println(); }
             ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Print.h:91:9: note: candidate: size_t Print::println(unsigned int)
      size_t println(unsigned int n)   { return print(n) + println(); }
             ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Print.h:92:9: note: candidate: size_t Print::println(long int)
      size_t println(long n)    { return print(n) + println(); }
             ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Print.h:93:9: note: candidate: size_t Print::println(long unsigned int)
      size_t println(unsigned long n)   { return print(n) + println(); }
             ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Print.h:101:9: note: candidate: size_t Print::println(double, int)
      size_t println(double n, int digits = 2) { return print(n, digits) + println(); }
             ^
    ListFiles:27: error: call of overloaded 'println(uint64_t)' is ambiguous
       Serial.println(myfs.totalSize());
                                      ^
    In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Stream.h:24:0,
                     from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/HardwareSerial.h:106,
                     from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/WProgram.h:46,
                     from C:\Users\dell\AppData\Local\Temp\arduino_build_487132\pch\Arduino.h:6:
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Print.h:84:9: note: candidate: size_t Print::println(const String&)
      size_t println(const String &s)   { return print(s) + println(); }
             ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Print.h:85:9: note: candidate: size_t Print::println(char)
      size_t println(char c)    { return print(c) + println(); }
             ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Print.h:89:9: note: candidate: size_t Print::println(uint8_t)
      size_t println(uint8_t b)   { return print(b) + println(); }
             ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Print.h:90:9: note: candidate: size_t Print::println(int)
      size_t println(int n)    { return print(n) + println(); }
             ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Print.h:91:9: note: candidate: size_t Print::println(unsigned int)
      size_t println(unsigned int n)   { return print(n) + println(); }
             ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Print.h:92:9: note: candidate: size_t Print::println(long int)
      size_t println(long n)    { return print(n) + println(); }
             ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Print.h:93:9: note: candidate: size_t Print::println(long unsigned int)
      size_t println(unsigned long n)   { return print(n) + println(); }
             ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Print.h:101:9: note: candidate: size_t Print::println(double, int)
      size_t println(double n, int digits = 2) { return print(n, digits) + println(); }
             ^
    ListFiles: In function 'void printDirectory(File, int)':
    ListFiles:59: error: call of overloaded 'println(uint64_t, int)' is ambiguous
            Serial.println(entry.size(), DEC);
                                            ^
    In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Stream.h:24:0,
                     from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/HardwareSerial.h:106,
                     from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/WProgram.h:46,
                     from C:\Users\dell\AppData\Local\Temp\arduino_build_487132\pch\Arduino.h:6:
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Print.h:95:9: note: candidate: size_t Print::println(unsigned char, int)
      size_t println(unsigned char n, int base) { return print(n, base) + println(); }
             ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Print.h:96:9: note: candidate: size_t Print::println(int, int)
      size_t println(int n, int base)   { return print(n, base) + println(); }
             ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Print.h:97:9: note: candidate: size_t Print::println(unsigned int, int)
      size_t println(unsigned int n, int base) { return print(n, base) + println(); }
             ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Print.h:98:9: note: candidate: size_t Print::println(long int, int)
      size_t println(long n, int base)  { return print(n, base) + println(); }
             ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Print.h:99:9: note: candidate: size_t Print::println(long unsigned int, int)
      size_t println(unsigned long n, int base) { return print(n, base) + println(); }
             ^
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/Print.h:101:9: note: candidate: size_t Print::println(double, int)
      size_t println(double n, int digits = 2) { return print(n, digits) + println(); }
             ^
    Uso la libreria LittleFS-main alla versione 1.0.0 nella cartella: C:\Users\dell\Google Drive\ARDUINO SKETCHES\libraries\LittleFS-main 
    Uso la libreria SPI alla versione 1.0 nella cartella: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SPI 
    call of overloaded 'println(uint64_t)' is ambiguous
    So, I'm very far from the goal... someone knows how to go on?
    Thanks in advance

  2. #2
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    7,424
    Morning @Sandro
    First you don't need to copy LittleFS or copy the .h file to the cores. I would revert what you did. If you installed Teendsyduino 1.54beta9 or even 1.54beta8 LittleFS is installed as part of the install process. The second thing is that you missed uncommenting the SPI lines:
    Code:
      //Uncomment these lines for Teensy 3.x Audio Shield (Rev C)
      //SPI.setMOSI(7);  // Audio shield has MOSI on pin 7
      //SPI.setSCK(14);  // Audio shield has SCK on pin 14
    The third thing is that I don't know what the CS pin is for the audio shield so I would double check that.

    EDIT:
    After that you can pull the sketch for listFiles by going to FILE > EXAMPLES > LITTLEFS > listFiles
    Last edited by mjs513; 06-12-2021 at 03:20 PM.

  3. #3
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    14,863
    As mjs513 said - just a clean TD 1.54 Beta 9

    Look at example/lfsintegrity.ino

    Something like:
    Code:
    //#define TEST_RAM
    #define TEST_SPI
    //#define TEST_QSPI
    //#define TEST_PROG
    //#define TEST_MRAM
    Then follow :: defined(TEST_SPI)

    and set for that the correct :: const int FlashChipSelect = 10;

    When that builds check the USED libraries and things related should use Teensy install not sketchbook/libraries - remove as needed.

    Then enjoy the UI ... nothing special but it allows exercise of the interface methods and filling the media where the code can be followed to see what it does and how.

    If :: //#define ROOTONLY // NORMAL is NOT DEFINED!
    It will make a series of subdirs

    Entering a Number for loops (see ?/help UI) will in some sequence write, remove or extend files showing it working.

    enter 0 to stop

    Do dirs and remove files, add big files or remove them - will give some indication of the time involved and the I/o rates.

    NOTE: Visit the LittleFS thread with any issues or feedback.

  4. #4
    Senior Member Sandro's Avatar
    Join Date
    Nov 2016
    Location
    Rimini - Italy
    Posts
    134
    Thank you mjs513, thank you defragster!; Sorry for this late feedback, I've just come back to work on my project; in the meanwhile new TD 1.55 has been published; all necessary features required by littleFS seem to be included, since ListFiles and LFSintegrity are both compiled without errors .. LFSintegrity shows that write operation is fast and exceed extensively my needs... Next step will be checking the performance when writing/reading audio files. Thanks again!

  5. #5
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    14,863
    @Sandro /@all - With released TD 1.54 each "Media Type" is in its own sketch folder:
    Code:
    T:\arduino-1.8.15\hardware\teensy\avr\libraries\LittleFS\examples\Integrity\MRAMSPI
    T:\arduino-1.8.15\hardware\teensy\avr\libraries\LittleFS\examples\Integrity\PROG
    T:\arduino-1.8.15\hardware\teensy\avr\libraries\LittleFS\examples\Integrity\PSRAM
    T:\arduino-1.8.15\hardware\teensy\avr\libraries\LittleFS\examples\Integrity\QSPI
    T:\arduino-1.8.15\hardware\teensy\avr\libraries\LittleFS\examples\Integrity\RAM
    T:\arduino-1.8.15\hardware\teensy\avr\libraries\LittleFS\examples\Integrity\SPI
    I just noted this as a handy sketch extension for if nothing else PROG to save and restore data to SD.
    Hopefully I could get to it - though anyone eager might do it sooner:
    Code:
    LittleFS : TOO and FROM SD 'directory' and LittleFS "Media"
     > All Files and Dirs to SD CARD "DIR" - PROG BACKUP
     > All Files and Dirs From SD CARD "DIR" - PROG RESTORE
     > All Files and Dirs ON SD CARD "DIR" - PROG VERIFY
    Some variation on this code in functions.ino in a separate file that could be included in 'user' sketch, without all the other code.
    Working with a "DIR" on SD because the SD card could hold multiple copies - and lots more data
    Would also be a useful way to retrieve/pre-populate 'LOGGED' data from FLASH or PSRAM, etc:
    Code:
    int DirectoryVerify(File dir) {
    	int errCnt = 0;
    	while (true) {
    		File entry =  dir.openNextFile();
    		if (! entry) {
    			break;
    		}
    		if (entry.isDirectory()) {
    			Serial.print("\tD");
    			Serial.print(entry.name()[0]);
    			Serial.print(" ");
    			errCnt += DirectoryVerify(entry);
    			Serial.print("\n");
    		} else {
    			uint64_t fileSize, sizeCnt = 0;
    			char mm;
    			Serial.print(entry.name()[0]);
    			fileSize = entry.size();
    			while ( entry.available() ) {
    				if (fileSize < sizeCnt ) break;
    				entry.read( &mm , 1 );
    				sizeCnt++;
    			}
    			if (fileSize != sizeCnt ) {
    				Serial.printf("\n File Size Error:: %s found %llu Bytes for Size %llu \n", entry.name(), sizeCnt, fileSize);
    				errCnt++;
    				errsLFS++;
    			}
    		}
    		entry.close();
    	}
    	return errCnt;
    }

  6. #6
    Senior Member Sandro's Avatar
    Join Date
    Nov 2016
    Location
    Rimini - Italy
    Posts
    134
    Hi defragster, thank you for this infos: I haven't noticed the new examples for LittleFS, also in my application it will be usefull to use SD to save/retreive files from/to Flash memory as you suggest.
    Next step: I start checking if my audio application (based on SerialFlashFile) can be converted into LitteFS with similar performances. It will take some time... let's see.

  7. #7
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    14,863
    Those Media specific versions were split out at the last. The Larger Integrity had an awkward name and even worse user experience with the "#ifdef HELL" nature of usage as it grew to allow use of all in on sketch.

    I've extended it toward working to copy PSRAM as the first sample TO or FROM SD Card - though it fails me when I want to push all of the LFS data into a subfolder on the SD card

    ... post when you are ready to see it ... perhaps on the LittleFS thread so the work can be seen by anyone looking there.
    >> LittleFS-port-to-Teensy-SPIFlash - p#5 was already copied there ...

    I started with PSRAM because it is static across uploads and doesn't wear on any FLASH - but is an easy edit to make for all the Media types.

  8. #8
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    14,863
    Quote Originally Posted by Sandro View Post
    Hi defragster, thank you for this infos: I haven't noticed the new examples for LittleFS, also in my application it will be usefull to use SD to save/retreive files from/to Flash memory as you suggest.
    Next step: I start checking if my audio application (based on SerialFlashFile) can be converted into LitteFS with similar performances. It will take some time... let's see.
    See here : LittleFS-port-to-Teensy-SPIFlash >> LittleFS media data Save or Restore from SD card

    As far as file access : AFAIK anything that works as FILE from SD card will work when passed a FILE from LFS?

  9. #9
    Senior Member Sandro's Avatar
    Join Date
    Nov 2016
    Location
    Rimini - Italy
    Posts
    134
    Quote Originally Posted by defragster View Post
    See here : LittleFS-port-to-Teensy-SPIFlash >> LittleFS media data Save or Restore from SD card

    As far as file access : AFAIK anything that works as FILE from SD card will work when passed a FILE from LFS?
    @defragster: sorry for this late reply: if your question is (but I dubt I got the point) about the correct working in case of audio-reading applications, all the followings work fine: reading a file from SD, an LFS-file from SPI flash chip, a SerialFlash-file from SPI flash chip.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •