Teensy 4.1 PSRAM and flash

paoloboatto

Well-known member
I soldered a PSRAM chip (Adafruit IC PSRAM 64Mbit SPI 133MHz 8-SOIC, Digi-Key code 1528-4677-ND) and a flash chip (Winbond W25Q128JVSIC, Digi-Key code W25Q128JVSIC-ND) onto the Teensy 4.1 bottom pads, and everything works fine for a while. After some time (many hours, with the Teensy being switched on and off multiple times), the chips are no longer recognized by the Teensy.

I desoldered them from the Teensy and soldered them onto a brand-new Teensy, and the behavior is the same: after some time, they are no longer recognized.

I repeated this procedure with three different new Teensy boards, using the same PSRAM and flash chips. Since the chips are always recognized correctly at first and work fine initially, I’m sure they are OK. The problem seems to be on the Teensy side — probably something gets damaged after some time.

Has anyone experienced the same issue?

Best regards,
Paolo



 
Can you check that Digikey flash part number? When I search on Digikey for W25Q128JVSIC-ND, nothing found.

They do have W25Q128JVSIQ-ND and W25Q128JVSIM-ND. Any chance this part number was a typo, where "Q" became "C"?
 
Two of the Teensy 4.1s on my workbench which I use for testing happen to have those 2 flash memory chips, and the ApMemory PSRAM chip.

Here's a couple photos of the chips I actually have here for testing. Hopefully 1 of these looks similar to the chip you have?

chips1.jpg


chips2.jpg
 
Digikey code is W25Q128JVSIQ-ND
I have also to say that both PSRAM and flash stop being recognized at the same time
 

Attachments

  • Teensy 4.1 PSRAM + Flash.jpg
    Teensy 4.1 PSRAM + Flash.jpg
    47.5 KB · Views: 30
Are you running the QSPI bus at the default speed set by Teensyduino or are you running it faster?
 
Last edited:
Can you tell us how you're testing these chips? Remember, we can't see your code, we can't see your screen. Please be specific about what you're actually doing and the specific things you actually see, so we can hopefully see too.

For testing the PSRAM, please run this memory test program.
 
I check the presence of PSRAM with this simple instructions:
extern "C" uint8_t external_psram_size;
board_.status_bits.bits.PSRAM_connected = (external_psram_size != 0);
Flash memory check:
LittleFS_QSPIFlash myfsFlash; /* inside the board_ structure */
board_.status_bits.bits.flash_connected = board_.myfsFlash.begin();
I'll run the memory test program as suggested by Paul
 
Digikey code is W25Q128JVSIQ-ND
I have also to say that both PSRAM and flash stop being recognized at the same time
You haven't yet said which Teensyduino version you're using - this is quite important.

Also, looking at your image of the parts you've fitted, the PSRAM part number is unreadable, so much so that it appears to have been deliberately removed. I would be highly suspicious about such a part, it could easily be counterfeit if there's no marking; AdaFruit and / or DigiKey should not be selling it if so.
 
Last edited:
PSRAM is Adafruit sold by Digikey; the code is in my first post. I'm using Teensyduino 1.59 with both Arduino 1.8.16 and Arduino 2.3.6 with the same results. I have attached a basic connection test
 

Attachments

  • tset_PSRAM_flash.ino
    485 bytes · Views: 21
But does the part actually have any marking on it? Do you have any more to check, since it seems the ones you’re testing have been repeatedly soldered and de-soldered?

Your “basic connection test” only tells you about the status at boot time, which you’ve said tends to be OK unless the Teensy has been running ”for a while”. It sounds as if the system then recovers if you don’t run it for a period.

As you’ve had the same issues with 3 Teensys, I’d conclude the opposite to you: the Teensys are fine, and one or other chip is faulty. Many many people have used PSRAM and Flash, so a systematic Teensy fault seems highly unlikely, unless they are a bad batch. A good test would be to put one chip on each of two Teensys, and see which one fails; if both fail then maybe you can start blaming the Teensys.

Have you run the PSRAM memory test yet? It only runs once, so you might want to adapt it to run repeatedly until it fails, given you’re not getting immediate failures.
 
As I wrote in the first post the PSRAM and flash are always the same chips (soldered and desoldered; it's not a good practice but it's a good way to show that those are still working). However I'll write a sketch that run continuosly the memory test and that resets the Teensy periodically
 
Just a blind guess, maybe either chip is getting stuck in a strange state that doesn't get cleared by de-asserting its CS pin?

We've sometimes seen "strange" problems which turned out to be hardware staying stuck in a strange state which the libraries don't handle when they initialize the hardware. It usually seems so strange because we humans intuitive expect rebooting Teensy or uploading code to start with a clean slate, but in fact the hardware connected to Teensy doesn't reboot when the software on Teensy restarts.

Next time you see the problem, please try power cycling. Leave the power off for a few seconds, just to be sure. Do the chips both respond after power has been off?
 
I am running your test in post #20 on a setup with an 8MB PSRAM and the same Flash as you have.

1765824174303.jpeg


It has been running for 45 minutes so far without any issue. I'll let it run for awhile to see if anything shows up.

The PSRAM that Adafruit sells through Digikey are listed as 'generic' PSRAM with the labeling is sanded off even in the picture on the Adafruit website. I wouldn't trust any bare chip with the labeling sanded off.

I don't know if it is a factor in the issue your are seeing, but I would recommend getting a known good quality PSRAM. The AP Memory 6404L-3SQR is readily available and of proven quality. Depending on where you are located, Mouser is probably the best option to get them.
 
I wonder if they're sanding the labelling off 1.8V parts? That would probably cause issues, which might take a while to show up. It doesn't really matter - I'd be contacting DigiKey for a refund, they really shouldn't be shipping sanded-off chips for any reason. I see DigiKey have just over 4,000 in stock: they in turn should be getting a refund from Adafruit...

@paoloboatto still hasn't shown evidence of running the full-blown PSRAM test, nor of testing the two parts on separate Teensys, so we're still clutching at straws here...
 
Using the 16 MB PSRAM units just delivered - quick sketch edit from p#20 is below. Changed LittleFS, added print of external_psram_size.
> LittleFS_QSPI myfsFlash;

One is 16+16 and the other is 16 plus 2Gb FLASH - with the edit NAND or NOR doesn't matter, as it was it was not fitting the installed unit.
>> 4.1 with 16MB PSRAM and 2Gb Flash
>> Lockable 4.1 with 32MB PSRAM

Code:
PSRAM size = 16
897
PSRAM connected
flash connected

Code:
PSRAM size = 32
14225
PSRAM connected
flash NOT connected

Two NEW T_4.1's here work with this code as shown.
Code:
/* PSRAM/flash connection test */
#include <LittleFS.h>
extern "C" uint8_t external_psram_size;
LittleFS_QSPI myfsFlash;

/* restart */
#define RESTART_ADDR       0xE000ED0C
#define WRITE_RESTART(val) ((*(volatile uint32_t *)RESTART_ADDR) = (val))

/* constants */
uint32_t timeIntervalBetweenTests_ms = 2000;  /* [ms] */
uint32_t resetTeensyNumberOfTests = 10;            /* resets Teensy every resetTeensyNumberOfTests */
uint32_t resetTeensyCounter = 0;

void setup() {
  init_();
}

void loop() {
  runTest();
  delay(timeIntervalBetweenTests_ms);
  if(resetTeensyCounter == resetTeensyNumberOfTests) {
    Serial.println("restarting Teensy ...");
    delay(20);
    WRITE_RESTART(0x5FA0004);
  }
}

void runTest() {
  Serial.println(millis());
/* PSRAM */
  if(external_psram_size != 0) { Serial.println("PSRAM connected"); }
  else  { Serial.println("PSRAM NOT connected"); }
/* flash */ 
  if(myfsFlash.begin()) { Serial.println("flash connected"); }
  else  { Serial.println("flash NOT connected"); }
/* counter */
  resetTeensyCounter++;
}

void init_() {
  Serial.begin(115200);
  while(!Serial) {;}
  Serial.printf("PSRAM size = %d\n", external_psram_size);
}
 
I let my test (p#21) run for 3 hours with no failure, so shut it down.

The only legitimate reason to sand chips is to make it harder to reverse engineer an assembly once they are installed. Perhaps they were ESP chips sanded in preparation for a project that got canceled and then sold off as 'generic' parts for cheap, but usually they are sanded after install.

Searching on "Adafruit PSRAM Sanded " I came across one thread on PI forum where they got sanded chips from Adafruit. The ESP logo was still partially visible on some of them. They were complaining that they did not perform as well as the AP and other chips in regards to pushing bus speeds and were going to try to return them.
 
I wonder if they're sanding the labelling off 1.8V parts?

The sanded chip is shady.

But please allow me to offer a less sinister scenario. Perhaps the IPUS, ESP and Lyontek parts are really made by ApMemory? Maybe that would involve some sort of contract where the branded chips were only supposed to be used in specific products? But not-so-reputable Chinese vendors (you know, the type you see on Alibaba and Aliexpress) managed to buy excess stock from PCB assembly companies (who weren't allowed to sell their stock), and then resell them to the general public?

1765840682543.png


Continuing the guesswork... maybe ApMemory learned the chips they had sold under exclusive contracts were being resold against their agreements and tried to clamp down on that unauthorized reselling behavior? Perhaps that effort did little to dissuade the Alibaba / Aliexpress vendors and whoever was selling the specially branded chips to them, but instead prompted them to sand the chips so they could still make the sales without giving ApMemory any way to track the parts back to them. Maybe? All just guesswork on my part...

The 3 non-ApMemory chips you see on PJRC's PSRAM chip page were purchased from Alibaba vendors. Before the ApMemory chip was readily available from reputable distributors, PJRC purchased a good number from somewhat shady vendors. But none we got had the chips sanded. From every batch, I personally soldered 1 to a Teensy 4.1 and tested before we sold the rest of the batch.

In fact, I don't even really know for 100% certain whether the IPUS, ESP and Lyontek parts really made by ApMemory. It's just a strong suspicion of mine. It is theoretically possible 1 or more companies made nearly perfect clones or work-a-like chips. If that is the real explanation, maybe there are subtle differences. But I did a *lot* of testing on all 4 chips. They all seemed to give identical results.

PJRC purchased the ApMemory part from RuTronink, who are (or were at the time) an authorized distributor for ApMemory. Once we were able to buy the ApMemory part, I never went back to the shady vendors selling the IPUS, ESP and Lyontek parts.

But the sanding could indeed be obscuring wrong info or defective parts. Whatever the reason that chip was sanded, I would recommend getting a known genuine ApMemory chip.
 
Last edited:
Back
Top