Forum Rule: Always post complete source code & details to reproduce any issue!
Page 33 of 33 FirstFirst ... 23 31 32 33
Results 801 to 811 of 811

Thread: LittleFS port to Teensy/SPIFlash

  1. #801
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    6,130
    Teensy LC Issue with LittleFS

    @Frank B asked about if we did any testing with Teensy LC (https://forum.pjrc.com/threads/64592...l=1#post266527) so I hooked up a LC to the littlefs_teensy_test1a sketch using a W25Q64FV to start and the sketch hangs on the first:
    Code:
      file = myfs.open("structureData1/temp_test.txt", FILE_WRITE);
    the preceding code seems to work to create the file and the directory:
    Code:
    LittleFS Test
    TotalSize (Bytes): 8388608
    ...............
    started
    MAKE files
    printDirectory
    --------------
    DIR	structureData1 / 
    
     0 dirs with 0 files of Size 0 Bytes
    I did a erase just in case.

    As a sanity check I ran SerialFlash BenchMark:
    Code:
    Raw SerialFlash Hardware Test
    
    Read Chip Identification:
      JEDEC ID:     EF 40 17
      Part Nummber: W25Q64FV
      Memory Size:  8388608 bytes
      Block Size:   65536 bytes
    
    Reading Chip...
    
    Writing 4096 signatures
    
    Double Checking All Signatures:
      all 4096 signatures read ok
    
    Checking Signature Pairs
      all 2047 signature pairs read ok
    
    Checking Read-While-Write (Program Suspend)
      write 256 bytes at 256
      write time was 405 microseconds.
      read-while-writing: 00 00 00 00 15 F5 95 4B 
      test passed, good read while writing
    
    Checking Read-While-Erase (Erase Suspend)
      erase time was 172754 microseconds.
      erase correctly erased 65536 bytes
      read-while-erasing: 00 00 00 00 15 F5 95 4B 
      test passed, good read while erasing
    
    All Tests Passed  :-)
    
    Test data was written to your chip.  You must run
    EraseEverything before using this chip for files.
    Just to make sure.
    Last edited by mjs513; 01-16-2021 at 02:35 PM. Reason: Found the link

  2. #802
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    8,218
    @mjs513 Sounds like you have been busy!

    What about Teensy 2? (Just kidding)

  3. #803
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    7,658
    Quote Originally Posted by mjs513 View Post
    Code:
    All Tests Passed  :-)
    Just to make sure.
    Nice

  4. #804
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    6,130
    Quote Originally Posted by KurtE View Post
    @mjs513 Sounds like you have been busy!

    What about Teensy 2? (Just kidding)
    MOrning @KurtE
    A bit. Hate leaving things hanging so I had to finish off the BBM stuff (not much more I can do on that) and test the LC I just remembered. Going to do a few more tests just in case

  5. #805
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    6,130
    Quote Originally Posted by Frank B View Post
    Nice
    Not nice . That was with SerialFlash not LittleFS. LittleFS seems to be having a problem with LC.

  6. #806
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    6,130
    Another data point. Just ran my bench sketch for read/write and that seemed to work except totalSize is returning 0!
    Code:
    LittleFS Test
    .........................................................................................................................
    started
    Disk Stats:
    Bytes Used: 8192, Bytes Total:0
    Benchmark:
    FILE_SIZE_MB = 1
    BUF_SIZE = 2048 bytes
    Starting write test, please wait.
    
    write speed and latency
    speed,max,min,avg
    KB/Sec,usec,usec,usec
    102.53,25372,16442,19975
    102.67,25351,16385,19944
    
    Starting sequential read test, please wait.
    
    read speed and latency
    speed,max,min,avg
    KB/Sec,usec,usec,usec
    507.84,6912,2980,4031
    507.84,6913,2981,4031
    
    Done
    So something funny going on with LC and LittleFS.

  7. #807
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    6,130
    Ok figured out the problem and its not LittleFS. Problem is just running out of memory within the sketch. There are a few array of 2048 and while by itself is not bad, add that with the sketch size probably causing an issue. I reduced the size of one of the arrays from 2048 to 512 and it worked as it should:
    Code:
    LittleFS Test
    TotalSize (Bytes): 8388608
    started
    MAKE files
    printDirectory
    --------------
    FILE	0_2MBfile.txt		2048000
    DIR	structureData1 / 
    	FILE	temp_test.txt		171
    
     0 dirs with 1 files of Size 171 Bytes
    FILE	temp_test1.txt		171
    FILE	temp_test2.txt		152
    FILE	temp_test3.txt		6144
    
     1 dirs with 4 files of Size 2054467 Bytes
    
    printDirectory
    --------------
    FILE	0_2MBfile.txt		2048000
    DIR	structureData1 / 
    	FILE	temp_test.txt		190
    
     0 dirs with 1 files of Size 190 Bytes
    FILE	temp_test1.txt		190
    FILE	temp_test2.txt		171
    FILE	temp_test3.txt		6144
    
     1 dirs with 4 files of Size 2054505 Bytes
    
    --------------
    printDirectory
    --------------
    FILE	0_2MBfile.txt		2048000
    DIR	structureData1 / 
    	FILE	temp_test.txt		190
    
     0 dirs with 1 files of Size 190 Bytes
    FILE	temp_test1.txt		190
    FILE	temp_test2.txt		171
    FILE	temp_test3.txt		7168
    
     1 dirs with 4 files of Size 2055529 Bytes
    
    Disk Usuage:
    Bytes Used: lu, Bytes Total:lu
    Test for SOME DATA TO TEST
    Don't think %llu is supported on the LC though

    Ok now to see if I can find my audio board to test wavfileplayer

  8. #808
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    6,130
    @Frank B
    Now that I know LittleFS works with LC I started looking at wavPlayer sketch. Think a few files are going to have modified especially play_sd_wav.cpp

  9. #809
    Member
    Join Date
    Mar 2019
    Location
    Sweden
    Posts
    27
    Hi
    I have installed the beta 5 and tested ListFiles example in LittleFS on my Macronix MX25L12835F chip.
    Result is : initialization failed.
    I run on T4.0 and everything works OK using the SerialFlash lib.

    I suspect that the chip gives the wrong Id ???

    Are there any plans of adding more chips?

    /Tomas

  10. #810
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    6,130
    Quote Originally Posted by kets View Post
    Hi
    I have installed the beta 5 and tested ListFiles example in LittleFS on my Macronix MX25L12835F chip.
    Result is : initialization failed.
    I run on T4.0 and everything works OK using the SerialFlash lib.

    I suspect that the chip gives the wrong Id ???

    Are there any plans of adding more chips?

    /Tomas
    Right now LittleFS does not support the Macronix MX25L12835F chip it only supports the following based on the table in the .cpp file:
    Code:
    	{{0xEF, 0x40, 0x15}, 24, 256, 4096, 2097152, 3000, 400000}, // Winbond W25Q16JV*IQ/W25Q16FV
    	{{0xEF, 0x40, 0x16}, 24, 256, 4096, 4194304, 3000, 400000}, // Winbond W25Q32JV*IQ/W25Q32FV
    	{{0xEF, 0x40, 0x17}, 24, 256, 4096, 8388608, 3000, 400000}, // Winbond W25Q64JV*IQ/W25Q64FV
    	{{0xEF, 0x40, 0x18}, 24, 256, 4096, 16777216, 3000, 400000}, // Winbond W25Q128JV*IQ/W25Q128FV
    	{{0xEF, 0x40, 0x19}, 32, 256, 4096, 33554432, 3000, 400000}, // Winbond W25Q256JV*IQ
    	{{0xEF, 0x40, 0x20}, 32, 256, 4096, 67108864, 3500, 400000}, // Winbond W25Q512JV*IQ
    	{{0xEF, 0x70, 0x17}, 24, 256, 4096, 8388608, 3000, 400000}, // Winbond W25Q64JV*IM (DTR)
    	{{0xEF, 0x70, 0x18}, 24, 256, 4096, 16777216, 3000, 400000}, // Winbond W25Q128JV*IM (DTR)
    	{{0xEF, 0x70, 0x19}, 32, 256, 4096, 33554432, 3000, 400000}, // Winbond W25Q256JV*IM (DTR)
    	{{0xEF, 0x70, 0x20}, 32, 256, 4096, 67108864, 3500, 400000}, // Winbond W25Q512JV*IM (DTR)
    	{{0x1F, 0x84, 0x01}, 24, 256, 4096, 524288, 2500, 300000}, // Adesto/Atmel AT25SF041
    	{{0x01, 0x40, 0x14}, 24, 256, 4096, 1048576, 5000, 300000}, // Spansion S25FL208K
    	//FRAM
    	{{0x03, 0x2E, 0xC2}, 24, 64, 128, 1048576, 250, 1200},  //Cypress 8Mb FRAM
    	{{0xC2, 0x24, 0x00}, 24, 64, 128, 131072, 250, 1200},  //Cypress 1Mb FRAM
    	{{0xC2, 0x24, 0x01}, 24, 64, 128, 131072, 250, 1200},  //Cypress 1Mb FRAM, rev1
    	{{0xAE, 0x83, 0x09}, 24, 64, 128, 131072, 250, 1200},  //ROHM MR45V100A 1 Mbit FeRAM Memory
    	{{0xC2, 0x26, 0x08}, 24, 64, 128, 131072, 250, 1200},  //Cypress 4Mb FRAM
    and large Winbond NAND Chips:
    Code:
    	{{0xEF, 0xAA, 0x21}, 24, 2048, 131072, 131596288,   2000, 15000},  //Winbond W25N01G
    	{{0xEF, 0xAA, 0x22}, 24, 2048, 131072, 265289728, 2000, 15000},  //Winbond W25N02G
    	{{0xEF, 0xBB, 0x21}, 24, 2048, 131072, 265289728, 2000, 15000},  //Winbond W25M02
    	{{0xEF, 0xBB, 0x21}, 24, 2048, 131072, 258998272, 2000, 15000},  //Winbond W25M02
    There are no specific plans at the moment to support additional chips but I am sure the list will grow over time. Remember LittleFS is still what you might say is in beta testing and was only just released in TD1.54beta-5 and has since been updated a few times.

    SerialFlash is still operational and there is a possibility that it may be ported over to LittleFS but do not believe that has been decided yet.

    Just as a note I checked Digikey and there is a note on the Macronix MX25L12835F page that you should be aware of:
    Not Recommended for New Design,

  11. #811
    Member
    Join Date
    Mar 2019
    Location
    Sweden
    Posts
    27
    OK, thank's for your answer.
    I'm aware of the not for new designs message.
    The solution is ofcause to switch over to a supported one.
    Will look in the list for someone with compatible layout: 8SOIC with at least 128KB

    /Tomas

Tags for this Thread

Posting Permissions

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