Teensy 4.1 psram memtest


Hey Guys I have installed PSRAM but when I run memtest tells me that I am missing header files H on my computer library?
Starting with a T_4.1 and PSRAM soldered - Cool. github.com/PaulStoffregen/teensy41_psram_memtest

Then A copy of the Arduino IDE needs to be installed 1.8.x or 2.x.

Then Current TeensyDuino 1.57 for the IDE 1.8.x, or Teensy in IDE 2.x Board Manager after installing the PJRC URL to the Preferences Additional board mgr URL section:

Then selecting the T_4.1 board in the IDE should build and work properly.

If Errors the Verbose console output might explain what went wrong.

Downloaded and tested here to work with IDE 2.0.3 and TD 1.58 beta 3 ( 0.58.3 ) on T_4.1 w/8MB PSRAM:
EXTMEM Memory Test, 8 Mbyte
 CCM_CBCMR=B5AE8304 (88.0 MHz)
testing with fixed pattern 5A698421
testing with pseudo-random sequence, seed=2976674124
testing with fixed pattern 00000000
 test ran for 36.43 seconds
All memory tests passed :-)

build notes:
Memory Usage on Teensy 4.1:
  FLASH: code:36796, data:6040, headers:8360   free for files:8075268
   RAM1: variables:6944, code:34176, padding:31360   free for local variables:451808
   RAM2: variables:12384  free for malloc/new:511904
It comes up with-

Invalid library found in /users/justin/documents/arduino/libraries/teensy41_psram_memtest: no header files (.h) found in /users/justin/documents/arduino/libraries/teensy41_psram_memtest

am i missing somthing?
Last edited:
Yes, that is not a 'library' - just a 'sketch' folder.

Don't place the folder in "/users/justin/documents/arduino/libraries"

Put it in your normal sketchbook or other folder and in the IDE just open the file: "teensy41_psram_memtest.ino"

The PSRAM 'library' code is included in the CORES directly for the T_4.1 processor.
memory Usage on Teensy 4.1:
FLASH: code:28100, data:7064, headers:8864 free for files:8082436
RAM1: variables:7680, code:25432, padding:7336 free for local variables:483840
RAM2: variables:12384 free for malloc/new:511904

Cool thanks is this what it meant to say? sorry for thew noob questions.
memory Usage on Teensy 4.1:
FLASH: code:28100, data:7064, headers:8864 free for files:8082436
RAM1: variables:7680, code:25432, padding:7336 free for local variables:483840
RAM2: variables:12384 free for malloc/new:511904

Cool thanks is this what it meant to say? sorry for thew noob questions.

That looks close to what I have here. If you have TeensyDuino 1.57 it would have diff size as the Beta of 1.58 is in use here with an updated tool chain that grows code.

Glad to help. The IDE gives a decent usable and reproducible build system - but there are some things to learn. Under the covers there is a lot going on that just works.

The important thing is the output in the Serial Monitor showing the PSRAM to store and recall expected values provided by the memtest.
i cant get it to test the memory but

Is there any output on the serial monitor?

Built with USB Type: Serial
There should be output when it connects. That program will sit and do nothing until Serial connects with: while (!Serial) ; // wait

That is as it should be - but a Serial Monitor needs to connect and then output as abbreviated in post #2 should show in some fashion.

If nothing is displaying, then there is a problem of some sort.

There is a photo to compare here (below): pjrc.com/store/psram.html

That should match the chip 'pin 1'/DOT orientation and the soldering should be mostly clean as shown with no shorts or flux between the pins.

First, go to /users/justin/documents/arduino/libraries and delete anything you copied there. That "libraries" folder is a special location. Putting normal program there could cause problems. So before you go any farther, look in that folder and delete any folders and files you put there.

Quit and restart Arduino IDE, just in case it's remembering anything about stuff that was incorrectly placed in that libraries folder.

Then in Arduino, click File > New Sketch. You'll get a new window with a sample program that has 2 empty functions called setup() and loop(). Delete all that, so the window has nothing. Then go to this page on github for the memory test code.


Select all 147 lines and then copy to clipboard, either with CTRL-C (or Command-C if MacOS) or menu Edit > Copy. Then in blank Arduino window, where you deleted the sample do-nothing program, paste with CTRL-V or Edit > Paste. You'll see all 147 lines of code appear in the Arduino window. Then quickly check Tools > Board to make sure Teensy 4.1 is selected, and click the Upload button (2nd from the left in the green menu bar, shown with a right arrow).

After the code is uploaded, click Tools > Port to quickly check that your Teensy board is selected. Then open the serial monitor window, which can be done by clicking the button on the far right side of the green menu bar, or with the menu Tools > Serial Monitor. If using the older Arduino IDE 1.8.x this opens another window. If using newer Arduino IDE 2.0.x, the serial monitor opens as tab in the bottom part of the main window. Either way, you should see the memory test results.

If you want the program stored on your PC, in Arduino use File > Save As. It will give you a normal file save window with the proper location where Arduino expects to find saved files.

Hopefully this helps you get past this initial hurdle and run the memory test. If you get stuck or something goes wrong, please remember we can't see your screen. Helping over the internet like this goes so much better if you show us a screenshot, so we can see whatever error message is on your screen, together with details like the tiny text that appears in the bottom part of the Arduino IDE window.
Yep I have a ext memory test 0mbyte better check something

If you are seeing this: "EXTMEM Memory Test, 0 Mbyte"
> And the Teensy LED is FLASHING then the PSRAM is not being recognized. That is what I see on a T_4.1 with NO PSRAM installed.
> When a PSRAM is found and properly passes the tests the LED will just be ON continuously without any flashing.
> It will stay OFF if the test never starts.

Paul's p#11 steps are good to assure a clean build after that sketch was placed in the libraries folder - but with the text above it seems to have properly built.

Given that "0 Mbyte" text is presented: It would be best to unplug the Teensy and examine the soldering and compare to the p#10 image - and notes on the linked PJRC site to assure the PSRAM is installed in the right location - when only one it needs to be in the end position between pins #31 to #34. And the soldering must be 'clean enough'. No shorts, good looking solder from all pins to pads, and even flux residue can interfere with this device at the high speeds it runs at.
@Jayjer66 if you can upload a picture of the soldered PSRAM we can see it to confirm.

And the Pin1/DOT of the PSRAM as shown in p10 image should be nearest corner Pin #32.

Also, where did you get the PSRAM - and does it match one of those shown on the linked page where four are displayed on there?

ICK - Flooded with Flux - if all that shine around the pins (on both PSRAM and FLASH) is flux and not a photo aberration.

Chip label isn't legible to confirm make or type. But if a normal 8 MB PSRAM it should work, but that excess flux has to go.

The solder looks well placed and connected - if a bit generous - but no apparent solder shorts.

It probably should not hurt to carefully reflow each pin lightly given the flux will hopefully liquify and melt with the solder making sure if it does to contact the pad and the pin leg a brief time with the tip.

With that done then the board needs washed of the flux. Some are water washable - here 91% Isopropyl alcohol works with an old clean toothbrush. The flux between the legs needs to be removed and rinsed free, then properly dried before powering.

Given that all pins but the CS are common to both chips - both need to be clean to have best chance of either working properly.

At least one user in past has done the reflow and flux removal to get it working. In fact one soldered here may have started odd and gone working with better flux removal.