Forum Rule: Always post complete source code & details to reproduce any issue!
Page 3 of 3 FirstFirst 1 2 3
Results 51 to 72 of 72

Thread: Teensy 4.1 external flash memory question.

  1. #51
    Member
    Join Date
    Jul 2020
    Location
    California
    Posts
    29
    Awesome!

    If I'm allowed to share some photos of it, I will.

  2. #52
    Junior Member
    Join Date
    Jan 2021
    Posts
    6
    Hello,
    I am trying to add some flash memory to a teensy 4.1 to save informations in file from SD card or USB connection to teensy memory.
    If already find a lot of informations in this thread and others but not all that I want
    My questions are:
    - do we have to add a PSRAM chip to add flash memory chip?
    - witch component could I use if the advised chips (25Q128JVS, IPS6404LSQ, ESP-PSRAM64H) are not available from the suppliers my work allows? I didn't find any other test with different chips.
    -I see that I could add more than 16MB of flash memory but packaging of Winbond chips with more than 16MB memory didn't exist in Soic-8.

    I'm sorry if answer exists but I didn't find it anywhere. I could be more precise if necessary.
    Thank you for Help

  3. #53
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    14,492
    No, PSRAM is not needed to add FLASH. They are independent and either or both can be used.

    Hopefully the comments in this code snippet point to a chip that has been tested and used that can be acquired?

    Some of these chips are WSON 8 - they can be soldered to work just like the SOIC 8 do.

    The is from the LittleFS thread:
    Code:
    } known_chips[] = {
    	{{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
    If so the direct support for these would be in the Beta TD 1.54 LittleFS library as a file system.

  4. #54
    Junior Member
    Join Date
    Jan 2021
    Posts
    6
    Thank you for your fast reply. It helps me a lot.

    I ordered Winbond W25Q512JVEIM, before it come, I'll try to understant how to initialize flash memory and use LittleFS, teensy41_extram, and SPIFFS_t4 librarys.

    I'll come to you again if I encounter difficulties.

    Thanks again.

  5. #55
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    14,492
    TD 1.54 Beta 6 will be out in some days and will have some stable version of LittleFS included - maybe by the time the chip arrives. That will have all the setup and operation commands needed to read and write that 64 MB Flash. You can use it as the FS - or perhaps if needed and adventurous use that for direct access.

    There are 1 and 2 Gb NAND chips - support for them seems fully functional as testing in recent posts shows with LittleFS - though refinement and inclusion in LittleFS for a more complex interface not yet certain.

    SPIFFS was an initial test platform that worked well - but it seems SPIFFS is being deprecated for use on 'other' systems where it was used like ESP's - and with working LittleFS it may not ever get added attention or support on Teensy.

  6. #56
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    7,224
    Quote Originally Posted by Concombre View Post
    Thank you for your fast reply. It helps me a lot.

    I ordered Winbond W25Q512JVEIM, before it come, I'll try to understant how to initialize flash memory and use LittleFS, teensy41_extram, and SPIFFS_t4 librarys.

    I'll come to you again if I encounter difficulties.

    Thanks again.
    Just as a heads up and by way of explanation of the libraries:
    teensy41_extram - only used for direct writing to the PSRAM and is a bit out dated and really doesn't need to be used anymore. Do a search on EXTMEM there are a few examples on one of the threads. Its still usable though. Remember PSRAM is not flash any data you write to it will be lost on power off.
    SPIFFS_t4 - consider this as deprecated and replaced by LittleFS. It only supports the 16MB version of the winbond flash.

  7. #57
    Junior Member
    Join Date
    Jan 2021
    Posts
    6
    Thank you both,
    I hope than TD1.54 will be ready soon, so I can Try to use my brand new flash.
    I'm still trying to understand how works LittleFS librairy and what I'm going to need.

  8. #58
    Junior Member
    Join Date
    Jan 2021
    Posts
    6
    Hello,
    I received my brand new W25Q128JVSM soldiered on my teensy4.1.
    I tried the LittleFS file test ListFiles to initialize flash ship with a few modification (chipSelect, SPI or QSPI) and the only result it gave was 'initialization failed!'.
    I think my welding is good.
    Click image for larger version. 

Name:	IMG20210125122448.jpg 
Views:	44 
Size:	109.8 KB 
ID:	23441

    So the problem may be I didn't understand how the library and test works.
    I'm sorry if my problem looks easy to solve but do you have some clue or file for init/test for me, it would really help beaucoup I don't know at all what to do?

  9. #59
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    14,492
    That picture shows lots of FLUX and garbage around the connections. I would carefully wash the board getting that cleaned off - here I use 90% Isopropyl and a light toothbrush to get residue off the PCB and around the pins - then get it dry before repowering. Water may work based on the flux involved? or 70% alcohol if that is all that is on hand - but won't dry as fast. I don't have an oven or anything to dry - I hold in hand and heat with a hair dryer hot air making sure no fluid trapped in the SD socket or on either side.

    > also looks like something sitting between pins 1 and 2 on the marked corner? Make sure there are no pin to pin shorts
    > Flux residue can result in failure to function

  10. #60
    Junior Member
    Join Date
    Jan 2021
    Posts
    6
    It looks better Click image for larger version. 

Name:	IMG20210126092348.jpg 
Views:	24 
Size:	117.6 KB 
ID:	23456
    But it don't works. I tried with a W25Q238JVSQ on a other teensy and I was able to initialize flash, create, write and read files, so I will work on it for the moment.
    The next step for me was to use MTP_t4 (https://github.com/WMXZ-EU/MTP_t4) to have a fast access to my files. I know this is a little bid far away of my initial problem but it seams this will be out dated when TD1.54 is available. So do you have any idea when a stable version will be available?

  11. #61
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    14,492
    @Concombre - That does look much better and no signs of shorts between pads.

    All but one of the pads between that chip and the open PSRAM pads are common - only the CS pin is unique. You might check the resistance between each like open pad and place the other probe on the top of each pin leg in turn near the chip body to see that they all make a low resistance connection - the one that is CS will read fully open as they have no connection, the other seven pins should end up showing connected less than an ohm.

    If that shows any weak connect Perhaps doing a reheat/reflow of the solder to of each pin/pad: hot iron onto pad against pin solder and into the pin until it goes liquid with both parts heated. Here I'd do that with a bit of flux paste on each as it would help with the melting and reflowing in less time for a better job. That would mean perhaps a quick clean and full dry again.

    If the chip came from a real distributor and wasn't damaged before or during soldering when fully soldered it should of course work. I've probably soldered a dozen of those FLASH, PSRAM and even the WSON FLASH chips with only the edges to get solder on without any failing to work - and I'm not well versed in soldering.

  12. #62
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    7,224
    @Concombre
    When you say it doesn't work want do you mean - what sketch did you use? Which version of the LittleFS library are you using - the one that came with Teensyduino?

  13. #63
    I am resurrecting this thread for a follow-on question about Flash memory.

    I've got the 64Mb W25Q512JV flash chip soldered and working well on a T4.1 using the spiffs_t4 code. I am holding off on the LittleFS library, until it goes GA. At this point, I can write, read, append, delete, list file system contents, and report used and total space. So, everything is working well, except... My 64mb (512 M-bit chip) is only showing up as having 16Mb of free space.

    I assume I need to change the flashCapacity, flashBaseAddr, and maybe block sizes, but I can't find any references for the 64Mb chip, except what is above in the LittleFS notes. I've tried hacking a few changes with bad results. The current settings are as follows:

    Code:
    	static const uint32_t flashBaseAddr[3] = { 0x800000u,  0x800000u};
    	static const uint32_t eramBaseAddr = 0x07000000u;
    	static char flashID[8];
    	static const void* extBase = (void*)0x70000000u;
    	static uint32_t flashCapacity[3] = {16u * 1024u * 1024u,  8u * 1024u * 1024u};
    Does anyone have a 64Mb chip fully working with spiffs_t4? What capacity settings are you using?

    Thanks in advance.

    -Mike

  14. #64
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    14,492
    If dev there with SPIFFS is still in the state the data image would be lost to grow it .... Much better to use the LittleFS. Spiffs was abandoned by its own author some time back (and AdaFruit and others it seems) and won't likely be updated for Teensy - at least not by the folks who got LittleFS working or likely by Frank B who did the initial SPIFFS work. That was major motivating factor behind picking LittleFS for the focus.

    LittleFS has been stable for perhaps 6 months since support for NAND flash was added- and the format has not yet changed from day #1 - just stuck in beta for the current state of things.

    Not that LittleFS can't change - to add date time stamping or something. Ideally any additions would be made to be compatible if possible. But there hasn't been any feedback from PJRC on that direction or other reason the FS layout might change.

    If it did change - the image could have a sketch file copy off to larger SD card - then put back in the new format.

  15. #65
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    7,224
    As @defragster mentioned the SPIFFS_T4 library is no longer supported and unfortunately I don't remember enough off the top of my head to provide any advice. Would have to go back and look at the code again to see what has to change. LitttleFS is in the current TD1.54beta9 and has been for quite awhile.

    As for date/time stamping, again as @defragster mention, LittleFS can be updated. As a matter of fact it is a work in progress to update it for date stamp at a minimum.

  16. #66
    Thanks guys.

    I pulled down the 1.54beta9 and the native LittleFS examples. Now everything works perfect. I've got a full 67Mb of external flash showing up using the W25Q512JV chip. LittleFS is a lot more intuitive and we get directories back (yippee!). If anyone else is using the 64mb flash chip, select the "LittleFS_QSPIFlash myfs;" in the example files.

    I've got one follow-on question.... In LittleFS is there a way to control the clock speed? In other words, is there a way to increase the write speed? I am shifting some code from SD over to the flash and it looks like the write performance is about the same.

    thanks, Mike

  17. #67
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    14,492
    Quote Originally Posted by TeensyDigital View Post
    Thanks guys.
    ...
    I've got one follow-on question.... In LittleFS is there a way to control the clock speed? In other words, is there a way to increase the write speed? I am shifting some code from SD over to the flash and it looks like the write performance is about the same.

    thanks, Mike
    Awesome to hear it works there!

    The QSPI speed is what it is basically - at least as Paul sees as safe.

    There are notes in the Little FS thread - it might not be pushed to MAX 133MHz clocking ... IIRC it is like 86 or so.

    @mjs513 played clock games more and may know without looking - but seems in the thread are alternate numbers for the INIT code that would change the clock. Though IIRC it doesn't make a big change ???? YMMV ....

  18. #68
    Junior Member
    Join Date
    Feb 2021
    Posts
    4
    I use two flashtest.ino files from Frank B, 2020 one 18524 bytes which compile i load ok but i do not see nothing on serial monitor.
    Another 5585 bytes have compile error . Both are Jully 19th 2020 from https://github.com/PaulStoffregen/teensy41_extram
    I first solder W25Q128JVSQ flash chip on Teensy 4.1 . After that I solder PSRAM chip ESP-PSRAM64H 3.3V SOP8 64Mbit PSRAM which is OK tested.
    I manualy install library from https://github.com/PaulStoffregen/teensy41_extram

    Could anybody sent to my latest library in zip which work with tested software in example directory.
    I want to be shure to have tested correct software before I can conclude that something is wrong with soldering.
    Please help .

  19. #69
    @slatkoh1, you need to download the 1.54 beta #9 of the teensyduino IDE to get LittleFS to compile/work. The library you reference above uses SPIFFS, which I got to partial work, but is not supported going forward and YMMV. The link to get the beta IDE is here:

    https://forum.pjrc.com/threads/67252...no-1-54-Beta-9

    Once you download the IDE you should not need additional libraries for the flash chip. Just open the example programs for LittleFS. For the 64mb W25Q128JvSQ chip you will want to uncomment "LittleFS_QSPIFlash myfs;" and comment out the other configurations. That is what worked for me last weekend.

  20. #70
    Junior Member
    Join Date
    Feb 2021
    Posts
    4
    Hello! Thanks I lot !

    As I see it work!

    I bought five of it in one lot https://www.aliexpress.com/item/4000982286896.html

    and four of PSRAM (two lot) aliexpress.com/item/4001256372448.htm

    It is my first SMD soldering !!! I last soldering before 20 years (I am 58 now).

    I bought https://www.ebay.com/itm/223402330119

    and I must replace broken heater with

    https://www.aliexpress.com/item/32961357282.html

    I do that with new iron which i must order https://www.ebay.com/itm/164828888824

    And I use repaired iron with
    the thinnest tip https://www.ebay.com/itm/402232786613 to

    soldering psram and flash chip at 450oC with Sn60Pb40 1mm wire

    I am so excited and proud.

    Thanks I lot!!!

    Zlatko Horvat
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	test_flash.jpg 
Views:	18 
Size:	89.2 KB 
ID:	25038  

  21. #71
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    1,005
    LittleFS has some inconclusive warnings when checked with

    cppcheck --enable=all --inconclusive

  22. #72
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    14,492
    Quote Originally Posted by zlatkoh1 View Post
    Hello! Thanks I lot !

    As I see it work!

    I bought five of it in one lot https://www.aliexpress.com/item/4000982286896.html

    and four of PSRAM (two lot) aliexpress.com/item/4001256372448.htm

    It is my first SMD soldering !!! I last soldering before 20 years (I am 58 now).

    I bought https://www.ebay.com/itm/223402330119

    and I must replace broken heater with

    https://www.aliexpress.com/item/32961357282.html

    I do that with new iron which i must order https://www.ebay.com/itm/164828888824

    And I use repaired iron with
    the thinnest tip https://www.ebay.com/itm/402232786613 to

    soldering psram and flash chip at 450oC with Sn60Pb40 1mm wire

    I am so excited and proud.

    Thanks I lot!!!

    Zlatko Horvat
    Great news @zlatkoh1 ! Congrats on the soldering to work and great to hear the LittleFS library is working for another!


    Quote Originally Posted by jonr View Post
    LittleFS has some inconclusive warnings when checked with

    cppcheck --enable=all --inconclusive

    It is a LONG thread of 34 pages :: pjrc.com/threads/58033-LittleFS-port-to-Teensy-SPIFlash

    ... putting feedback there will be in context with the dev work for any issues or questions that come up.

    As far as the 'warnings' or other a quick snippet of them might inspire edits as needed - or github Pull Requests if the answer is at hand to resolve them.

Posting Permissions

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