2024-05-02 06:39 AM
Hi,
I have been trying to connect PSRAM and NOR FLASH to STM32H563 nucleo board using Dual-Quad-SPI.
I was able to successfully read/write to PSRAM and NOR Flash individually in single-Quad-SPI mode with base address 0x90000000. i'm not clear how the addressing is taken care, when we connect both PSRAM and NOR Flash in dual-Quad-SPI mode.
2024-05-02 07:11 AM
Dual in ST parlance typically means two identical devices side by side
Different devices? Perhaps if you don't use the concurrently, and you can mux/swap the chip select?
2024-05-02 07:19 AM - edited 2024-05-17 12:29 AM
Hello @shii and welcome to the Community :),
When DMM = 1 in OCTOSPI_CR, the OCTOSPI is in dual-memory configuration: if DMODE = 011, two external Quad-SPI devices (device A and device B) are used in order to send/receive eight bits (or 16 bits in DTR mode) every cycle, effectively doubling the throughput.
If address X is even, then the byte that the OCTOSPI gives for address X is the byte at the address X/2 of device A, and the byte that the OCTOSPI gives for address X + 1 is the byte at the address X/2 of device B. In other words, the bytes at even addresses are all stored in device A and the bytes at odd addresses are all stored in device B.
Thanks to alternate function, you can connect a PSRAM and NOR Flash memories using one OCTOSPI interface. So, you can use different GPIOs to mange the chips select and the clock. The software should configure the chips select and the clock for the memory to be accessed.
For more information about the Dual-quad configuration, I advise you to refer to RM0481 "Dual-quad configuration" par graph under "23.4.5 OCTOSPI regular-command protocol signal interface" section and Figure 141 OCTOSPI block diagram in dual-quad configuration.
I hope this 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.
2024-05-02 10:21 PM
RAM + Flash in dual quad mode does not make sense at all - except when you MUX them as you seemingly already did.
Playing with fire anyway...
2024-05-27 09:07 PM
In Dual-memory configuration, the bytes at even addresses are all stored in device A and the bytes at odd addresses are all stored in device B. We dont want to store like this as we are connecting FLASH and RAM different devices. If we use single-memory configuration and try to switch between Device A and Device B using MSEL bit, how that memory mapped mode addressing will work? for example, if Device A address is mapped with 0x90000000 means what will be the address mapping for Device B?
2024-05-28 11:45 PM
We are not going to use concurrently. Either one the of the devices will be accessed at a time. How do we mux/swap the chip select between two devices?
2024-05-29 12:26 AM - edited 2024-05-29 05:28 AM
Should be an IOSelect or FlashID type settings. Physically would need different NCS pins.
As I've said before "Dual" means two identical devices ganged side to side.
Diagram what pins you have wired up. Certainly possible to wire things up that won't work...
2024-05-29 01:55 AM
Two different NCS pins means, do i need to configure two GPIO pins as outputs and connect with chip select pins of FLASH and RAM accordingly and have to control the chip select in software?
2024-05-29 03:20 AM - edited 2024-06-27 03:23 AM
Hello @Nagarajan ,
To clarify my last comment, for dual quad mode, both devices must be identical, because in this mode the same commands and addresses are issued in parallel to both memories.
When DMM = 1, the bytes at even addresses are all stored in device A and the bytes at odd addresses are all stored in device B, as detailed in RM0481 "Dual-quad configuration" section.
But it is possible to connect 2xQuadSPI memories using only one OCTOSPI instance.
There are 2 possible solutions:
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.
2024-05-29 04:02 AM
See @KDJEM.1 post below
I think one could also multiplex the AF settings for the NCS / CLK functionality to support multiple devices.
Some of the H5 have a single OCTOSPI, I think it is not well setup for FLASH and RAM operation