Skip to main content
Visitor II
January 4, 2022
Solved

STM32L4P5-DK with Quad SPI RAM, do I have to remove the Octo SPI RAM

  • January 4, 2022
  • 16 replies
  • 6979 views

The board can be populated with a Quad SPI PSRAM, sharing OCTOSPI1. Do I need to remove the OctoSPI before using the Quad SPI or is it enough to disconned CS?

    This topic has been closed for replies.
    Best answer by mluerkens

    Hi Alex, AN5050 is setting chips select boundary to 0, your code is setting it to 9 which seems to be the correct value. I reduced the buffer size for testing to 4k and using that shows no errors. Seems my flying lead setup is really causing the problems. I found a friend, being able to put the memory on the discokit.

    Tx

    Matthias

    16 replies

    Explorer
    January 4, 2022

    You can just disconnect CS of Quad SPI, no need to remove OctoSPI memory.

    Regards

    Alex 

    PS: fyi, you can have a wide range of QSPI RAM option from 16Mb up to 128Mb, SDR/DDR, 1.8V/3V, SOP8/USON8/WLCSP (APMemory PN: APS1604M-..., APS6404L-..., APS12804O-...)

    mluerkensAuthor
    Visitor II
    January 4, 2022

    Hi Alex, thanks

    we have planned with an APS1604M-3SQR in combination with STM32L4P5

    Tx

    Matthias

    mluerkensAuthor
    Visitor II
    January 11, 2022

    I'm having issued to get it working. Unfortunately I failed with the STM32L4P5-DK and soldering the 0402 33Ohm Resistors, So actually I connected the APS1604M-3SQR to a nucleo with the STM32L4P5 with a bread board :-(. Yes it is ugly. I set the octospi clock down to 40 MHz.

    I'm following AN5050 and copied the source code for initializing the and testing the PSRAM, but it fails. It is not visible.

    I found this main.c in the forum (unfortunately with the main.h), it seems to be for an APS1608 due to the chip size.

    I used the first steps of init from this sample and tried to issue a read id which returns som random values. So either my setup won't work at all with a bread board or I'm doing wrong something else.

    E.G. the attached main.c is adding some additional lines to the MX_OCTOSPI_INIT

     hospi1.Init.WrapSize = HAL_OSPI_WRAP_NOT_SUPPORTED;

     hospi1.Init.ClkChipSelectHighTime = 0;

     hospi1.Init.MaxTran = 0;

    This is different from AN5050 where it is defined to be 482

     hospi1.Init.Refresh = 0;

    Is there anone out, being able to share his experience.

    mluerkensAuthor
    Visitor II
    January 11, 2022

    oops, read id is working on setting the frequency below 33 Mhz. So I'm still puzzled

    Explorer
    January 12, 2022

    Hi Matthias,

    This is strange why you could not use the original Discokit from STM. we can confirm both QSPI and OPI are running well on this board (and much rmore reliable than bread board).

    For your reference, the attachment (main.c & main.h) is a small check program for reading and writing PSRAM, which can be executed for simple check..

    l  If the memory is executed correctly then LED1 will toggle.

    l  If the LED2 (GPIO_PIN_14) does not light up, the environment is correct.

    /*---------------

    Function description:

      PSRAM using APMemory QSPI SDR , first enter Quad mode,

      and then read and write 16Byte in a cycle.

      If there is an error the LED of GPIO_PIN_14 lights up.

    -------------- */

    Hope this help

    Alex

    mluerkensAuthor
    Visitor II
    January 12, 2022

    Hi Alex, thanks, regarding the discokit it's just a lack of mechanical skills to populate the 0402 resistors.I try to find somebody being able to do the soldering work.

    Thanks, I keep you updated.

    mluerkensAuthorAnswer
    Visitor II
    January 12, 2022

    Hi Alex, AN5050 is setting chips select boundary to 0, your code is setting it to 9 which seems to be the correct value. I reduced the buffer size for testing to 4k and using that shows no errors. Seems my flying lead setup is really causing the problems. I found a friend, being able to put the memory on the discokit.

    Tx

    Matthias

    Explorer
    January 13, 2022

    Hi Matthias,

    Good to hear that you manage your test and project

    Regarding the CS bit,

    -Case1: no use cross boundary page (RBX)  => Set to 0

    -Case2: use cross boundary page                  => Set to 9

    for corresponding boundary size of APS1604M-3SQR.

    Alex

    PS: We have 2 options RBX/non RBX for our QSPI SDR. RBX PN contains "SQR" and Non RBX device contains "SQ" without "R".

    mluerkensAuthor
    Visitor II
    January 17, 2022

    Hi Alex, now I got the APS1604M-3SQR populated as U14 on the STM32L4P5-DK. But not with the desired results. Just with setting clock divider very slow I'm able to read the ID (0d 5d 1b 58 31 31 46 3a) which seems to be correct. I clock diver is below 35, I can't even read the ID. The memory test you provided already generates a couple of errors. U12 is still connected but without R68 for OCTOSPIM_P1_NCS. All settings besides the clock divider are according to AN5050. Soldering is double and triple checked and looks fine. Of course 0402 by hand is tough, but this was done by a very skilled HW engineer. Is there anything I can check.

    mluerkensAuthor
    Visitor II
    January 17, 2022

    HI Alex, I got the APS1604M-3SQR soldered on the STM32L4P5-DK but I'm not having good results. Soldering has been done by a very skilled HW engineer, but manually populating 0402 is pretty tough. I just can read the ID on clock dividers being larger than around 35 and I'm having a lot of errors on running the memory test. It does not seem to be better than my setup with flying leads. I don't know, what to check. I did everything according to AN5050 and I'm using the provided source code. Do you have any idea?