cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7R7: How to setup XSPI for external nor flash AT25XE321D

Leo2Ruan
Associate II

Hi,

The external nor flash AT25XE321D is 32Mbits, support quad IO/XIP spi operation, max. 133MHz Freq. Std. JEDEC/SFDP. It is connected to STM32H7R7Z8J6 with with XSPI1 port-1 interface.

I am using MX v6.116.1 to setup project for my board. By IDE v2.0.0, the project 'Boot' works from internal flash but it is failed to run 'Appli' from external AT25XE321D. And the project 'ExtMemLoader' is successfully built and deployed:

  • File copied successfully under STM32CubeProgrammer.
  • File copied successfully under STM32CubeIDE

I tried STM32CubeProgrammer v2.21.0 to program the AT25XE321D with using the ExtMemLoader.stldr I just built, but failed too. "Error: Mass erase operation failed." See attached log for more logs.

Back to my settings in MX:

1) 100MHz XSPI1 clock source

Leo2Ruan_0-1769154875779.png

2) XSPI1 settings and GPIOs

Leo2Ruan_1-1769154938230.png

There 4 memory types available and no 'custom' option. I pick the 'Macronix' as it is most close to AT25XE321D.

Leo2Ruan_2-1769155001542.png

3) ExtMemLoader settings

Leo2Ruan_3-1769155080008.png

I also go through followings but did not help me to solve the problem:

Can any one give me hand, thanks in advance!

 

 

 

 

1 REPLY 1
KDJEM.1
ST Employee

Hello @Leo2Ruan ;

 

To choose the memory type you need to refer to memory datasheet and check the data ordering.

Micron mode, D0/D1 ordering in DTR 8-data-bit mode.
Macronix mode, D1/D0 ordering in DTR 8-data-bit mode. Regular-command protocol
Macronix RAM mode, D1/D0 ordering in DTR 8-data-bit mode.

Also, I recommend you to take a look at this wiki article Getting started with External memory Manager and External memory loader - stm32mcu and get inspired to configure your project.

This article introduces the External Memory Manager and External Memory Loader in order to:

  • Provide an API that allows access to all types of memory.
  • Launch an application stored in an external memory.
  • Generate an External memory loader file

I hope this help you.

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.