Skip to main content
Explorer
May 11, 2024
Solved

STM32L4P5RG two OSPI with multiplexed pin not working

  • May 11, 2024
  • 7 replies
  • 3734 views

Hi :

I have a custom board, the mcu is STM32L4P5RG, I also connect Flash W25Q128(OSPI1) and APS6404L(OSPI2) to it.

But I can't reset them and hal status always return HAL_ERROR. Can someone help me?

The hardware schematic(Sch.png),Clock configuration(Clock.png),OSPI configuration(OSPI1.png, OSPI2.png),Reset code(Code.png)  are as below:

I also attach my project.

Sch.pngClock.pngOSPI1.pngOSPI2.pngCode.png

    This topic has been closed for replies.
    Best answer by Zhou JianQiang

    Hi :

    Finally, I can reset both OSPI device. It need send more data to ensure reset successfully. Just change HAL_OSPI_ADDRESS_NONE to HAL_OSPI_ADDRESS_1_LINE will fix this.

    I think it is something related to Errata sheets.

    7 replies

    Explorer
    May 11, 2024

    delete git link here.

    Explorer
    May 14, 2024

    Hi @AME MCU Support Center BB , Can you help me and give me some advise?

    Technical Moderator
    May 14, 2024

    Hi @Zhou JianQiang ,

    Could you please try to decrease the OCTOSPI clock frequency.

    As mentioned in STM32L4P5 datasheet Table 115. OCTOSPI(1) characteristics in SDR mode(2) and Table 116. OCTOSPI characteristics in DTR mode (with DQS)(1)/Octal and HyperBus™, the maximum clocks frequencies of OCTOSPI are 92 MHz in SDR mode and 90 MHz in DTR mode.

    KDJEM1_0-1715676821547.pngKDJEM1_1-1715676849479.png

    Thank you.

    Kaouthar

    Explorer
    May 15, 2024

    Hi @KDJEM.1 

    I have set Clock Prescaler to 2, Do you mean it doesn't enough, I have to set OCTOSPI clock from 120Mhz to 90Mhz?

    Explorer
    May 15, 2024

    Hi, 

    Let me add few comments, I hope this helps.

    Attached file for QSPI SDR & STM32L4P5 (tested on STM Disco)

    Regarding QSPI device there are a couple of options possible which is not visible in the root PN APS6404L on your schematics, such as 1.8V/3V, RBX, Halfsleep ( PN such as APS6404L-3SQR / 3SQN / SQR / SQRH / SQH / SQN). For example RBX device ("SQR...") can burst only up to 84MHz, while WRAP can run up to max frequency.

    For your reference,  see below an overview of different QSPI SDR/DDR options available (voltage, function, frequency, power, and type of package)

    AlexAPMemory_0-1715783812801.png

    Datasheet available at https://www.apmemory.com/products/psram-iot-ram/

    QSPI Prototyping at https://www.mouser.com/c/semiconductors/memory-ics/dram/?m=AP%20Memory%20Technology&package%20%2F%20case=SOP-8~~USON-8%7C~WLCSP-15%7C~WLCSP-8&rp=semiconductors%2Fmemory-ics%2Fdram%7C~Package%20%2F%20Case

    Regards

    Alex

    Explorer
    May 17, 2024

    Hi Alex:

    thank you for your reply, I use APS6404L-3SQR.

    Explorer
    May 17, 2024

    Good, for APS6404L-3SQR.you can use the WRAP32 command up to 133MHz and linear burst (with RBX) up to 84MHz.

    Spec link:  http://www.apmemory.com/wp-content/uploads/APM_PSRAM_E3_QSPI_APS6404L-3SQR-v2.6-KGD_PKG.pdf

    Hope all goes well

    Alex

    Explorer
    May 20, 2024

    Hi @Alex - APMemory :

    Can you tell me more about  EID? I can't find any description about this.

    Explorer
    May 20, 2024

    Hi, 

    EID is just the ID # of our device. You don't need to use it.

    Regards

    Alex

    Explorer
    May 20, 2024

    Hi @Alex - APMemory :

    thank you for you reply.

    Zhou JianQiangAuthorAnswer
    Explorer
    May 20, 2024

    Hi :

    Finally, I can reset both OSPI device. It need send more data to ensure reset successfully. Just change HAL_OSPI_ADDRESS_NONE to HAL_OSPI_ADDRESS_1_LINE will fix this.

    I think it is something related to Errata sheets.