Skip to main content
mluerkens
Associate III
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

Alex - APMemory
Associate II
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-...)

mluerkens
mluerkensAuthor
Associate III
January 4, 2022

Hi Alex, thanks

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

Tx

Matthias

mluerkens
mluerkensAuthor
Associate III
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.

mluerkens
mluerkensAuthor
Associate III
January 11, 2022

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

Alex - APMemory
Associate II
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

Alex - APMemory
Associate II
January 12, 2022
Alex - APMemory
Associate II
January 12, 2022
mluerkens
mluerkensAuthor
Associate III
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.

mluerkens
mluerkensAuthorBest answer
Associate III
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

Alex - APMemory
Associate II
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".