Unable to use W25Q128JV-DTR with LittleFS on Teensy MicroMod [SOLVED]

Hi all,

Recently I started a new project using the Teensy MicroMod with the Sparkfun ATP carrier board.

I'd like to use the onboard W25Q128JV-DTR for storing user settings + data, but the chip just... never initializes, with the code hanging on FS object's "begin()" method.
I'm unable to get any LittleFS example running using either QSPIFlash or QSPINAND objects.

Not even this sample code runs (source). It hangs on "myfs_NOR.begin()"
C++:
//===============================================================================
//  Find Optional Memory Chips on Teensy 4.1
//===============================================================================
#include "LittleFS.h"
extern "C" uint8_t external_psram_size;

//===============================================================================
//  Initialization
//===============================================================================
void setup() {
  Serial.begin(115200);       //Initialize USB serial port to computer

  // Check for PSRAM chip(s) installed
  uint8_t size = external_psram_size;
  Serial.printf("PSRAM Memory Size = %d Mbyte\n", size);
  if (size == 0) {
    Serial.println ("No PSRAM Installed");
  }

// Check for either NOR or NAND Flash chip installed
  LittleFS_QSPIFlash myfs_NOR;    // NOR FLASH
  LittleFS_QPINAND myfs_NAND;      // NAND FLASH 1Gb

  // Check for NOR Flash chip installed
  if (myfs_NOR.begin()) {
    Serial.printf("NOR Flash Memory Size = %d Mbyte / ", myfs_NOR.totalSize() / 1048576);
    Serial.printf("%d Mbit\n", myfs_NOR.totalSize() / 131072);
  }
  // Check for NAND Flash chip installed
  else if (myfs_NAND.begin()) {
    Serial.printf("NAND Flash Memory Size =  %d bytes / ", myfs_NAND.totalSize());
    Serial.printf("%d Mbyte / ", myfs_NAND.totalSize() / 1048576);
    Serial.printf("%d Gbit\n", myfs_NAND.totalSize() * 8 / 1000000000);
  }
  else {
    Serial.printf("No Flash Installed\n");
  }
}
void loop() {
  // put your main code here, to run repeatedly:

}

I took a look at LittleFS.cpp and uncommented all of the existing Serial.println() statements in LittleFS_QSPIFlash::begin() and found the code is hanging at line 765: "flexspi2_ip_read(8, 0x00800000, buf, 3)"
Not sure where to go from there...

When I can't get hardware working I usually assume I messed up somewhere with hookup or software setup, but the chip came pre-installed so unless it's busted I have no idea what I'm doing wrong here.
FWIW my main project (which doesn't use LittleFS at all) runs flawlessly on the micromod while using multiple i2c ports, uart ports, rtc, usbhost, etc...

Any help is appreciated!
 

Attachments

  • Screenshot from 2024-10-25 13-13-01.png
    Screenshot from 2024-10-25 13-13-01.png
    638.8 KB · Views: 10
  • Screenshot from 2024-10-25 13-09-50.png
    Screenshot from 2024-10-25 13-09-50.png
    184.5 KB · Views: 10
I first tried myfs_Program.begin(65536*256) per the datasheet; "The W25Q128JV array is organized into 65,536 programmable pages of 256-bytes each." but initialization failed.
Figuring some pages/kbytes might be reserved for this-or-that reason, I tried myfs_Program.begin(64000*256) and that worked. I'm able to run examples that can write/read files, get bytes used and total bytes available.
16,384,000 bytes may not be the full 16,777,216 advertised bytes, but still more than plenty for my needs.

Thanks for the help!
 
Some of the chip is used for your program and a small part is reserved for EEPROM and the restore program (15 sec button press), so you can't use the entire chip.
 
Some of the chip is used for your program and a small part is reserved for EEPROM and the restore program (15 sec button press), so you can't use the entire chip.
Sorry if this is a dumb question, but is this unique to the Teensy MicroMod? I've used a couple of Teensy 4.1s for previous projects, but opted to use the sdcard reader for data storage whenever needed. Would flash soldered to a Teensy 4.1 still use LittleFS_Program or LittleFS_QSPIFlash / LittleFS_QSPINAND?
 
is this unique to the Teensy MicroMod
No, when using LittleFS_Program it uses the Teensy 'onboard' PROGRAM flash - but is limited to the available part of that Flash as noted in p#4
Would flash soldered to a Teensy 4.1 still use LittleFS_Program or LittleFS_QSPIFlash / LittleFS_QSPINAND?
It would use "LittleFS_QSPIFlash or LittleFS_QSPINAND", depending on the supported chip chosen if NOR or NAND it would all be usable.
 
Last edited:
No, when using LittleFS_Program it uses the Teensy 'onboard' PROGRAM flash - but is limited to the available part of that Flash as noted in p#4

It would use "LittleFS_QSPIFlash or LittleFS_QSPINAND", depending on the supported chip chosen if NOR or NAND if would all be usable.
I see where I messed up, I mistakenly thought the Teensy MicroMod featured a W25Q128JV flash chip in addition to the 8Mb flash chip that's usually included on Teensy 4.1.
Thanks!
 
Back
Top