cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to use HSPI + OctoSPI to talk to PSRAM + NOR-FLASH (respectively)

RMand
Senior

I am trying to bring up the STM32U5A9J-DK wherein I can use the external NOR_FLASH over OctoSPI_1 and the external PSRAM over HSPI_1 -- both in memory mapped mode. I am trying to use the STM32CubeMX to generate the drivers but am having some difficulties.

I have tried using the 'default' configuration suggested by the CubeMX IDE and have also tried , unsuccessfully, to tweak some of the GPIO setttings. Bottom line, no matter what I do, the IDE always insists that the Data pins in the OCTOSPI1 are in conflict with a whole host of other functions -- But I don't think they are because the Alternate Functions are set up correctly.

So why in blazes is the CubeMX saying that there is a conflict? NOTHING MAKES SENSE HERE.

I have attached a screenshot of the IDE showing the conflicts. Thanks for any help.

I am attaching a screen shot of the IDE where I see the conflict.

16 REPLIES 16

Hi, I tried to create a CubeMX project based on STM32U5A9J-DK board. and both OSPI and HSPI IOs configuration by default is NO conflict. I may find my screen shot attached. so there is no IO configuration conflict issue in my side.

Would you try to install last version of CubeMX and try this approach in your side?

 

Maybe it is my misunderstanding -- but your image also highlights the IO data lines in YELLOW.

Are you saying that the yellow highlight is acceptable i.e. NOT A CONFLICT?

QSHAO.1
ST Employee

Yes, the yellow highlight is acceptable and I confirm the OctoSPI IO configuration in the IOC file of STM32U5 DK is correct. thanks! 

Alex - APMemory
Senior II

Did you find out the issue? I can confirm STM32U5x9J-DK is supporting 512Mb HPI IoT RAM APS512XXN-OBR (and 256Mb APS256XXN-OBR), without any issue. 

Alex

Hi Alex,

Yes, I was able to get past this issue. For reasons that I cannot explain, the IOC file mapped the IO7 line to the wrong GPIO and it was a nightmare tracking it down. Once I got that resolved things are looking a lot more rosy now.

Thanks for following up on this issue.

Cheers

I do have a follow up question though.

Should I set the memory type (i.e. hxspi1.Init.MemoryType) to 'HAL_XSPI_MEMTYPE_APMEM_16BITS' or 'HAL_XSPI_MEMTYPE_APMEM'?  It is not clear to me what is being traded off between these two options. My understanding is that the APS512 is an x8 memory that can also work in x16 mode if we go with DTR on the IO bus.

Cheers

 

Hi, 

APMemory PN with "XX' (like APS512XXN-OBR or APS256XX-OBR) are supporting both OPI & HPI mode. The device is booting in x8 and can be swap to x16 by mode register. The command you mentioned are setting the configuration on the MCU side.

The benefit of using HPI x16 mode are following:

  1. Double the bandwidth versus OPI, up to 1Gbps and provide a pin count, power, and a very competitive advantage compared to SDRAMx32 (512Mb SDRAM x32 price example; 512Mb HPI price example)
  2. An other advantage of HPI versus OPI is active power, for the same amount of data tranfert, you can run HPI half of the time and consume much less power, spending more time in standby. https://www.st.com/en/partner-products-and-services/iot-ram-hpi-opi-psram.html

Below are illustrations of pin count & power benefit of OPI versus SDRAMx16 & HPI versus SDRAMx32

AlexAPMemory_0-1700594139436.pngAlexAPMemory_1-1700594177125.png

Hope this help

Alex