cancel
Showing results for 
Search instead for 
Did you mean: 

How to read the data from the external flash memory in STM32H7S78-DK?

Shivani
Senior

Hi,

I am using STM32H7S78-DK Board, I am configuring XSPI2 in Stm32CubeMX for enabling external 1-Gbit Nor flash memory. But when I am writing the data into the Memory address (i.e. 0x700000000) it is going into the hard fault handler in STM32CubeIDE. Why?

I am referring the Repository files of the mentioned Board (XSPIM_SwappedMode) and MX66LM1G46G datasheet for writing the data into the flash memory. Writing and reading is not an issue but when I am trying into move the data into the memory it is creating an issue. Why?

What changes needs to be done to write and read the data into the memory?

Thanks in advance.

1 REPLY 1

I don't have a STM32H7S78, but I'd anticipate that writing to NOR FLASH via memory mapping is not conducive to how they work. They are designed for Reading Fast, the writing is a multi-step and slow process, where you enable the writing, you write pages without spanning, and you wait for the write to complete. And the cells need to be erased prior to writing.

Could that be done with a state machine, and stuffing wait-states? Perhaps, but it's complicated and liable to insert long and unpredictable stalling.

Want random-access read/write, at bus speeds, use RAM

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..