cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7R/S XSPI flash wirte when on XIP mode

RSTAC.1
Associate II

Hi, I'm wondering if write and erase external flash menory can be done when XIP mode on the same external Octal-Flash?

I read RM0477 Rev 4.pdf and it told not recommand to programm the flash in this mode, and indirect mode can do that.

Since the MX66UW supports RWW(Read While Write), can this feature be done on H7RS platform? I think it is possible but may encounter a burden on Cortex-M7 self instruction or cache prefetch operation and may never stops, does this affect when I part this flash memory into code section and data section?

 

3 REPLIES 3
KDJEM.1
ST Employee

Hi @RSTAC.1 ,

Read While Write mode is supported in STM32H7R/S.

So, you can refer to XSPI_NOR_ReadWhileWrite_DTR example and get inspired. 

This example describes how to write and read data in Automatic polling mode in an XSPI NOR memory and compare the result.

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.

Hi, Kaouthar,

I refered to this example, but I did find the excutable code runs on internal boot Flash. If it's possible to run on the same external flash chip? That way I can save bugets on another flash for data storage use.

 

Thank you.

Yuanjie

KDJEM.1
ST Employee

Hi @RSTAC.1 ,

The MX66UW1G45G supports the RWW, so if any Program or erase is done in one bank, another bank can be read at the same time.

If the you want to configure the XIP meaning that the read is done in memory mapped mode and the write in indirect mode. The IO Manager should be configured in multiplexed mode and MAXTRANS should be configured to optimize the time sharing between both access.

To use only one Flash for reading (executing) and writing, I advise you to follow these steps for the write:

1- First command : write enable (to be set only once)

2- Second command: write buffer initial (WRBI) : Initial write to indicate that a flash programming process is starting. This command must be sent only one time unless the memory goes on error status. Here some read access in memory mapped mode could occur.

3- Third command : write buffer continue (WRCT) : no need to insert a new write enable.

4- Last command : Write confirm command (WRCF) : The physical programming of the memory starts here after receiving the WRCF command. A page will be programmed.

KDJEM1_0-1713780684411.png

 

If you need to program another page, you need to pool the status register to see if the physical write is finished.

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.