2024-08-22 04:50 PM
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.
2024-08-23 01:17 AM - edited 2024-08-23 01:18 AM
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.
The indirect mode mode support read and write operations.
For more information I advise you to take a look at Quad-SPI interface on STM32 microcontrollers and microprocessors - Application note
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
The QSPI examples can help you to write and read data from external memory.
Is my reply answer your request?
Thank you.
Kaouthar
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.