Skip to main content
AB.19
Associate II
August 6, 2021
Question

Initialization OSPI in Quad mode SPI for working with NOR FLASH

  • August 6, 2021
  • 4 replies
  • 5144 views

Hi everyone!

I'm trying to use STM32H723 in QUAD SPI mode.

CubeMX does project generation but when I trying to compile project at Keil an error appears about undeclared "GPIO_AF4_OCTOSPIM".

If I changed it to GPIO_AF4_OCTOSPIM_P1 compilation run without errors.

But how I could know that I chose correct define or not?

Other question about commands to work with memory, which HAL command and it what sequence for READ/WRITE/STATUS CHECK in this mode?

I cannot find examples from STM to test and revise my code.

This topic has been closed for replies.

4 replies

TDK
August 6, 2021

GPIO_AF4_* defines evaluate to 4. Use whichever one is defined in your library. Looks like it's GPIO_AF4_OCTOSPIM_P1 in the current library.

https://github.com/STMicroelectronics/STM32CubeH7/blob/master/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_gpio_ex.h#L147

There are several OSPI examples in the CubeMX repository. Here is one:

https://github.com/STMicroelectronics/STM32CubeH7/tree/ccb11556044540590ca6e45056e6b65cdca2deb2/Projects/STM32H7B3I-EVAL/Examples/OSPI/OSPI_RAM_MemoryMapped

"If you feel a post has answered your question, please click ""Accept as Solution""."
AB.19
AB.19Author
Associate II
August 6, 2021

I've seen this example. But in my case, it is not informative, since it describes the mode of operation of 8 lines, and I need 4. And I must be sure of the commands that I use.

Tesla DeLorean
Guru
August 6, 2021

Sounds like a bug in the code generator, about par for the course.

To use QSPI parts on OSPI, you need to specify 4-bit (or 1, 2 as appropriate) for the instruction, address and data widths, and 8-bit for the command size.

Is this a work project?

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
AB.19
AB.19Author
Associate II
August 6, 2021

This is a working project in which we are making the migrate from STM32F4 to the more powerful H7 MCU line. Do you have any real experience on this issue?

I am still awaiting a response from the STM team with working examples. When we worked with the STM32F4 MCU, STM provided many examples of how to work with the QSPI.

Tesla DeLorean
Guru
August 6, 2021

>>Do you have any real experience on this issue?

Got Micron/Winbond QSPI devices running on an H7A3ZI, which is a OCTOSPI platform similar to the H723

In the process of coding an .FLM for Keil

I can free climb..

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Amel NASRI
ST Technical Moderator
August 13, 2021

Hi @AB.19​ ,

Regarding the issue with generated STM32CubeMX code: I let our STM32CubeMX expert @Khouloud ZEMMELI​  check & confirm it. It will be helpful to precise used version of the tool or share an ioc file.

For the second request about the examples: I suggest you to have a look to the article How to configure OctoSPI and QuadSPI with an STM32? Useful links are there.

-Amel

To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.
Khouloud ZEMMELI
ST Employee
August 13, 2021

Hello @AB.19​ ,

Thanks for your post,

As mentioned by @Amel NASRI​ , it will be helpful if you provide your ioc file.

Otherwise, I'll check the problem then I'll get back to you.

Thanks, Khouloud

Khouloud ZEMMELI
ST Employee
August 17, 2021

Hi again @AB.19​ ,

I cannot reproduce the issue using the latest CubeMX version, a similar issue was detected before and has been fixed now, so could you please switch to the v6.3.0 and check if the problem linked to CubeMX code generation still occurs or not?

If yes, please share your ioc file to be able to check it.

I'll be waiting for your feedback :)

Thanks, Khouloud