cancel
Showing results for 
Search instead for 
Did you mean: 

Initialization OSPI in Quad mode SPI for working with NOR FLASH

AB.19
Associate II

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.

12 REPLIES 12
TDK
Guru

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
Associate II

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.

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
Up vote any posts that you find helpful, it shows what's working..

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.

>>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
Up vote any posts that you find helpful, it shows what's working..

Could you share with community initialization code and read/write code for your platform?

I think it's will be very helpful.

please share..

Amel NASRI
ST Employee

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 Accept as Solution on the reply which solved your issue or answered your question.

Khouloud ZEMMELI
ST Employee

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