Skip to main content
Visitor II
August 22, 2024
Solved

read-only or R/W capable of PSRAM connected to G474 QSPI interface

  • August 22, 2024
  • 2 replies
  • 1097 views

In the QSPI chapter of G4series reference manual, we can confirm the support of external QSPI flash chip in mmap mode: "memory-mapped mode: the external flash memory is mapped to the device address space and is seen by the system as if it was an internal memory."

I need more RAM instead of code space, therefore my external space is PSRAM instead of FLASH.

Now I get the indirect mode R/W and mmap mode read all working.

My problem is that my mmao mode write operation always set the PSRAM data to zero, given non-zero value is written in my code.

My question is whether G474 QSPI controller support mmap write operation at all. My fundamental confused concept is that the QSPI controller has no idea what type of external PSRAM I am using. Therefore it's my responsibility to tell the CCR, or the QSPI controller what instruction byte content my PSRAM chip expects for Rd and Wr. However I didn't find the possibility to configure  two instructions(R & W) in two different registers for the mmap mode R & W operation.

I found many official example projects for QSPI FLASH, but not for PSRAM.

This post also mentioned "Memory-mapped mode _won't_ work because that is read-only." https://community.st.com/t5/stm32-mcus-products/use-a-qspi-psram-chip-with-stm32l452xxx/m-p/126249

I read a few posts talking about octo-SPI interface does support PSRAM mmap R/W operation in other families, such as H7, but that's different hardware.

 

    This topic has been closed for replies.
    Best answer by KDJEM.1

    Hello @pxia.1 ,

     

    For the QUADSPI interface, in memory-mapped mode, the external flash memory is seen as an internal memory but with some latency during accesses. Only read operations are allowed to the external flash memory in this mode. as mentioned in RM0440 section 20.3.11 QUADSPI use.

    KDJEM1_3-1724400911112.png

    The indirect mode mode support read and write operations.

    KDJEM1_4-1724400945240.png

     

    For more information I advise you to take a look at Quad-SPI interface on STM32 microcontrollers and microprocessors - Application note 

    KDJEM1_0-1724400807590.png

     

    KDJEM1_1-1724400807592.png

     

    So, for the QUADSPI interface, the write operation is not supported in memory mapped mode.

    For the OCTOSPI interface the write operation is supported in memory mapped mode as mentioned in Getting started with Octo-SPI, Hexadeca-SPI, and XSPI Interface on STM32 MCUs - Application note

    KDJEM1_2-1724400807735.png

     

    The QSPI examples can help you to write and read data from external memory.

    Is my reply answer your request?

     

    Thank you.

    Kaouthar

    2 replies

    KDJEM.1Answer
    Technical Moderator
    August 23, 2024

    Hello @pxia.1 ,

     

    For the QUADSPI interface, in memory-mapped mode, the external flash memory is seen as an internal memory but with some latency during accesses. Only read operations are allowed to the external flash memory in this mode. as mentioned in RM0440 section 20.3.11 QUADSPI use.

    KDJEM1_3-1724400911112.png

    The indirect mode mode support read and write operations.

    KDJEM1_4-1724400945240.png

     

    For more information I advise you to take a look at Quad-SPI interface on STM32 microcontrollers and microprocessors - Application note 

    KDJEM1_0-1724400807590.png

     

    KDJEM1_1-1724400807592.png

     

    So, for the QUADSPI interface, the write operation is not supported in memory mapped mode.

    For the OCTOSPI interface the write operation is supported in memory mapped mode as mentioned in Getting started with Octo-SPI, Hexadeca-SPI, and XSPI Interface on STM32 MCUs - Application note

    KDJEM1_2-1724400807735.png

     

    The QSPI examples can help you to write and read data from external memory.

    Is my reply answer your request?

     

    Thank you.

    Kaouthar

    pxia.1Author
    Visitor II
    August 23, 2024

    Hi, Kaouthar, you reply is accuracy, comprehensive, easy to read. thanks a lot.