Skip to main content
DMacD.1
Associate II
April 7, 2022
Question

Store Framebuffer in OSPI PSRAM?

  • April 7, 2022
  • 7 replies
  • 3162 views

MCU: STM32L4R9ZIJ6

PSRAM: APS1604M-3SQR-SN

Display: 800x480, RGB888, 24-bit

Hi, I'd like to use the mentioned PSRAM to store the TouchGFX framebuffer using OCTOSPI in QuadSPI mode.

I have tried setting the Frame Buffer Start Address to

OCTOSPI1_BASE (0x90000000), but that does not seem to work. I only get junk data.

I have read the TouchGFX docs, LTDC datasheets, and OSPI datasheets very thoroughly, and still cannot figure it out.

Additional Q's:

  1. How does the MCU "know" an external PSRAM has been added?
  2. Should I have used FMC for this procedure instead?

Note: I am using a custom board/application. Please assume the hardware is correct for the sake of discussion.

Any help would be appreciated. If any further clarification is needed please ask. I will include an image of the LCD display image as it stands.

This topic has been closed for replies.

7 replies

Tesla DeLorean
Guru
April 8, 2022

>>How does the MCU "know" an external PSRAM has been added?

You'd have BSP code initializing the clocks,pins and OSPI/OSPIM peripheral, bring-up/config memory, enable the memory-mapping.

If you don't initialize it on the MCU, it will Hard Fault

You can validate the memory works via data pattern testing.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
DMacD.1
DMacD.1Author
Associate II
April 8, 2022

Thank you for your response.

I've done the initializing through CubeMX with GPIO pins as such:

// octospi.c 
 
/**OCTOSPI1 GPIO Configuration
 PC11 ------> OCTOSPIM_P1_NCS
 PF8 ------> OCTOSPIM_P1_IO0
 PF6 ------> OCTOSPIM_P1_IO3
 PF7 ------> OCTOSPIM_P1_IO2
 PF10 ------> OCTOSPIM_P1_CLK
 PF9 ------> OCTOSPIM_P1_IO1
 */

Is there anything further I need to do?(Outside of the MX generated code)

I have tried the APS1604M-3SQR-SN example code on pg.57 of AN5050, but found nothing written to 0x90000000 upon inspection in the CubeIDE Memory Monitor.

Tesla DeLorean
Guru
April 8, 2022

I'm not familiar with your design/implementation.

If this is a custom design you'll likely have to do some validation

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
DMacD.1
DMacD.1Author
Associate II
April 8, 2022

No worries. It is a custom design. I'm looking for software answers and assuming the hardware is correct. If all I need to do is setup OSPI in CubeMX then write to address 0x90000000 then that answers my question to a degree. Thank you.

Alex - APMemory
Associate II
July 4, 2022

There are limitation with the STM32L4R... to use OPI & QSPI RAM.

This is solved with later STM32 (L5, U5, H7...)

Alex