Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 11 of 11

Thread: EXTMEM memory test program for testing PSRAM in teensy 4.1

  1. #1
    Junior Member
    Join Date
    Aug 2020
    Posts
    12

    EXTMEM memory test program for testing PSRAM in teensy 4.1

    Recently I had purchased teensy 4.1 along with PSRAM from Pimoroni.

    Today I did soldered carefully PSRAM on the teensy 4.1 board. I ran the memory test program as per pjrc website and it's showing EXTMEM memory Test, 0 Mbyte.

    But when I am running next example i.e. having hello world ....that one is running fine and I am able to see the output in serial monitor.

    I checked my soldering and according to me looks good and there is no sorting . Can anyone please advise on this matter.

    I wanted to add three pics....unable to find out how to attach them for forum members to help to understand my problem.

    my source code...

    extern "C" uint8_t external_psram_size;
    EXTMEM char bigBuffer[1000000] = {0};
    int led = 13;

    void setup() {
    while (!Serial) ; // wait
    uint8_t size = external_psram_size;
    Serial.printf("EXTMEM Memory Test, %d Mbyte\n", size);
    delay(5000);
    strcpy(bigBuffer, "Hello Teensy 4.1 using PSRAM!");
    pinMode(led, OUTPUT);
    }

    void loop() {
    Serial.println(bigBuffer);
    digitalWrite(led, HIGH);
    delay(250);
    digitalWrite(led, LOW);
    delay(250);
    }

    the result in serial monitor...

    EXTMEM memory test, 0 Mbyte

    Hello Teensy 4.1 using PSRAM!
    Last edited by jishnuch; 08-02-2020 at 06:31 PM. Reason: added source code

  2. #2
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    584
    I added a PSRAM chip today and your program reports 8Mbyte. That leaves bad soldering, a bad chip, orientation, location, ??

  3. #3
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    5,558
    If you all want to test your installation of PSRAM suggest using PJRC's teensy41_psram_memtest.ino sketch which can be downloaded from : https://github.com/PaulStoffregen/te...am_memtest.ino

    It will report back to you the size of the PSRAM chip or chips installed and run a memory test on the chip to make sure it is good.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,541
    Quote Originally Posted by jishnuch View Post
    But when I am running next example i.e. having hello world ....that one is running fine and I am able to see the output in serial monitor.
    Cortex-M7 has a 32K data cache. To properly test the PSRAM, you need to flush and delete the cached data with arm_dcache_flush_delete(address, size). See the memory test program for an example.

    Your program is almost certainly "working" without the PSRAM because the string you copied to the external memory is being held in the M7's cache. You're just reading it back from the cache. If your program uses other parts of the memory which cause the M7 to automatically flush the cache and decide to cache something else, you'll find it will indeed fail when the M7 tries to actually read from the PSRAM to refill the cache.

  5. #5
    Junior Member
    Join Date
    Aug 2020
    Posts
    12
    Hi... after soldering this is the first test I did and it resulted in EXTMEM memory Test, 0 Mbyte

  6. #6
    Junior Member
    Join Date
    Aug 2020
    Posts
    12
    Quote Originally Posted by jonr View Post
    I added a PSRAM chip today and your program reports 8Mbyte. That leaves bad soldering, a bad chip, orientation, location, ??
    (1) bad soldering - I checked the soldering using high resolution eyeglass and found it to be clean and there is no shorting among them.
    (2) Orientation - have matched the dot on the chip with the dot marked on the board.
    (3) location - have soldered on the location between pin # 31, 32 and 33, 34.
    (4) bad chip - this may be possible - since I don't have have another chip and hence there is no other way to verify.

  7. #7
    Junior Member
    Join Date
    Aug 2020
    Posts
    12
    Quote Originally Posted by PaulStoffregen View Post
    Cortex-M7 has a 32K data cache. To properly test the PSRAM, you need to flush and delete the cached data with arm_dcache_flush_delete(address, size). See the memory test program for an example.

    Your program is almost certainly "working" without the PSRAM because the string you copied to the external memory is being held in the M7's cache. You're just reading it back from the cache. If your program uses other parts of the memory which cause the M7 to automatically flush the cache and decide to cache something else, you'll find it will indeed fail when the M7 tries to actually read from the PSRAM to refill the cache.
    this is very interesting....you have answered all my questions. So as of now only solution is that I have to get a new PSRAM chip and replace it with the old one.

  8. #8
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,541
    Maybe first re-heat the 8 solder connections? Apply liquid flux, if you have any. Don't be shy about leaving your soldering iron in contact for several seconds, since you can't make the chip any worse than things are now.

    We've seen this before, where one of the pins looked soldered but wasn't. Reheating the soldering usually fixes that problem.

  9. #9
    I case it helps, I happened to solder the PSRAM to my Teensy 4.1 last weekend, both ordered from Pimoroni too. And the result of the test was positive. Of course, there could be a problem with that specific chip, for any reason. Just wanted to verify that it looks like a reliable supplier.

  10. #10
    Junior Member
    Join Date
    Aug 2020
    Posts
    12
    Quote Originally Posted by PaulStoffregen View Post
    Maybe first re-heat the 8 solder connections? Apply liquid flux, if you have any. Don't be shy about leaving your soldering iron in contact for several seconds, since you can't make the chip any worse than things are now.

    We've seen this before, where one of the pins looked soldered but wasn't. Reheating the soldering usually fixes that problem.
    Boss... you are 200% right. This was the exact problem and today morning I applied the solder paste and did held soldering iron for longer time on all the solder connections and finally ran your test program and its working. THANKS TO ALL.

  11. #11
    Member
    Join Date
    Feb 2020
    Location
    South Africa
    Posts
    35
    Quote Originally Posted by jishnuch View Post
    Boss... you are 200% right. This was the exact problem and today morning I applied the solder paste and did held soldering iron for longer time on all the solder connections and finally ran your test program and its working. THANKS TO ALL.
    naah the RC part is the boss over thee...

Posting Permissions

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